[support] Spants - NodeRed, MQTT, Dashing, couchDB


Recommended Posts

I switched to the mosquitto app. At first it had the same issue, but then I passed the environment variables PUID/GUID 1883/1883 in the docker template and did a 'chown -R 1883:1883 /mnt/user/appdata/mosquitto' and it works fine now. Writes the db no issue.

 

Only downside is the config is a lot more work and you have to manually specify the log and data mappings. So def a little more time consuming, but results are good.

Link to comment
  • 3 weeks later...

Hello,

is this the right place for support for the "zigbee2mqtt"-docker?

 

I tried to setup it and also edited the configuration.yaml but it won't start.

What does "- frontend must be object" mean in the log?

 

Thank you. 🙂

 

homeassistant: false
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.163
  user: loxberry
  password: PASSWORD
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_3c97c5fcdac9eb1194998f4f1d69213e-if00-port0
advanced:
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
device_options:
  legacy: false
frontend:
port: 9442

 

Using '/app/data' as data directory


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
READ THIS CAREFULLY

Refusing to start because configuration is not valid, found the following errors:
- frontend must be object

If you don't know how to solve this, read https://www.zigbee2mqtt.io/guide/configuration

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

Link to comment

Any chance of changing the underlying node-red image to 2.1.6-16 so it'd be possible to use addons that require NodeJs 16?

 

2022-01-24T17:58:54.815Z [err]  Not compatible with your version of node/npm: [email protected]
2022-01-24T17:58:54.815Z [err] npm ERR! notsup Required: {"node":">=16.6.0"}
2022-01-24T17:58:54.815Z [err] npm ERR! 
2022-01-24T17:58:54.815Z [err] notsup Actual:   {"npm":"6.14.15","node":"14.18.2"}

 

Link to comment
On 1/24/2022 at 5:59 PM, Shrike said:

Any chance of changing the underlying node-red image to 2.1.6-16 so it'd be possible to use addons that require NodeJs 16?

 

2022-01-24T17:58:54.815Z [err]  Not compatible with your version of node/npm: [email protected]
2022-01-24T17:58:54.815Z [err] npm ERR! notsup Required: {"node":">=16.6.0"}
2022-01-24T17:58:54.815Z [err] npm ERR! 
2022-01-24T17:58:54.815Z [err] notsup Actual:   {"npm":"6.14.15","node":"14.18.2"}

 

 

You can change your own: chgange the repository field to  nodered/node-red:2.1.6-16

Link to comment
On 1/19/2022 at 10:06 PM, jeuser said:

Hello,

is this the right place for support for the "zigbee2mqtt"-docker?

 

I tried to setup it and also edited the configuration.yaml but it won't start.

What does "- frontend must be object" mean in the log?

 

Thank you. 🙂

 

homeassistant: false
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://192.168.1.163
  user: loxberry
  password: PASSWORD
serial:
  port: >-
    /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_3c97c5fcdac9eb1194998f4f1d69213e-if00-port0
advanced:
  homeassistant_legacy_entity_attributes: false
  legacy_api: false
device_options:
  legacy: false
frontend:
port: 9442

 

Using '/app/data' as data directory


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
READ THIS CAREFULLY

Refusing to start because configuration is not valid, found the following errors:
- frontend must be object

If you don't know how to solve this, read https://www.zigbee2mqtt.io/guide/configuration

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

 

 

Its not my docker, but did you fix it? I use the zigbee2mqtt docker as well so I will try and help

  • Like 1
Link to comment
  • 3 weeks later...

I'm getting a weird situation with node-red specifically (tried multiple images - same issue).  When it pulls the image and tries to copy /data into my persistent mapping - it fails.  It specifically is creating folders/files with:

 

sonny:ssh-allow

 

permissions, but I cannot figure out how to solve it....This is my exact issue!  And here - forces 1000 or 1001 UID which makes sense because that matches the user (not sure where "ssh-access" comes from) my /etc/passwd file.

