Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when restarting nodered container: The pid file "/run/dbus/dbus.pid" exists #73

Open
riesenstiefel opened this issue Feb 12, 2022 · 3 comments · May be fixed by #74
Open

Error when restarting nodered container: The pid file "/run/dbus/dbus.pid" exists #73

riesenstiefel opened this issue Feb 12, 2022 · 3 comments · May be fixed by #74

Comments

@riesenstiefel
Copy link

riesenstiefel commented Feb 12, 2022

Hi,

I'm running ct-smart-home on a Pi 4 and I keep experiencing an issue where restarting the nodered container will fail.

docker-compose ps would tell me that nodered is unhealthy and nodered would not be accessible via the configured ports. docker-compose logs nodered would reveal that the container is stuck at the following point:
dbus-daemon[10]: Failed to start message bus: The pid file "/run/dbus/dbus.pid" exists, if the message bus is not running, remove this file.

Looking at entrypoint.sh reveals that prior to starting dbus /var/run/dbus.pid is indeed removed, but not /run/dbus/dbus.pid. Not sure if some update moved dbus.pid to the new location ...

I probably could edit entrypint.sh and build a custom docker image but atm I don't have the time, so I'm going with this quick & dirty workaround, which I apply manually whenever needed:

# container needs to run for this
docker-compose up -d nodered
# remove unhandled dbus pid file
docker-compose exec nodered sh -c 'su-exec root rm -f /run/dbus/dbus.pid'
# restart
docker-compose restart nodered

I would expect that adding somethin like the following line to entrypoint.sh would fix this issue, but I haven't verified it.
[[ -e /run/dbus/dbus.pid ]] && su-exec root rm -f /run/dbus/dbus.pid

Just wanted to share my observations at this point.

Cheers!

Edit:
Note that I added container_name: nodered to my docker-compose.yml, so you will need to adapt my docker-compose commands to your container name.

@ma4a
Copy link

ma4a commented Feb 19, 2022

i also have this problem since yesterday. nodered won't start anymore. Your workaround by removing pid file didn't work for me.

I found the following to work:
edit entrypoint.sh while container is running
docker-compose exec nodered sh -c 'nano /usr/src/node-red/entrypoint.sh'
and add the line on top of the file (added it as second line)
[[ -e /run/dbus/dbus.pid ]] && su-exec root rm -f /run/dbus/dbus.pid

After restarting the container docker-compose restart nodered everything seems fine again. Thanks @riesenstiefel for report and inspiration.

@ma4a ma4a linked a pull request Feb 19, 2022 that will close this issue
@add30417
Copy link

I have the same issue, for me would be more interesting, why a start is needed.

After a run time of about 4-5 minutes, nodered always restart/crashed without any specific message.

Basically only this follow message is shown:
ct-smart-home-nodered-1 | 24 Feb 16:00:02 - [info] Stopped flows

Do you ( @ma4a , @riesenstiefel ) have the same issue?

@8xiom
Copy link

8xiom commented Feb 27, 2022

I have the same issue, for me would be more interesting, why a start is needed.

After a run time of about 4-5 minutes, nodered always restart/crashed without any specific message.

Basically only this follow message is shown: ct-smart-home-nodered-1 | 24 Feb 16:00:02 - [info] Stopped flows

Do you ( @ma4a , @riesenstiefel ) have the same issue?

I step in here since I have the same issue as @ma4a and @riesenstiefel. Reason is obviously that the location of the file dbus.pid has been moved to the folder dbus, i.e. from /run/dbus.pid to /run/dbus/dbus.pid. The workarounds as described above work for me, too. You can also use Portainer, open a shell there (from container list) and just manually delete the dbus.pid file. This is sufficient for restarts until the container is deleted.

So, taking this into account and your log entry "Stopped flows" there is almost certainly another issue you have. Uneducated guess: Wrongly configured flow or missing nodes. You could try to start the node red container in safe mode or with a specific set of flows, see e.g. official node red documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants