Zigbee2mqtt 502 Bad gateway error

Hi I’m using sonoff 3.0 zigbee stick and I was running mqtt on it it worked pretty well.
Until I changed the zigbee channel. Ever since then it has giving me an error.

I have reflashed the sonofff stick, I have uninstalled and reinstalled the zigbee2mqtt and mosquitto. I followed various different ways to set up mqtt in home assistant but none of them work for me anymore.

I have attached the log. Do you know what the problem may be?

I have a very similiar log and the 502 bad gateway error, somone could help?

A full log, and the zigbee2mqtt config might help. A screenshot is useless especially if it only contains part of the log.

ENOENT indicates one of the directories is wrong or not existing.

Send the log and the config
.
And if you have samba share set up. Go to zigbee2matt and open up the configuration.yaml. Send me that too

Configuration:

data_path: /share/zigbee2mqtt
socat:
enabled: false
master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
options: ‘-d -d’
log: false
mqtt:
base_topic: zigbee2mqtt
server: mqtt://core-mosquitto
user: mqtt_user
password: mqtt_user
serial:
port: /dev/ttyUSB0
advanced:
log_level: info
pan_id: 6754
channel: 11
network_key:
- 1
- 3
- 5
- 7
- 9
- 11
- 13
- 15
- 0
- 2
- 4
- 6
- 8
- 10
- 12
- 13
availability_blocklist:
availability_passlist:
device_options: {}
blocklist:
passlist:
queue: {}
frontend: null
port: 8099
experimental: {}
external_converters:
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: false

The log:

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] socat.sh: executing…
[20:35:05] INFO: Socat not enabled, marking service as down
[cont-init.d] socat.sh: exited 0.
[cont-init.d] zigbee2mqtt.sh: executing…
[cont-init.d] zigbee2mqtt.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[20:35:09] INFO: Handing over control to Zigbee2mqtt Core …

[email protected] start
node index.js
Zigbee2MQTT:info 2022-05-17 20:35:21: Logging to console and directory: ‘/share/zigbee2mqtt/log/2022-05-17.20-35-17’ filename: log.txt
Zigbee2MQTT:info 2022-05-17 20:35:21: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info 2022-05-17 20:35:21: Starting zigbee-herdsman (0.14.27)
Zigbee2MQTT:error 2022-05-17 20:35:54: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-05-17 20:35:54: Failed to start zigbee
Zigbee2MQTT:error 2022-05-17 20:35:54: Check Zigbee2MQTT fails to start | Zigbee2MQTT for possible solutions
Zigbee2MQTT:error 2022-05-17 20:35:54: Exiting…
Zigbee2MQTT:error 2022-05-17 20:35:54: TypeError: Cannot read property ‘length’ of null
at AdapterNvMemory.init (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/adapter-nv-memory.ts:28:42)
at ZnpAdapterManager.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/manager.ts:60:9)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29)
at Zigbee.start (/app/lib/zigbee.ts:58:27)
at Controller.start (/app/lib/controller.ts:100:27)
at start (/app/index.js:110:5)
[20:35:58] INFO: Handing over control to Zigbee2mqtt Core …
[email protected] start
node index.js
Zigbee2MQTT:info 2022-05-17 20:36:08: Logging to console and directory: ‘/share/zigbee2mqtt/log/2022-05-17.20-36-04’ filename: log.txt
Zigbee2MQTT:info 2022-05-17 20:36:08: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info 2022-05-17 20:36:08: Starting zigbee-herdsman (0.14.27)
Zigbee2MQTT:error 2022-05-17 20:36:29: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2022-05-17 20:36:29: Failed to start zigbee
Zigbee2MQTT:error 2022-05-17 20:36:29: Check Zigbee2MQTT fails to start | Zigbee2MQTT for possible solutions
Zigbee2MQTT:error 2022-05-17 20:36:29: Exiting…
Zigbee2MQTT:error 2022-05-17 20:36:29: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:102:27)
at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:123:29)
at Zigbee.start (/app/lib/zigbee.ts:58:27)
at Controller.start (/app/lib/controller.ts:100:27)
at start (/app/index.js:110:5)
[20:36:34] INFO: Handing over control to Zigbee2mqtt Core …
[email protected] start
node index.js
Zigbee2MQTT:info 2022-05-17 20:36:43: Logging to console and directory: ‘/share/zigbee2mqtt/log/2022-05-17.20-36-40’ filename: log.txt
Zigbee2MQTT:info 2022-05-17 20:36:43: Starting Zigbee2MQTT version 1.25.1 (commit #unknown)
Zigbee2MQTT:info 2022-05-17 20:36:43: Starting zigbee-herdsman (0.14.27)

Are you using sonoff stick? Or conbee 2?

Looks like zigbee is failing to start to begin with.
Was it working before, and now it has stopped working?

Finally, watch a video on YouTube and install samba share add on,in your home assistant.

Continuing the discussion from Zigbee2mqtt 502 Bad gateway error:

Hi
Im ussing sonoff stick. Today I dont know why “502 bad gateway” didnt happen. Bt when I try to permit join devices, this is what log displays:

 Info <small>2022-05-19 17:40:09</small>`Zigbee: allowing new devices to join.`

Error <small>2022-05-19 17:40:15</small>`Request 'zigbee2mqtt/bridge/request/permit_join' failed with error: 'SRSP - ZDO - mgmtPermitJoinReq after 6000ms'`

Info <small>2022-05-19 17:40:15</small>`MQTT publish: topic 'zigbee2mqtt/bridge/response/permit_join', payload '{"data":{},"error":"SRSP - ZDO - mgmtPermitJoinReq after 6000ms","status":"error","transaction":"la9oi-1"}'`

I dont really know what is shamba share, why do I have to add it?

You don’t really need samda share tbh. But I think you’re configuration of mqtt is not updating on home assistant. So I suggest you go into the configuration.yaml file. Then copy and paste your configuration from mqtt into there.

If that doesn’t help. The flash your sonoff dongle again.

If that doesn’t help.Try removing the channel and network key from your configuration. Just keep it basic, just to see if the erorr goes away.

And if that doesnt work, then im afraid thats all I know haha. But i really insist you follow the first step and do it correctly.

@Mari143, May I know which configuration.yaml file are you talking about? /config/configuration.yaml or /config/zigbee2mqtt/configuration.yaml

This one.

Make sure everything looks correct is updated in this config file

Thank you for clarifying.