Solution attempt #1 - kinda fixes it - Tried adding "--user nobody" to Extra Parameters, and it at least installs and runs immediately..but with sonny:1000 vs. sonny:ssh-access...

 

Every other docker I have doesn't do this and most use nobody:users - especially when I set PGID/PUID/UMASK variables.  I tried doing manually adding those specific variables, but no dice. 

 

I've googled everywhere, and it *maybe* a recent sshd_config change since 6.9?  Anyway I can force the docker to run with specific permissions nobody:user?

Edited by OneMeanRabbit
Link to comment
8 hours ago, OneMeanRabbit said:

I'm getting a weird situation with node-red specifically (tried multiple images - same issue).  When it pulls the image and tries to copy /data into my persistent mapping - it fails.  It specifically is creating folders/files with:

 

sonny:ssh-allow

 

permissions, but I cannot figure out how to solve it....This is my exact issue!  And here - forces 1000 or 1001 UID which makes sense because that matches the user (not sure where "ssh-access" comes from) my /etc/passwd file.

Solution attempt #1 - kinda fixes it - Tried adding "--user nobody" to Extra Parameters, and it at least installs and runs immediately..but with sonny:1000 vs. sonny:ssh-access...

 

Every other docker I have doesn't do this and most use nobody:users - especially when I set PGID/PUID/UMASK variables.  I tried doing manually adding those specific variables, but no dice. 

 

I've googled everywhere, and it *maybe* a recent sshd_config change since 6.9?  Anyway I can force the docker to run with specific permissions nobody:user?

 

yes, I see a few people on the internet see the same problem. I wonder if adding 

--user="nobody:users"

to extra parameters would make a difference?.
Otherwise you may have to chmod the data directory = 
https://github.com/node-red/node-red-docker/wiki/Permissions-and-Persistence

Link to comment
  • 2 weeks later...

Not sure if i should post this in this mqtt thread or Nginx Proxy Manager thread, but since i have NPM woking for other proxys, i thought i would start here

What i would like to do is be able to reach my mqtt broker form outside my local network. 

I have a duckdns name set..eg. mymqtt.duckdnsorg

In NPM have a a host a ssuch

image.png.8d84df5576b4daecfbfc4d168d9ea48c.png

 

But on my phone or nodered i cant access my mqtt broker

Is this possible to achieve?

 

I know i can leave my vpn running 24/7 on the phone, and just access it that way. but i'm looking for a different solution so i dont have to do that on my wifes phone

 

Cheers

Link to comment
54 minutes ago, bdydrp said:

Not sure if i should post this in this mqtt thread or Nginx Proxy Manager thread, but since i have NPM woking for other proxys, i thought i would start here

What i would like to do is be able to reach my mqtt broker form outside my local network. 

I have a duckdns name set..eg. mymqtt.duckdnsorg

In NPM have a a host a ssuch

image.png.8d84df5576b4daecfbfc4d168d9ea48c.png

 

But on my phone or nodered i cant access my mqtt broker

Is this possible to achieve?

 

I know i can leave my vpn running 24/7 on the phone, and just access it that way. but i'm looking for a different solution so i dont have to do that on my wifes phone

 

Cheers

 

just create a strong user/password and use port forwarding from your router to the mqtt port?. 

Link to comment
  • 3 months later...

After updating Unraid to 6.10 today, I was unable to start MQTT.

 

1653129413: mosquitto version 1.4.8 (build date 2020-01-27 00:25:20+0000) starting
1653129413: Config loaded from /config/mosquitto.conf.
1653129413: Error: Unable to open pwfile "/config/passwords.mqtt".
1653129413: Error opening password file "/config/passwords.mqtt".
1653129593: Error: Unable to open log file /config/log/mosquitto.log for writing.
1653129593: mosquitto version 1.4.8 (build date 2020-01-27 00:25:20+0000) starting
1653129593: Config loaded from /config/mosquitto.conf.
1653129593: Error: Unable to open pwfile "/config/passwords.mqtt".
1653129593: Error opening password file "/config/passwords.mqtt".

 

