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


433 posts in this topic Last Reply

Recommended Posts

5 hours ago, Nosbus said:

HI, im also a first time user installing MQTT on unraid via the docker template on the app store. The default/sample config file downloaded does have "user mosquitto" defined twice which causes the error below and the container does not start. Removing the duplicate config entry fixes the issue, but will continue to trip new users.

 

Error: Duplicate user value in configuration.
Error found at /config/mosquitto.conf:21.
Error: Unable to open configuration file.

 

Yup

That was the fault.

Fixed it too.

Now its running.

It is running here, but i dont know what to do next..

I need to connect the unraid API to this broker, but how?

The same for my HA instance running on pi

 

I'm new to this broker

launching gui from this MQTT, just gives me an info page

Link to post
  • 2 weeks later...
  • Replies 432
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Ya....just go into the Node-Red Docker template and change the repository as I said above and hit apply.......That's all I had to do. Love it

This is where I will be hosting some dockers that I find useful, built on a Phusion or Linuxserver base. Add to your templates if you wish.   https://github.com/spants/unraidtemplates/

Does anyone here know how to update node.js version in the Node-Red Docker Container?   docker exec -it NodeRed-OfficialDocker /bin/bash node -V The command above shows I'm on v

Posted Images

On 2/12/2020 at 7:47 AM, skank said:

I need to connect the unraid API to this broker, but how?

This support thread is for the MQTT container (and Spants other containers). I would recommend you head over to whichever project you are referring to and post on their thread. I haven't configured the unraid API to use MQTT myself so I wouldn't know.

 

Good luck!

Edited by Skylord123
Link to post
  • 2 weeks later...

I  recently setup HomeAssistant Core, MQTT, and NodeRed in Docker and everything was going well, then I rebooted my computer and now NodeRed won't open. The log gives me the following error, but I have no idea what it's talking about.

 

Quote

Error: EACCES: permission denied, copyfile '/usr/src/node-red/node_modules/node-red/settings.js' -> '/data/settings.js'
at Object.fs.copyFileSync (fs.js:1918:11)
at copyFile (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:68:8)
at onFile (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:53:25)
at getStats (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)
at startCopy (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10)
at handleFilterAndCopy (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10)
at Object.copySync (/usr/src/node-red/node_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10)
at Object.<anonymous> (/usr/src/node-red/node_modules/node-red/red.js:108:20)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-red-docker@1.0.0 start: `node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"`
npm ERR! Exit status 1


npm ERR! Failed at the node-red-docker@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

If anyone can walk me through what went wrong that'd be great. I have no expertise in this. I saw other comment with similar problems elsewhere, but they talked about multiple users and a bunch of terminal commands. I set this up without through the Community Applications menu without any commands. Also, I'm not running multiple users. All I have is root.
 

I also tried navigating to that file, but I couldn't find it. /usr/src/ doesn't contain node-red it only has linux-4.19-98-Unraid folder

Link to post
20 hours ago, chazzerb314 said:

I  recently setup HomeAssistant Core, MQTT, and NodeRed in Docker and everything was going well, then I rebooted my computer and now NodeRed won't open. The log gives me the following error, but I have no idea what it's talking about.

 

If anyone can walk me through what went wrong that'd be great. I have no expertise in this. I saw other comment with similar problems elsewhere, but they talked about multiple users and a bunch of terminal commands. I set this up without through the Community Applications menu without any commands. Also, I'm not running multiple users. All I have is root.
 

I also tried navigating to that file, but I couldn't find it. /usr/src/ doesn't contain node-red it only has linux-4.19-98-Unraid folder

Sounds like there is some sort of permission issue with your mounted /data volume. 

 

