Newbie! Simple problem

I am playing with the trainsign application to learn more about Balena. I followed all the instructions and have my Raspberry Pi running the app.

However, the container can’t find the shell script to start.

main /bin/sh: 1: ./balena-run.sh: not found

It just keeps showing this error repeatedly. I can’t ssh into the MAIN app, the said the container is restarting.

How can I troubleshoot this?

Thanks!

I’d first try setting an absolute path to your balena-run.sh file. Assuming this is the repo you’re playing with https://github.com/balena-io-playground/UK-Train-Departure-Display the absolute file path would be /usr/app/balena-run.sh.

Another option is specifically invoking bash at the end of your dockerfile with CMD ["bash", "/usr/app/balena-run.sh"]

Hopefully one of those will get you on the right path.

That was great info. That definitely fixed that problem. Thanks!

Now, I am getting syntax errors in the balena-run.sh script.
02.09.19 07:38:11 (-0400) main /usr/app/balena-run.sh: line 2: $‘\r’: command not found
02.09.19 07:38:11 (-0400) main /usr/app/balena-run.sh: line 15: syntax error: unexpected end of file

I will keep working on it. This definitely gets me closer!

Kurt

So, for some reason, when I push the app, it is adding ^M to the end of each line of the file. This is causing syntax errors I believe. I am sure this is some kind of windows translation issue. I am going to to push from Linux and see if that works differently.

Kurt

Hi Kurt, if you’re fighting with Line Endings in Git, then this page may be helpful.

So, I gave up on Windows and created a Debian 9 Virtualbox. Pushed the app from Linux and everything worked great. I will do everything in Linux from now on.

Hi Kurt,

Have you tried adjusting your git configuration to properly handle line endings? If so, let us know what additional problems you faced and we might be able to help further!