I have probably 25 other dockers that didn't have an issue. I've had this MQTT docker installed for years and never ran into this. I checked the GUI UID in the settings and they're proper. I did attempted to do a chown -R, but that was unsuccessful. I am also unable to access the mqtt folder through the Windows Network share on a remote machine on the network. I can access any other folders. I find this a bit strange, any ideas? I have a lot of things that run through MQTT, so it is quite important to get back up and running.

Link to comment
34 minutes ago, live4soccer7 said:

After updating Unraid to 6.10 today, I was unable to start MQTT.

 

1653129413: mosquitto version 1.4.8 (build date 2020-01-27 00:25:20+0000) starting
1653129413: Config loaded from /config/mosquitto.conf.
1653129413: Error: Unable to open pwfile "/config/passwords.mqtt".
1653129413: Error opening password file "/config/passwords.mqtt".
1653129593: Error: Unable to open log file /config/log/mosquitto.log for writing.
1653129593: mosquitto version 1.4.8 (build date 2020-01-27 00:25:20+0000) starting
1653129593: Config loaded from /config/mosquitto.conf.
1653129593: Error: Unable to open pwfile "/config/passwords.mqtt".
1653129593: Error opening password file "/config/passwords.mqtt".

 

I have probably 25 other dockers that didn't have an issue. I've had this MQTT docker installed for years and never ran into this. I checked the GUI UID in the settings and they're proper. I did attempted to do a chown -R, but that was unsuccessful. I am also unable to access the mqtt folder through the Windows Network share on a remote machine on the network. I can access any other folders. I find this a bit strange, any ideas? I have a lot of things that run through MQTT, so it is quite important to get back up and running.

 

if you shell on to unraid can you see the directory?
can you use the filemanager plugin to see if the files are there?
You might have to CHMOD -r 777 (or just RW privs) on the mqtt app directory (beware of the consequences!) as unraid changed the permissions/owners for appdata a while back

 

Let me know how you get on.

I use 6.10 with lots of mqtt clients with this. I should really get around to looking at building a more modern mqtt broker and template....

 

 

 

Edited by spants
Link to comment

@spants Yes, they are all there. I have done everything suggested in the forum/thread here.

 

image.thumb.png.f05d6626c68da3c874201322bcb39363.png

 

I'm quite stumped on this. I'm thinking of nuking the whole thing. Deleting the image and the appdata folder for MQTT and installing again from scratch.

 

I don't think there is much in the folder itself that would need to be saved. Without persistence, I think it would just be the mosquito.conf and the passwords.mqtt. I could manually open those with nano and copy the contents.

 

Edited by live4soccer7
Link to comment
12 minutes ago, live4soccer7 said:

@spants Yes, they are all there. I have done everything suggested in the forum/thread here.

 

image.thumb.png.f05d6626c68da3c874201322bcb39363.png

 

I'm quite stumped on this. I'm thinking of nuking the whole thing. Deleting the image and the appdata folder for MQTT and installing again from scratch.

 

I don't think there is much in the folder itself that would need to be saved. Without persistence, I think it would just be the mosquito.conf and the passwords.mqtt. I could manually open those with nano and copy the contents.

 

 

Yes you could do that. I had to CHMOD my directory as the persistence db wasnt saving.

 

Just rename it after stopping the docker.... and then restart. You may have to set the permissions on the new directory.

Edited by spants
Link to comment
  • 4 weeks later...

