GladysAssistant / Gladys

A privacy-first, open-source home assistant
https://gladysassistant.com
Apache License 2.0
2.57k stars 278 forks source link

HTTP 500 on "Scan Network" Hue #2029

Closed Bean900 closed 4 months ago

Bean900 commented 6 months ago

Hey,

i freshly installed Gladys on my Raspberry PI Zero W 1.1 with the Version v4.37.0 32-Bit

Describe the bug Now I wanted to add my hue bridge as a Service (With firefox running on Mint as wall as with chrome from an android phone). When accessing the page "Setup Bridge" or using the button "Scan network" I'm getting no response from the UI.

The Network log (and probably the cause) is showing the following call: GET http://gladys/api/v1/service/philips-hue/bridge

with the Response:

{"status":500,"code":"SERVER_ERROR","error":{}}

image

Pierre-Gilles commented 6 months ago

Hey @Bean900 ! Thanks for the feedback, can you have a look at Gladys logs when you open this screen?

docker logs --tail 200 gladys

?

Bean900 commented 6 months ago

Hey @Pierre-Gilles, Unfortunately, when I run the scan network, I don't see any correspondence log (or any log at execution time :D). Anyway, here is the full log after a restart:

2024-02-20T11:58:40+0100 <info> job.purge.js:17 (Job.purge) Deleting all background jobs created before = Tue Feb 13 2024 11:58:40 GMT+0100 (Central European Standard Time)
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service alexa was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service example was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service caldav was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service enedis was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service ecowatt was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service mqtt was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service rtsp-camera was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service telegram was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service usb was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service xiaomi was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service tasmota was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service bluetooth was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service ewelink was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service tp-link was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service zigbee2mqtt was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service google-actions was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service broadlink was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service nextcloud-talk was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service tuya was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service melcloud was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service node-red was manually stopped, so it is ignored at startup
2024-02-20T11:59:18+0100 <info> service.startAll.js:30 () Service netatmo was manually stopped, so it is ignored at startup
2024-02-20T11:59:19+0100 <info> service.startAll.js:30 () Service zwavejs-ui was manually stopped, so it is ignored at startup
2024-02-20T11:59:19+0100 <info> index.js:20 (Object.start) Starting Open Weather service
2024-02-20T11:59:19+0100 <info> service.start.js:40 (Service.start) Service openweather is not configured, so it was not started.
2024-02-20T11:59:19+0100 <info> index.js:17 (Object.start) Starting Sonos service
2024-02-20T11:59:19+0100 <info> index.js:17 (Object.start) Starting LAN Manager service
2024-02-20T11:59:19+0100 <info> lan-manager.initPresenceScanner.js:18 (LANManager.initPresenceScanner) LANManager configuration: starting presence scanner
2024-02-20T11:59:19+0100 <info> index.js:18 (Object.start) Starting HomeKit service
2024-02-20T11:59:28+0100 <error> index.js:15 (process.<anonymous>) unhandledRejection catched: Promise {
  <rejected> NotFoundError: DeviceFeature sonos:RINCON_48A6B8DF0B9201400:volume not found
      at DeviceManager.newStateEvent (/src/server/lib/device/device.newStateEvent.js:17:11)
      at EventEmitter.emit (node:events:517:28)
      at Event.emit (/src/server/lib/event/index.js:18:16)
}
2024-02-20T11:59:29+0100 <error> index.js:16 (process.<anonymous>) NotFoundError: DeviceFeature sonos:RINCON_48A6B8DF0B9201400:volume not found
    at DeviceManager.newStateEvent (/src/server/lib/device/device.newStateEvent.js:17:11)
    at EventEmitter.emit (node:events:517:28)
    at Event.emit (/src/server/lib/event/index.js:18:16)
