500 error when connecting to camera

I have a camera that at one point was working on home assistant. It is a Aqara g3 camera. It used to display inside the webui and I could see video/images. Now, it does not work, and I see in the javascript console that the endpoint it attempts to use returns a 500 error. I am using docker (well, podman) to host and I don’t see anything in the logs for the container. I don’t fully understand all the components, but I believe I had to install the Matter server (also using podman/docker) to get this camera working. I don’t see logs in that Matter container either. I’ve tried restarting the docker containers, and this has not fixed things.

The URL it is hitting is: http://100.64.0.17:8123/api/camera_proxy/camera.camera_hub_g3_c849?authSig=eyJhbG...

How do I troubleshoot this?

Like I said, things were working at one point. Then, I tried to use an automation to record video upon motion detection, and it looks like something went wrong.

I did see errors like this in the logs during the automation setup attempt.

2025-05-06 01:23:29.099 ERROR (MainThread) [homeassistant.components.automation.camera_recording] Error while executing automation automation.camera_recording: must contain at least one of entity_id, device_id, area_id, floor_id, label_id.
2025-05-06 01:24:01.101 ERROR (MainThread) [homeassistant.components.automation.camera_recording] Camera Recording: Error executing script. Invalid data for call_service at pos 1: must contain at least one of entity_id, device_id, area_id, floor_id, label_id.
2025-05-06 01:24:01.102 ERROR (MainThread) [homeassistant.components.automation.camera_recording] Error while executing automation automation.camera_recording: must contain at least one of entity_id, device_id, area_id, floor_id, label_id.
2025-05-06 01:28:18.119 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: camera.camera_hub_g3_c849 does not support record service
2025-05-06 01:28:18.119 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [134490379234624] Error handling message: camera.camera_hub_g3_c849 does not support record service (home_assistant_error) Chris from 100.64.0.9 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0)

figure out which integration you used to add the camera

verify the integration is working

since this is docker and you mentioned matter server, make sure matter server and HA are on same docker network and reachable. Matter of fact, post the docker compose or docker run because if the camera issue began after a restart the IPs of the containers may have changed causing you issue. Containers should talk on docker network using hostnames.

report whatever you find here so we can give next steps.

How do I figure out the intergration for the camera? If I peek into settings, I see it listed under homekit. Is that the integration?

I’m using this command to start the homeassistant container:

podman run -d --name homeassistant -v $PWD/config:/config --network=host ghcr.io/home-assistant/home-assistant:stable

I’m using this to start the matter server:

podman run -d \
  --name matter-server \
  --restart=unless-stopped \
  --security-opt apparmor=unconfined \
  -v $(pwd)/data:/data \
  -v /run/dbus:/run/dbus:ro \
  --network=host \
  ghcr.io/home-assistant-libs/python-matter-server:stable
$ podman ps | grep home
ad44a6b0b266  ghcr.io/home-assistant/home-assistant:stable                                   14 hours ago  Up 13 hours                                                                                                                             homeassistant
c748670688cc  ghcr.io/home-assistant-libs/python-matter-server:stable  --storage-path /d...  14 hours ago  Up 13 hours                                                                                                                             matter-server

I believe so Yes

And both containers are running?

Did you configure camera in go2rtc to display? I don’t use that device but I notice the screenshot shows the sensors but the may not be the camera. Not sure

May be faster to run through steps taken to add camera to HA. In the end verifying the steps is the method to troubleshoot this.

@tmjpugh Is it safe/helpful to post the diagnostics which are provided as a download there?

helpful: Maybe

Safe: Yes if you do below.
whenever you post logs or configs you should always review the data posted and remove private data. for example:
remove passwords
remove personal website data (like your personal domain name or duckdns name)
remove api keys
remove names of people (optional, not everyone wants to be identified online)

I don’t recall doing anything with go2rtc. I believe I just added the camera and then it displayed. From my reading it seems like it didn’t require me using or understanding go2rtc and that this is something handled automatically.

I removed the device. It is detected again, but now it just hangs on the wizard step.

Nothing is displayed in the javascript console other than the URL it appears to hang on.

http://100.64.0.17:8123/api/config/config_entries/flow/01JTK6B3TXH3TD8X38MS72RSXA

The podman logs show this. Restarting the docker container does not fix it.

2025-05-06 15:02:11.055 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [130717638663840] Error handling message: Failed to remove device entry, rejected by integration (home_assistant_error) Chris from 100.64.0.9 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0)
2025-05-06 16:15:02.885 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 439, in async_step_pair
    pairing = await self.finish_pairing(code)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/discovery.py", line 78, in finish_pairing
    response = await self.connection.post_tlv(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 460, in post_tlv
    response = await self.post(
               ^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 423, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/aiohomekit/controller/ip/connection.py", line 490, in request
    raise AccessoryDisconnectedError("Connection lost before request could be sent")
aiohomekit.exceptions.AccessoryDisconnectedError: Connection lost before request could be sent