Hey so I have an issue right  now where I am trying to upgrade my nodered docker container, but when I try to do so within the container (manage palette), I get the following error: 

 

  
2022-06-12T19:40:17.485Z [err] npm ERR! Your cache folder contains root-owned files, due to a bug in
2022-06-12T19:40:17.485Z [err] npm ERR!
2022-06-12T19:40:17.485Z [err]  previous versions of npm which has since been addressed.
2022-06-12T19:40:17.485Z [err] npm ERR! 
2022-06-12T19:40:17.485Z [err] npm 
2022-06-12T19:40:17.485Z [err] ERR! To permanently fix this problem, please run:
2022-06-12T19:40:17.485Z [err] npm ERR!   sudo chown -R 1000:1000 "/data/.npm"
2022-06-12T19:40:17.496Z [err] 
2022-06-12T19:40:17.496Z [err] npm ERR! A complete log of this run can be found in:
2022-06-12T19:40:17.496Z [err] npm ERR!
2022-06-12T19:40:17.496Z [err]      /data/.npm/_logs/2022-06-12T19_40_17_488Z-debug.log

 

When I go into the command line, I can see the files within the appdata folder for the docker are owned by multiple different users, including "root" , "nobody", and my personal username. 

 

My question is, which user is the best-practice owner for these files in node red? I'm having some difficulties figuring out how to order the item that they said was the error in bash, so I was also wondering if it is ok to just do chown -R within the command line for the folders within the appdata folder?

Link to comment
  • 3 weeks later...

This exact thing happened to me as well. The only way I could fix it was to delete the docker and all the files for it in appdata and install a completely fresh setup. Luckily, there wasn't much to config for it so it was easy. I haven't addressed the other docker that was having problems and now I can't remember and can't check because my cache drive just failed last night.

Link to comment
11 minutes ago, live4soccer7 said:

I think we went through all of that earlier in this thread. It yielded no successful results in changing permissions.

*shrug* It is definitely a permission issue based on the error you are getting. There is a possibility that the MQTT container is changing the permissions in it's startup script. It's also a possibility that code-server is having an issue. I've never used code-server and just modify my files over SFTP/NFS as the root user. That prevents me from dealing with any permission issues.

 

On 6/13/2022 at 6:58 PM, Sim1 said:

Hey so I have an issue right  now where I am trying to upgrade my nodered docker container, but when I try to do so within the container (manage palette), I get the following error: 

 

  
2022-06-12T19:40:17.485Z [err] npm ERR! Your cache folder contains root-owned files, due to a bug in
2022-06-12T19:40:17.485Z [err] npm ERR!
2022-06-12T19:40:17.485Z [err]  previous versions of npm which has since been addressed.
2022-06-12T19:40:17.485Z [err] npm ERR! 
2022-06-12T19:40:17.485Z [err] npm 
2022-06-12T19:40:17.485Z [err] ERR! To permanently fix this problem, please run:
2022-06-12T19:40:17.485Z [err] npm ERR!   sudo chown -R 1000:1000 "/data/.npm"
2022-06-12T19:40:17.496Z [err] 
2022-06-12T19:40:17.496Z [err] npm ERR! A complete log of this run can be found in:
2022-06-12T19:40:17.496Z [err] npm ERR!
2022-06-12T19:40:17.496Z [err]      /data/.npm/_logs/2022-06-12T19_40_17_488Z-debug.log

 

When I go into the command line, I can see the files within the appdata folder for the docker are owned by multiple different users, including "root" , "nobody", and my personal username. 

 

My question is, which user is the best-practice owner for these files in node red? I'm having some difficulties figuring out how to order the item that they said was the error in bash, so I was also wondering if it is ok to just do chown -R within the command line for the folders within the appdata folder?


Set all the files to be owned by user nobody and group users. I had this issue with my Node-RED container as well and that fixed it for me. None of those files should be owned by root (which is why you got that error telling you that). Most containers for Unraid use nobody:users.

 

chown -R nobody:users /mnt/user/appdata/node-red

 

Link to comment

So I did a reïnstall of MQTT, because the container is very simple to setup. At first deleted the container and the app data folder, the installed the docker again.  When i did the following command:

ls -all /mnt/user/appdata/MQTT

It did gave me this result:

 permissions.png.8dd7caae0041e1f96826b3dd89e4391c.png

