caprover / netdata-docker

Just a wrapper around NetData container to provide env var settings for some params
1 stars 7 forks source link

Fix the run script #6

Closed mpcref closed 1 month ago

mpcref commented 1 month ago

Removed code in run.sh that prevented the container from running because of the error:

cp: cannot stat '/etc/netdata/override/*': No such file or directory

I don't understand how no one appears to have encountered this error before me.

githubsaturn commented 1 month ago

Does it crash at startup? This error should show up, but certainly shouldn't stop the container from running. I just tested with a simple script:

~/Desktop $   cat test-wrong-file.sh                                                              ✔ 
#!/bin/bash
for f in /etc/does-not-exist/*; do
  echo "test"
done
echo "done"

~/Desktop $ ./test-wrong-file.sh                                                                ✔ 
test
done
githubsaturn commented 1 month ago

Also, similarly the container just works fine: image

mpcref commented 1 month ago

Ah, I might've jumped to conclusions here. NetData wasn't working for me so I looked at the logs for its container and all I saw was this error message. So I therefore concluded that this error was the cause. I then looked at the CapRover source code to see if it was mounting a volume at /etc/netdata/override/. Given that it wasn't and the netdata-docker container is only used by CapRover I figured removing the code that caused the error would resolve the issue. Long story short: ignore my PR, I should've just created an issue instead of a PR.

Having said that, here's the issue I was facing. When I clicked the Open NetData button I was confronted with a plain text error message that read:

Something went wrong... err: Error: connect ECONNREFUSED 10.0.1.8:19999

The thing is, I tried it again just now and it just works! I haven't changed a thing since I submitted this PR. I'll just close this PR now but I'm still curious to hear what you make of this...

mpcref commented 1 month ago

FYI I only saw this one error line in the container logs. None of the extra info lines after that. So the error must've been triggered before that point.

githubsaturn commented 1 month ago

The only line after that is literally just running Netdata, so it muse be a one off error when running netdata

https://github.com/caprover/netdata-docker/blob/master/scripts/run.sh#L118