The /usr/src/node-red/node_modules/node-red/settings.js path is inside the container and wont exist on the host (which is why you probably didn't find it). This doesn't matter though because this is just copying the default config file if one doesn't exist. The real problem lies within your mounted appdata volume for node-red (default path on unraid host is /mnt/user/appdata/nodered (unless you specified some other path). I would run this command to see what the permissions are for this directory:
 

ls -all /mnt/user/appdata/nodered

My guess is it is a permission issue but it could be something else. This command should give you all the information you need to fix the problem. If you can't figure it out feel free to post the output here and I can help you out some more.

Link to post

I think that the node red team changed the user permissions inside their docker that conflicts with recent changes on unraid. I have seen this on several containers.

 

I think that I just chmod 777 (container app directory) as a quick fix on mine.

 

I maybe able to change it with extra params for user....

 

Edit: fix here:  https://nodered.org/docs/getting-started/docker

Edited by spants
Link to post

@Skylord123

Quote

Linux 4.19.107-Unraid.
root@Tower:~# ls -all /mnt/user/appdata/nodered
/bin/ls: cannot access '/mnt/user/appdata/nodered': No such file or directory

I ran that command and this is what I got. It doesn't look too promising.

 

 

@spants I ran

Quote

docker run -it -p 1880:1880 --name mynodered nodered/node-red

It created a new mynodered container and it opened. So probably just chalk it up NodeRed-OfficialDocker to a loss and start fresh?

Link to post
22 hours ago, chazzerb314 said:

@Skylord123

I ran that command and this is what I got. It doesn't look too promising.

What did you set nodered's appdata path to? Is it the same path you ran that ls command on?

 

If you changed what the default install directory is you will need to LS that directory instead of the one I mentioned. /mnt/user/appdata/nodered is the default only if you didn't change it.

 

If you didn't change the default path and it is missing now that is pretty alarming and points to either corruption or something deleted it. I actually use CrashPlan for backing up my entire appdata folder because I have had drives fail & accidents happen.

Link to post

Does websockets run on another port?  What port does it run on in docker node-red?  Only 1880 is exposed right?  If you give a path to a websocket node, is that the absolute path or is it under something like /api?

 

Thanks.

 

edited to add...

btw the goal is to just take a POST request on http in and then broadcast that data out to any connected websockets clients.  I got the http part working in nodered but I don't have any idea how to do the websocket part.  Any suggestions would be great.

Edited by uek2wooF
added some explanation
Link to post

I apologize if this is the wrong thread, but I'm rather new to Dockers. I have the node-red docker up and running (I use it form home automation).

Now I'd like to add ffmpeg support to the docker  it so I can use a rstp camera in my ha environment.

Could someone point me in the rough direction on how to achive this?

 

Link to post
On 3/16/2020 at 10:08 PM, uek2wooF said:

Does websockets run on another port?  What port does it run on in docker node-red?  Only 1880 is exposed right?  If you give a path to a websocket node, is that the absolute path or is it under something like /api?

I figured it out.  Websockets also uses port 1880, and the path is absolute.  So you can have http and ws both on 1880 just depending on the path.

Link to post
  • 2 weeks later...

Hi Guys, Hoping someone could point me in the right direction, as i dont know if this issue is with the docker path or with the node palette!

I have installed the palette node-red-contrib-alexa-remote2

Inside the settings a path to save the amazon cookie to a text file, but no matter i put, i keep getting a path/directory not found error

filepath.png.c9c2d3562eab8d104547fa7584207e2f.png

Anyone know what i could try?? 

Install instructions i have seen say i should just put "authFile", which i presume would save it in the installation directory - but it doesn't

 

Cheers

Edited by bdydrp
Link to post
2 hours ago, bdydrp said:

I have saved a cookie.txt file in /mnt/user/appdata/nodered 

and given user permission to match 

Still keep getting "no such file or directory" error

 

I think you need to use the container directory. /mnt/user/appdata/nodered is the host directory that the container directory is mapped to. You can see the container directory from the docker settings. It's probably /data .

Edited by lsaranto
Link to post
9 minutes ago, lsaranto said:

 

I think you need to use the container directory. /mnt/user/appdata/nodered is the host directory that the container directory is mapped to. You can see the container directory from the docker settings. It's probably /data .

Exactly this.

Link to post
2 hours ago, bdydrp said:

In this screenshot, which line is the host directory?

../ or

./

image.png.0ed6da00fb4f2df78e8e8d019deb0a7e.png

Nodered red ownership should be 1000:1000 

but not sure if my error is because the highlighted line is nobody:users?

 

How familiar are you with Linux file and directory structure? /mnt/user/appdata/nodered is the host directory. ./ is the directory itself. ../ is the parent directory (in this case /mnt/user/appdata). If you want to look things from the container's point of view, you need to load the container and then start a shell in it with docker command (docker <somethingsomething>). Sorry, I'm not that familiar with the docker command.

 

In general, I believe, all files under appdata should belong to nobody:users (99:100). Have you tried that? Looking at my own appdata/nodered files: all directories and the last 3 files are owned by nobody:users, The rest are owned by 1000:1000. Except for the cookie.txt which I don't have.

Link to post
45 minutes ago, lsaranto said:

 

How familiar are you with Linux file and directory structure? /mnt/user/appdata/nodered is the host directory. ./ is the directory itself. ../ is the parent directory (in this case /mnt/user/appdata). If you want to look things from the container's point of view, you need to load the container and then start a shell in it with docker command (docker <somethingsomething>). Sorry, I'm not that familiar with the docker command.

 

In general, I believe, all files under appdata should belong to nobody:users (99:100). Have you tried that? Looking at my own appdata/nodered files: all directories and the last 3 files are owned by nobody:users, The rest are owned by 1000:1000. Except for the cookie.txt which I don't have.

Thanks.

The error i have above "EISDIR, ilegal operation on a directory,  read" i took as a permissions error as it cant write a file to /data. Which is owned by 1000:1000 - i thought whis was needed by the nodered documentation

 

I tried a completey fresh install without changing permissios but still got same error.

So now im not sure what to put in the file path location for that palette!

 

Edited by bdydrp
Link to post
5 hours ago, lsaranto said:

Looking at my own appdata/nodered files: all directories and the last 3 files are owned by nobody:users, The rest are owned by 1000:1000.

So i have removed and reinstalled Nodered again - Just so i could compare permissions to what you have stated in yours.

image.png.79d1825ad460645138b272cbb0286642.png

Only the top directories are nobody:users - 

This is the error i get in the palette im using:

image.png.bfa9e8479ea26c846538a1028f28f22c.png

To me, (and clearly i VERY novice with linux) that would seem like a permission error as it cant write to the /data directory?

But, on the other hand, when i add palette's and save flows, it has no problem writing these to the directory!!

Link to post
2 hours ago, bdydrp said:

So i have removed and reinstalled Nodered again - Just so i could compare permissions to what you have stated in yours.

image.png.79d1825ad460645138b272cbb0286642.png

Only the top directories are nobody:users - 

This is the error i get in the palette im using:

image.png.bfa9e8479ea26c846538a1028f28f22c.png

To me, (and clearly i VERY novice with linux) that would seem like a permission error as it cant write to the /data directory?

But, on the other hand, when i add palette's and save flows, it has no problem writing these to the directory!!

 

Have you tried following the guides listed at the end of this page https://flows.nodered.org/node/node-red-contrib-alexa-remote2 ? In one of those guides it says:

File Path is the place where you should type something/anything, meaningful to you like “authFile”. The plugin will create a file with that name and inside the file, it will store your encrypted Amazon credentials. This is needed because otherwise it will ask you to re-login every time you re-deploy your Node-RED flow.

 

So you should only put a filename in it, not a full path. Maybe.

Link to post
41 minutes ago, lsaranto said:

 

Have you tried following the guides listed at the end of this page https://flows.nodered.org/node/node-red-contrib-alexa-remote2 ? In one of those guides it says:

File Path is the place where you should type something/anything, meaningful to you like “authFile”. The plugin will create a file with that name and inside the file, it will store your encrypted Amazon credentials. This is needed because otherwise it will ask you to re-login every time you re-deploy your Node-RED flow.

 

So you should only put a filename in it, not a full path. Maybe.

Yes, ive looked at the guides.

authFile just gives me a "unexpected JSON end" error.

If i put any other path file - this returns a "no such file or directory exists" error

 

Ive tried many paths/filenames etc, but nothing works

Ill keep trying tho!

 

Link to post
1 hour ago, spants said:

Maybe go into appdata folder and

chmod 777 nodered

 

Or whatever the directory name is.... Maybe not good on a site that has internet connected!

I'm pretty sure i have tried that previously and it didnt help.

Will try it again tho

Cheers 

Link to post

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.