Fail to push application to Balena Cloud

I followed this guide to release a sample application to Raspberry pi 3.
When I tried to push the code using this command:

balena push Test

I faced the error:

could not load any valid magic files!

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

For CLI 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/

Does anybody have an idea of what’s happened?

Hi,

Did you follow our guide up to this step?

Now to deploy this code to all device(s) in the application, use the balena push FirstApp command replacing FirstApp with the name of your application. Ensure you are in the root of the project directory before issuing this command or specify the --source option to provide an alternate location of the project directory.

and balena push Test command returned this error message could not load any valid magic files! (You used Test as the application name instead of FirstApp).

I just want to confirm if you follow all the steps correctly and can you please let us know what is the CLI version that you installed?

Hi there – just wanted to confirm that I’m having the same problems as well. Some details:

  • I’m also going through the Getting Started with Raspberry Pi 3 guide, using a Raspberry Pi 3
  • I’ve followed the steps in the tutorial up to the balena push command
  • My app is also named “Test”
  • I see this output when running the command (with debugging turned on):
$ balena apps ; export DEBUG=1 ; balena push Test
ID      APP NAME DEVICE TYPE  ONLINE DEVICES DEVICE COUNT
1578870 Test     raspberrypi3 1              1
[debug] original argv0="balena" argv=[/home/aardvark/balena-cli/balena,/snapshot/versioned-source/bin/balena,push,Test] length=4
[debug] Using . as build source
could not load any valid magic files!

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

For CLI 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/
  • The version of the CLI I have is 11.25.2 (balena-cli-v11.25.2-linux-x64-standalone.zip)

  • I’m running this on Fedora 31. (For fun, I tried turning off SELinux, but I still got the same error.) I have also tried this on Debian 9.11, and got the same error.

  • I’m able to log in, list devices and apps, and show devices logs using the balena CLI.

If you need any further info, please let me know.

Thanks in advance for any help you can give!

Quick update: Just for fun, I tried downloading version 11.21.5 (older version picked at random) of the CLI, and balena push Test did work; the output I saw was exactly as shown in the tutorial. This was on Fedora 31; other than switching the directory used in PATH, I made no other changes. Hopefully this helps narrow things down. I’ve got a bug filed on the Github repo, but again let me know if you need any further info.

@giangblackk, @saintaardvark, thank you for reporting this issue. I gather that the error message "could not load any valid magic files!" comes from the mmmagic library, which is a dependency introduced in CLI version 11.25.0 in order to automatically convert text file line endings from Windows CRLF to Unix LF.

Almost certainly, CLI versions 11.24.0 or older are not affected, so right now the suggested workaround is to downgrade the CLI to version 11.24.0. The following Github CLI issue can be used to track updates on a fix, which should be available shortly: https://github.com/balena-io/balena-cli/issues/1596 (it is possible to “subscribe for notifications” on the Github issue).

1 Like

Hi there, just wanted to let you know that this issue should now be fixed as of balena CLI version 11.25.3.

1 Like

Hi @tmigone and @pdcastro – I can confirm that this works for me now, and I’m able to run balena push with version 11.25.3. Thanks so much for the quick turnaround!

Balena CLI version 11.25.3 works. Thank you for fixing it.