With this I was not able to acces the files in code server or smb share. 

Then I did the following command:

chown -R nobody:users /mnt/user/appdata/MQTT

After a reboot of MQTT I get the following permissions:612287407_permissions2.png.f9c925389da21631a57f0532e7177431.png

When I checked the log file of MQTT I could see the error was still there:

1656662227: Saving in-memory database to /config/data/mosquitto.db.
1656662227: Error saving in-memory database, unable to open /config/data/mosquitto.db.new for writing.
1656662776: Error: Permission denied.

When I tried to acces the share to code server or smb it was still not able to acces it:

411605828_SMBnoacces.png.f518974a74cf13467ec1b831a22010c1.png

I have other shares with the same permmisions which are accesaible. 

 

MQTT is working, but I'm worried about these issues. 

 

 

 

Link to comment

Hi all,

As you are discovering, this docker is quite old and needs to be updated. If you can bear with me, please try the manual steps to get a later version of MQTT and solve permissions problems.

 

Please follow these steps and stop any existing MQTT container. I am using a directory called "/mnt/user/appdata/mos/" for my config - change if you wish.

 

1) In a shell on unRaid, create the mosquitto directories

 

mkdir -p /mnt/user/appdata/mos/config
mkdir -p /mnt/user/appdata/mos/data
mkdir -p /mnt/user/appdata/mos/log

 

2) create a configuration file

nano /mnt/user/appdata/mos/config/mosquitto.conf

 

with the following text

persistence true
persistence_location /mosquitto/data/
user mosquitto
# Listen on all interfaces 
listener 1883
#Allow connection without authentication
allow_anonymous true
log_dest file /mosquitto/log/mosquitto.log
log_dest stdout

 

3) Set the ownership of the directories to nobody:users

chown -R nobody:users /mnt/user/appdata/mos

 

4) download and start the docker (called mqttnew for testing)

sudo docker run -itd -p 1883:1883 -e PUID=1000 -e PGID=1000 \
--name=mqttnew \
--net=bridge \
-v /mnt/user/appdata/mos/config:/mosquitto/config \
-v /mnt/user/appdata/mos/data:/mosquitto/data \
-v /mnt/user/appdata/mos/log:/mosquitto/log \
eclipse-mosquitto

 

If you want to add users and disable anonomous logins:

5) On the running docker icon, right click and choose CONSOLE and type: (replace <username>)

mosquitto_passwd -c /mosquitto/config/credentials <username>

 

6) stop the docker

7) edit the /mnt/user/appdata/mos/config/mosquitto.conf file

nano /mnt/user/appdata/mos/config/mosquitto.conf

 

to look like:

persistence true
persistence_location /mosquitto/data/
user mosquitto
# Listen on all interfaces 
listener 1883
#Allow connection without authentication
allow_anonymous false
log_dest file /mosquitto/log/mosquitto.log
log_dest stdout
password_file /mosquitto/config/credentials

 

8 - test and let me know how you get on. I will template this if it works for all.

 

 

Edited by spants
  • Thanks 2
  • Upvote 1
Link to comment
Quote

 

 

Thanks for the fast reply spants.

 

Did create a docker with the guide you wrote. It seems to work like it should. See the log below, this was after a compleet reboot of the unraid server:

 

