[SOLVED] User problem during zigbee2mqtt installation

happy new year guys,

i have a problem during the installation of zigbee2mqtt
https://koenkk.github.io/zigbee2mqtt/getting_started/running_zigbee2mqtt.html

First, i installed mosquitto via openhabian-config (v2.4 @ RPi3b) and set a pwd
Then, i installed the MQTT binding via PaperUI. Bining is online and connected to the broker.
Through a standalone client MQTT.fx i also establish a connection to the broker with the given usr and pwd.

… and now i’m stuck.

i set the config file with url:port, user, password

after npm start:

[22:14:25] openhabian@openHABianPi:~$ cd /opt/zigbee2mqtt
[22:14:27] openhabian@openHABianPi:/opt/zigbee2mqtt$ npm start

> zigbee2mqtt@1.0.1 start /opt/zigbee2mqtt
> node index.js


/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:171
  throw generateError(state, message);
  ^
YAMLException: bad indentation of a mapping entry at line 14, column 4:
       user: openhabian
       ^
    at generateError (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at readBlockMapping (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1080:7)
    at composeNode (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readBlockMapping (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1062:11)
    at composeNode (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1332:12)
    at readDocument (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
    at loadDocuments (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at load (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1569:19)
    at Object.safeLoad (/opt/zigbee2mqtt/node_modules/js-yaml/lib/js-yaml/loader.js:1591:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@1.0.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/openhabian/.npm/_logs/2019-01-01T21_14_31_865Z-debug.log

he’s complaining about the username? well, i blocked the lines were usr and pwd are set.
now look the following action:

[22:13:28] openhabian@openHABianPi:/opt/zigbee2mqtt$ npm start

> zigbee2mqtt@1.0.1 start /opt/zigbee2mqtt
> node index.js

  zigbee2mqtt:info 1/1/2019, 10:13:32 PM Logging to directory: '/opt/zigbee2mqtt/data/log/2019-01-01.22-13-32'
  zigbee2mqtt:info 1/1/2019, 10:13:33 PM Starting zigbee2mqtt version 1.0.1 (commit #9380bbc)
  zigbee2mqtt:info 1/1/2019, 10:13:33 PM Starting zigbee-shepherd
  zigbee2mqtt:info 1/1/2019, 10:13:35 PM zigbee-shepherd started
  zigbee2mqtt:info 1/1/2019, 10:13:35 PM Coordinator firmware version: '20180815'
  zigbee2mqtt:info 1/1/2019, 10:13:35 PM Currently 0 devices are joined:
  zigbee2mqtt:warn 1/1/2019, 10:13:35 PM `permit_join` set to  `true` in configuration.yaml.
  zigbee2mqtt:warn 1/1/2019, 10:13:35 PM Allowing new devices to join.
  zigbee2mqtt:warn 1/1/2019, 10:13:35 PM Set `permit_join` to `false` once you joined all devices.
  zigbee2mqtt:info 1/1/2019, 10:13:35 PM Zigbee: allowing new devices to join.
  zigbee2mqtt:info 1/1/2019, 10:13:35 PM Connecting to MQTT server at mqtt://localhost:1883
  zigbee2mqtt:info 1/1/2019, 10:13:35 PM zigbee-shepherd ready
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: Connection refused: Not authorized
    at MqttClient._handleConnack (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:920:15)
    at MqttClient._handlePacket (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:350:12)
    at work (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:292:12)
    at Writable.writable._write (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:302:5)
    at doWrite (/opt/zigbee2mqtt/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/opt/zigbee2mqtt/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Writable.write (/opt/zigbee2mqtt/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Socket.ondata (_stream_readable.js:666:20)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
Emitted 'error' event at:
    at MqttClient._handleConnack (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:922:10)
    at MqttClient._handlePacket (/opt/zigbee2mqtt/node_modules/mqtt/lib/client.js:350:12)
    [... lines matching original stack trace ...]
    at addChunk (_stream_readable.js:283:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@1.0.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/openhabian/.npm/_logs/2019-01-01T21_13_35_652Z-debug.log

he finds that connection, but it seems, that he is not authorized to join. So something is wrong with the user?
I followed the manual step by step.

The only part were i had to write a different code is:

# Clone zigbee2mqtt repository
sudo git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
sudo chown -R pi:pi /opt/zigbee2mqtt

From pi:pi i did openhabian:openhabian
Because of the username

You got any ideas?

I think that should be owned by openhab.

openhab:openhabian

i did

sudo chown -R openhab:openhabian /opt/zigbee2mqtt

and there is the same problem. do i have to reinstall?
what does this command? i really don’t know, because i’m a stone cold beginner.

I wouldn’t think so.

What is the output of ls -al /opt/zigbee2mqtt?

Use these command to clean the cache and reboot.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo reboot

Looks like it is complaining about the yaml file format. Probably indentation or spacing issue…

2 Likes

Overlooked that one,:expressionless: I’ve been on the forum for 8 straight hours.:stuck_out_tongue_winking_eye: It’s time to log off and have a cold one.

1 Like

ohhh i feel so stupid. :roll_eyes:

i did not change the spacing from the default config file. i thought this layout had to fit.
i took away the spaces from usr and pwd an now it works.

thanks a lot!

Thanks for clicking the post that provided the solution.:+1:

I edited the title to start with [Solved] maybe that will help anyone else having a similar issue find a quick solution.