2024-02-20T11:59:30+0100 <info> index.js:18 (Object.start) Starting Philips Hue service
2024-02-20T11:59:33+0100 <info> scene.dailyUpdate.js:58 () Sunrise today is at 7:29 today, in your timezone = Europe/Berlin
2024-02-20T11:59:33+0100 <info> scene.dailyUpdate.js:59 () Sunset today is at 17:51 today, in your timezone = Europe/Berlin
2024-02-20T11:59:33+0100 <info> scene.dailyUpdate.js:70 () The sun rose this morning. Not scheduling for today.
2024-02-20T11:59:33+0100 <info> scene.dailyUpdate.js:81 () Sunset is scheduled, in 6 hours.
2024-02-20T11:59:33+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval hourly
2024-02-20T11:59:36+0100 <info> index.js:64 (Server.<anonymous>) Server listening on port 80
2024-02-20T11:59:56+0100 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval hourly 
2024-02-20T11:59:57+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval daily
2024-02-20T12:00:02+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval hourly
2024-02-20T12:00:02+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:00:02 GMT
2024-02-20T12:00:40+0100 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval daily 
2024-02-20T12:00:40+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval monthly
2024-02-20T12:00:48+0100 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval hourly 
2024-02-20T12:00:49+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval daily
2024-02-20T12:01:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:01:00 GMT
2024-02-20T12:01:18+0100 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval monthly 
2024-02-20T12:01:26+0100 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval daily 
2024-02-20T12:01:27+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval monthly
2024-02-20T12:01:51+0100 <info> device.calculateAggregate.js:105 (ChildProcess.<anonymous>) device.calculateAggregate: Finishing processing for interval monthly 
2024-02-20T12:02:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:02:00 GMT
2024-02-20T12:03:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:03:00 GMT
2024-02-20T12:04:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:04:00 GMT
2024-02-20T12:05:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:05:00 GMT
2024-02-20T12:06:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:06:00 GMT
2024-02-20T12:07:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:07:00 GMT
2024-02-20T12:08:00+0100 <info> scene.checkCalendarTriggers.js:25 (SceneManager.checkCalendarTriggers) Checking calendar triggers at Tue, 20 Feb 2024 11:08:00 GMT
Pierre-Gilles commented 6 months ago

@Bean900 doesn't help much :D Are you sure your Gladys container is able to scan the network? Your docker container is in network mode = host ?

Bean900 commented 6 months ago

Yes, it is :disappointed: I was also able to add my Sonos box. here is the complete configuration:

[
    {
        "Id": "b590bcf5bd80e11f076d49d7ddf6211bfd0540b5c6dc7b23ed0b333d2b8e8400",
        "Created": "2024-02-19T19:14:03.04522181Z",
        "Path": "docker-entrypoint.sh",
        "Args": [
            "node",
            "index.js"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 933,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2024-02-26T20:29:27.288746965Z",
            "FinishedAt": "2024-02-26T21:29:12.929183965+01:00"
        },
        "Image": "sha256:44743b876f6f7b1664737b459f4f6a5cea7e18af113959d9a6d6676cf1b52a66",
        "ResolvConfPath": "/var/lib/docker/containers/b590bcf5bd80e11f076d49d7ddf6211bfd0540b5c6dc7b23ed0b333d2b8e8400/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/b590bcf5bd80e11f076d49d7ddf6211bfd0540b5c6dc7b23ed0b333d2b8e8400/hostname",
        "HostsPath": "/var/lib/docker/containers/b590bcf5bd80e11f076d49d7ddf6211bfd0540b5c6dc7b23ed0b333d2b8e8400/hosts",
        "LogPath": "/var/lib/docker/containers/b590bcf5bd80e11f076d49d7ddf6211bfd0540b5c6dc7b23ed0b333d2b8e8400/b590bcf5bd80e11f076d49d7ddf6211bfd0540b5c6dc7b23ed0b333d2b8e8400-json.log",
        "Name": "/gladys",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/etc/timezone:/etc/timezone:ro",
                "/var/run/docker.sock:/var/run/docker.sock",
                "/var/lib/gladysassistant:/var/lib/gladysassistant",
                "/dev:/dev",
                "/run/udev:/run/udev:ro",
                "/sys/class/gpio:/sys/class/gpio",
                "/etc/localtime:/etc/localtime:ro"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {
                    "max-size": "10m"
                }
            },
            "NetworkMode": "host",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "always",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": [
                "SYS_RAWIO"
            ],
            "CapDrop": null,
            "CgroupnsMode": "host",
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": true,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": [
                "label=disable"
            ],
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": null,
            "ReadonlyPaths": null
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/64172fbd393c79c962546e50f8c3071a36b124b005b06a7c6ae09a1bdcf06570-init/diff:/var/lib/docker/overlay2/e789f986794bfd063973ca394984fb84e03becde5e3757f6e58a7b12d2da6383/diff:/var/lib/docker/overlay2/4b5b3273729bef96ed74c22efa0b790419730c7711b77ac0ab5e79b89bf6666f/diff:/var/lib/docker/overlay2/0cff332bd707709cff73dc6313e929e53ef5308bf59452015295e8090c3a4b11/diff:/var/lib/docker/overlay2/3ec72340672da084eddce94364efdd00da1e096dfdbb8c425d19ca8aec740212/diff:/var/lib/docker/overlay2/b543efa0fea1f53214ec253c2dbd4162a60bfbeea1119c03383af1d7b80f1e91/diff:/var/lib/docker/overlay2/e8e767f3d4985e48c0e05472bce4aac61bceddaafde75c3fe91c75560bca5ce2/diff:/var/lib/docker/overlay2/122b8636eeec044507f78ab50e33411837bfcc2296dffdc21a8fce8abef4a8c6/diff:/var/lib/docker/overlay2/bd4290cb1aad9c81c4d2449c81326dfde2a75f151f0c91d7fdb3c942df2d1294/diff:/var/lib/docker/overlay2/743888ada836348b32478752e77df081849ab70e3b0b9d8cf4b077585deeb355/diff:/var/lib/docker/overlay2/9b1cd193e146e0fcf3616750fb59dc48a6b5cc2f993aacb39627eb27fa80b35f/diff",
                "MergedDir": "/var/lib/docker/overlay2/64172fbd393c79c962546e50f8c3071a36b124b005b06a7c6ae09a1bdcf06570/merged",
                "UpperDir": "/var/lib/docker/overlay2/64172fbd393c79c962546e50f8c3071a36b124b005b06a7c6ae09a1bdcf06570/diff",
                "WorkDir": "/var/lib/docker/overlay2/64172fbd393c79c962546e50f8c3071a36b124b005b06a7c6ae09a1bdcf06570/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/var/lib/gladysassistant",
                "Destination": "/var/lib/gladysassistant",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/var/run/docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/dev",
                "Destination": "/dev",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/etc/localtime",
                "Destination": "/etc/localtime",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/etc/timezone",
                "Destination": "/etc/timezone",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/run/udev",
                "Destination": "/run/udev",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/sys/class/gpio",
                "Destination": "/sys/class/gpio",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "gladys",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "NODE_ENV=production",
                "SERVER_PORT=80",
                "SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_VERSION=18.19.1",
                "YARN_VERSION=1.22.19",
                "LD_LIBRARY_PATH=/lib"
            ],
            "Cmd": [
                "node",
                "index.js"
            ],
            "Image": "gladysassistant/gladys:v4",
            "Volumes": null,
            "WorkingDir": "/src/server",
            "Entrypoint": [
                "docker-entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {}
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "56286b97eb3d6d463efb05faffe5ca13437f37f87cf26574b467fbf2e29777a5",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/default",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "host": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "25e159643c17b553d8b36f0da80e964edf41cf5903959fb7a4f434068ce8c944",
                    "EndpointID": "5d4b56784eaf52dab4a5b3a57fb4fcec2a8ec71b16fea3455216c5b4fa4896a3",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]
Pierre-Gilles commented 6 months ago

@Bean900 Thanks! Sorry for my slow response, I get thousands of Github notifications per week it's hard to follow ^^

I'm faster to answer on our forum ( https://en-community.gladysassistant.com/ )

It's hard to help you without any error message...