1656677854: mosquitto version 2.0.14 starting
1656677854: Config loaded from /mosquitto/config/mosquitto.conf.
1656677854: Opening ipv4 listen socket on port 1883.
1656677854: Opening ipv6 listen socket on port 1883.
1656677854: mosquitto version 2.0.14 running
1656677854: New connection from 10.20.30.245:52995 on port 1883.
1656677854: New client connected from 10.20.30.245:52995 as BlueIris (p2, c1, k20, u'unraidmqtt').
1656677855: New connection from 172.18.0.1:45068 on port 1883.
1656677855: New client connected from 172.18.0.1:45068 as mqttjs_917b0112 (p2, c1, k60, u'unraidmqtt').
1656677858: New connection from 172.18.0.1:45084 on port 1883.
1656677858: New client connected from 172.18.0.1:45084 as frigate (p2, c1, k60, u'unraidmqtt').
1656677858: New connection from 10.20.30.250:49785 on port 1883.
1656677858: New client connected from 10.20.30.250:49785 as 633R90zlgEZTP3erW7B1iZ (p2, c1, k60, u'unraidmqtt').
1656677886: New connection from 10.20.30.249:51142 on port 1883.
1656677886: New client connected from 10.20.30.249:51142 as mqtt-explorer-0fa062fa (p2, c1, k60, u'unraidmqtt').
1656678032: Client mqtt-explorer-0fa062fa disconnected.
1656678198: mosquitto version 2.0.14 terminating
1656678198: Saving in-memory database to /mosquitto/data//mosquitto.db.
1656678339: mosquitto version 2.0.14 starting
1656678339: Config loaded from /mosquitto/config/mosquitto.conf.
1656678339: Opening ipv4 listen socket on port 1883.
1656678339: Opening ipv6 listen socket on port 1883.
1656678339: mosquitto version 2.0.14 running
1656678340: New connection from 172.18.0.1:58424 on port 1883.
1656678340: New client connected from 172.18.0.1:58424 as mqttjs_917b0112 (p2, c1, k60, u'unraidmqtt').
1656678340: New connection from 10.20.30.245:53037 on port 1883.
1656678340: New client connected from 10.20.30.245:53037 as BlueIris (p2, c1, k20, u'unraidmqtt').
1656678411: New connection from 10.20.30.250:46975 on port 1883.
1656678411: New client connected from 10.20.30.250:46975 as 6vhnjCb23eaQ6hObVOIxmr (p2, c1, k60, u'unraidmqtt').
1656678445: New connection from 172.18.0.1:52694 on port 1883.
1656678445: New client connected from 172.18.0.1:52694 as frigate (p2, c1, k60, u'unraidmqtt').
1656678587: New connection from 10.20.30.249:51464 on port 1883.
1656678587: New client connected from 10.20.30.249:51464 as mqtt-explorer-0fa062fa (p2, c1, k60, u'unraidmqtt').
1656678702: Client mqtt-explorer-0fa062fa disconnected.
1656678756: Client 6vhnjCb23eaQ6hObVOIxmr closed its connection.
1656678812: mosquitto version 2.0.14 terminating
1656678812: Saving in-memory database to /mosquitto/data//mosquitto.db.
1656679036: mosquitto version 2.0.14 starting
1656679036: Config loaded from /mosquitto/config/mosquitto.conf.
1656679036: Opening ipv4 listen socket on port 1883.
1656679036: Opening ipv6 listen socket on port 1883.
1656679036: mosquitto version 2.0.14 running
1656679046: New connection from 172.18.0.1:38806 on port 1883.
1656679046: New client connected from 172.18.0.1:38806 as mqttjs_deb08702 (p2, c1, k60, u'unraidmqtt').
1656679051: New connection from 172.18.0.1:38808 on port 1883.
1656679051: New client connected from 172.18.0.1:38808 as frigate (p2, c1, k60, u'unraidmqtt').
1656679056: New connection from 10.20.30.245:49676 on port 1883.
1656679056: New client connected from 10.20.30.245:49676 as BlueIris (p2, c1, k20, u'unraidmqtt').
1656679103: New connection from 10.20.30.250:49763 on port 1883.
1656679103: New client connected from 10.20.30.250:49763 as 2bt2ghrZam0tCM674kT4SH (p2, c1, k60, u'unraidmqtt').
1656679199: New connection from 10.20.30.249:51973 on port 1883.
1656679199: New client connected from 10.20.30.249:51973 as mqtt-explorer-0fa062fa (p2, c1, k60, u'unraidmqtt').

 

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.