### The problem
I put this in the forum yesterday:
https://community.home-as…sistant.io/t/problems-with-slack-sending-files-as-of-2023-10/624736/1
But in summary...
Since 2023.10, slack integration (though I imagine it's not limited to slack) spits an error out when attempting to use this in notify:
data:
file:
path: "blah.jpg" (or mp4) etc..
```
- id: '169515xxxxxx'
alias: Shop Upload
description: ''
trigger:
- platform: mqtt
topic: security-cam/shop/#
condition: []
action:
- delay:
hours: 0
minutes: 1
seconds: 15
milliseconds: 0
- service: notify.xxxx
data:
message: Uploaded Video
title: Motion below deck
target: '#testing'
data:
file:
path: /media/shop/recording_{{ trigger.payload }}.mp4
```
logs:
```
2023-10-10 18:41:31.837 ERROR (MainThread) [homeassistant.components.automation.moss_video_snapshot_and_video_upload] Shop Video Snapshot and Video Upload: Parallel action at step 4: parallel 1: Error executing script. Unexpected error for call_service at pos 1: Can not serialize value type: <class 'NoneType'>
headers: {}
value: None
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 508, in update_body_from_data
body = payload.PAYLOAD_REGISTRY.get(body, disposition=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/payload.py", line 118, in get
raise LookupError()
aiohttp.payload.LookupError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/formdata.py", line 145, in _gen_form_data
part = payload.get_payload(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/payload.py", line 71, in get_payload
return PAYLOAD_REGISTRY.get(data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/payload.py", line 118, in get
raise LookupError()
aiohttp.payload.LookupError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 264, in _async_notify_message_service
await self.async_send_message(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/slack/notify.py", line 323, in async_send_message
return await self._async_send_local_file_message(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/slack/notify.py", line 163, in _async_send_local_file_message
await self._client.files_upload(
File "/usr/local/lib/python3.11/site-packages/slack/web/base_client.py", line 213, in _send
res = await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/slack/web/base_client.py", line 244, in _request
async with session.request(http_verb, api_url, **req_args) as res:
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 508, in _request
req = self._request_class(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 313, in __init__
self.update_body_from_data(data)
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 510, in update_body_from_data
body = FormData(body)()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/formdata.py", line 170, in __call__
return self._gen_form_data()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/formdata.py", line 149, in _gen_form_data
raise TypeError(
TypeError: Can not serialize value type: <class 'NoneType'>
headers: {}
value: None
```
### What version of Home Assistant Core has the issue?
2023.10
### What was the last working version of Home Assistant Core?
2023.9.3
### What type of installation are you running?
Home Assistant Container
### Integration causing the issue
Slack
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/slack
### Diagnostics information
I don't have this at this moment, as I've reverted back to 2023.9.3
### Example YAML snippet
```yaml
alias: Driveway Video Snapshot and Video Upload
description: slack
trigger:
- platform: mqtt
topic: security-cam/driveway/#
condition: []
action:
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- parallel:
- service: notify.mobile_app_pixel
data:
message: Snapshot
data:
image: /local/driveway/snapshots/{{ trigger.payload }}.jpg
ttl: 0
priority: high
actions:
- action: URI
title: Open Camera
uri: all-cameras/moss-driveway
title: Driveway
enabled: true
- delay:
hours: 0
minutes: 1
seconds: 15
milliseconds: 0
- parallel:
- service: notify.my.slack
data:
message: Latest Video
target: "#testing"
data:
file:
path: /media/driveway/video/recording_{{ trigger.payload }}.mp4
title: Driveway
enabled: true
mode: parallel
max: 10
```
### Anything in the logs that might be useful for us?
```txt
2023-10-10 18:41:31.837 ERROR (MainThread) [homeassistant.components.automation.moss_video_snapshot_and_video_upload] Shop Video Snapshot and Video Upload: Parallel action at step 4: parallel 1: Error executing script. Unexpected error for call_service at pos 1: Can not serialize value type: <class 'NoneType'>
headers: {}
value: None
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 508, in update_body_from_data
body = payload.PAYLOAD_REGISTRY.get(body, disposition=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/payload.py", line 118, in get
raise LookupError()
aiohttp.payload.LookupError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/formdata.py", line 145, in _gen_form_data
part = payload.get_payload(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/payload.py", line 71, in get_payload
return PAYLOAD_REGISTRY.get(data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/payload.py", line 118, in get
raise LookupError()
aiohttp.payload.LookupError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 264, in _async_notify_message_service
await self.async_send_message(**kwargs)
File "/usr/src/homeassistant/homeassistant/components/slack/notify.py", line 323, in async_send_message
return await self._async_send_local_file_message(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/slack/notify.py", line 163, in _async_send_local_file_message
await self._client.files_upload(
File "/usr/local/lib/python3.11/site-packages/slack/web/base_client.py", line 213, in _send
res = await self._request(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/slack/web/base_client.py", line 244, in _request
async with session.request(http_verb, api_url, **req_args) as res:
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1141, in __aenter__
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 508, in _request
req = self._request_class(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 313, in __init__
self.update_body_from_data(data)
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 510, in update_body_from_data
body = FormData(body)()
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/formdata.py", line 170, in __call__
return self._gen_form_data()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/formdata.py", line 149, in _gen_form_data
raise TypeError(
TypeError: Can not serialize value type: <class 'NoneType'>
headers: {}
value: None
```
### Additional information
https://community.home-assistant.io/t/problems-with-slack-sending-files-as-of-2023-10/624736/1