Remote build failed

I am following the guide and I have managed to get to the point where I can push BalenaSense to my RasPi0w but I get an error stating:

[sensor]    Step 18/18 : CMD ./entry.sh
[sensor]    Using cache
[sensor]     ---> ff226e5abfd8
[sensor]    Successfully built ff226e5abfd8
[grafana]   /bin/sh: 1: /usr/src/app/download.sh: not found
[grafana]
[telegraf]  /bin/sh: 1: /usr/src/app/download.sh: not found
[telegraf]
[telegraf]  Removing intermediate container d428b4f6f684
[telegraf]  The command '/bin/sh -c /usr/src/app/download.sh "rpi"' returned a non-zero code: 127
[grafana]   Removing intermediate container 77cae94e2317
[grafana]   The command '/bin/sh -c /usr/src/app/download.sh "rpi"' returned a non-zero code: 127
[Info]      Uploading images
[Success]   Successfully uploaded images
[Error]     Some services failed to build:
[Error]       Service: grafana
[Error]         Error: The command '/bin/sh -c /usr/src/app/download.sh "rpi"' returned a non-zero code: 127
[Error]       Service: telegraf
[Error]         Error: The command '/bin/sh -c /usr/src/app/download.sh "rpi"' returned a non-zero code: 127
[Info]      Built on arm03
[Error]     Not deploying release.
Remote build failed

Additional information may be available by setting a DEBUG=1 environment
variable: "set DEBUG=1" on a Windows command prompt, or "export DEBUG=1"
on Linux or macOS.

If you need help, don't hesitate in contacting our support forums at
https://forums.balena.io

For bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/

I have tried a few times and I get the same message.

Hi there @tampadrones and welcome to the balenaCloud forum!

Just to clarify, would you mind providing us with a few pieces of information about the project you are following:

  1. Are you following this guide here: https://www.balena.io/blog/build-an-environment-and-air-quality-monitor-with-raspberry-pi/?
  2. How have you downloaded the project (git pull, download the zip, etc)?
  3. How are you building (ie, using balena push or some other mechanism?

These answers should help us narrow down what is causing these issues. Thank you!

Yes to all three, balena push (name of my device on the dashboard) Thank you for your quick response

Additionally, what platform are you using for local development (Linux/macOS/Windows)?

Winblows. Ive installed node and balena-cli from github. When I type the command ‘balena push balenaSense’ I get an error saying the project cant be found. So when I type ‘balena push BME680’ the command goes through. BME680 is the name of my device on the dashboard.

I suspect you are running into issues with line endings used by Windows, which is a common issue that people run into. If you follow the instructions here (piHole webinterface not reachable), you should be able to push successfully. Please let us know the result of that test! We are additionally planning to make this process easier in the future, you can subscribe to updates here if you like: https://github.com/balena-io/balena-cli/issues/1273.

Again, please let us know if these workarounds fix your issue!

How about if I plug the darn thing in… bahaha!! oh man… I think it will work now…

well, maybe not… it still failed with the same results…

Sorry, can you clarify if you tried fixing the line endings or just tried powering on your target device?

I followed this doc: https://www.balena.io/docs/learn/deploy/deployment/#git-push

I copied the command from my dashboard and there was no cli response, just dropped to the next line… So do we wait and see?

Once you set up the remote (ie, copy paste the command from the dashboard), you will then need to git push as mentioned in the docs you linked to. Have you tried git push balena master already (outlined here for more information: https://www.balena.io/docs/learn/deploy/deployment/#overview-2)?

I didnt see where the second command was referenced in the doc, but doing so yields:

C:\Users\user\balena-sense>git push balena master
g_username@git.balena-cloud.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

C:\Users\user\balena-sense>balena push balenaSense
No applications found with name: balenaSense.

I am learning that there is an issue with the ssh certificate that is being used. Could this be the culprit? Its not clear on what the updated url should be when running my command. Apparently this is an issue when running the windows installer? Not using the correct repository?

I found a post about importing your keys to github and downloading it that way. My public key has been added to github account

@tampadrones when using the balena push balenaSense command, you’ll need to change balenaSense for whatever you called your application when you created it in the dashboard. It looks like the CLI is working correctly, but that the application name balenaSense is not what your app is actually called - you mentioned above that when you ran balena push BME680 it worked, so your application (not your device) is called BME680. When using the balena push workflow it doesn’t use any SSH authentication and doesn’t require any keys to be set up so that won’t be an issue, but you’ll still need to address the line-endings problem by using one of the workarounds suggested above in order for the project to build correctly.

@chrisys Thanks, I figured that out on another post, how to find what to use in place of balenaSense. Im looking through the line ending issue now and I have used git config --global core.autocrlf true but it seems that its still broken.

@tampadrones if you’re still having trouble I would recommend downloading the project again using the zip file option; extract the zip and try balena push again from there.

Ill do that, thanks