Can't push to my device from CLI

Hi,
I’m new to balena and want to try it, after lots of reading finally I decided to do it!
I use an old odroid C1 with developpement image, install cli on my computer, but i’m stuck to push the example container.
My device answer well to ping balena.local, but when I do : balena push balena.local --debug
the answer is:
[Debug] Checking we can access device
[Debug] Sending request to http://192.168.1.166:48484/ping
Could not communicate with local mode device at address 192.168.1.166

i can ssh it without problem.
An other thing, I try to do it with balena cloud image, the device is now b68dd27, but same error and the device never appear on my dashboard.

Thanks for your work, and sorry for my english.

It might be that your ‘local mode’ is not enabled. Did you enable it?

If you are using open balena you could do the following to enable it:
balena env add BALENA_SUPERVISOR_LOCAL_MODE 1 --device <uuid>

Else if you are using balena cloud you should have a look at this doc: https://www.balena.io/docs/learn/develop/local-mode/

Thanks for this quick answer,

I tried but failed, with open balena:

balena env add BALENA_SUPERVISOR_LOCAL_MODE 1 --device balena.local
BalenaDeviceNotFound: Device not found: balena.local

balena env add BALENA_SUPERVISOR_LOCAL_MODE 1 --device balena
BalenaDeviceNotFound: Device not found: balena

I can access ssh via : balena ssh balena.local so I was thinking balena or balena .local was the uuid.

I try balena scan (I reinstall bonjour and reboot) but always this output:
Could not find any balenaOS devices on the local network.
and the note for windows to install bonjour.
balena devices is empty, and > balena device balena.local (or balena) can’t find my device.

Does your device show up when you do balena devices or is it not listed there aswell?

It will show you the id you can use with the command. Using ‘balena.local’ as UUID won’t work as it is not the id of the device.

balena devices return only:

ID UUID DEVICE NAME DEVICE TYPE APPLICATION NAME STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL

no device listed

Is there a way to obtain id or uuid trough ssh?

There is your problem. Your devices it not listed. I had a similar problem last week where my device would not show up even though I could SSH into the device.

My problem was that I was using BalenaOs version 2.51 for my RaspberryPi4. There is an active issue on github: https://github.com/balena-io/open-balena/issues/80

In layman terms: your device is not notifying the server that the device is up and running and ready for use. It won’t get an UUID assigned and you then you get stuck.

For now you should consider using an older BalenaOS version like 2.48.0.

Dev image: https://files.balena-cloud.com/images/raspberrypi4-64/2.48.0%2Brev1.dev/image/balena.img.zip
Prod image: https://files.balena-cloud.com/images/raspberrypi4-64/2.48.0%2Brev1.prod/image/balena.img.zip

The first thing you should do after booting is checking if the device shows up with balena devices
If so than just run the previous command I gave you; it will enable local mode. After that de device will most likely show up with balena scan.

Thanks I’ll try it!
edit: last version for odroid c1 is 2.38

Ok that’s an older OS so I don’t think it’s the problem.
Maybe your device is not able to reach your OpenBalena instance?

Did you execute the domain-configuration steps explained in the getting started tutorial?

I was mistaking when I told using open balena, I use the image on the downloading area of balena os.
So I don’t use this getting started tutorial but this one https://www.balena.io/os/docs/odroid-c1/getting-started/.

Ok, I haven’t done anything with balena-cloud so I hope someone from the balena-team comes in for the rescue.

In the meantime I could share my thoughts but it’s just a guessing game for me. When you ssh into your device you could run the balena ps command. It will show the running containers. There should be a supervisor container running with the status ‘healthy’.

I think’s my board is sick! the balena ps command is stuck showing nothing and won’t return to prompt unless I do a “ctrl c” break.

I am not sure if it’s your board. I do know that balena ps should work. It not working indicates the basic features of BalenaOS are not working. Maybe you have the wrong image? Another version maybe?

Hello there Raoul, welcome to the forums!

As gerb0n (thanks for the assist btw!) says, running balena ps should work. If it doesn’t list at least the supervisor image it means there has been a problem during provisioning most likely. To troubleshoot we could start by looking at some logs with the following commands:

  • `journalctl -u balena --no-pager``
  • dmesg

Note that you need to SSH into the device, which you said you can do a few comments above.

Also, since you are just starting out with balena let me clarify something. The tutorial you followed will show you how to get started running the “unmanaged” flavour of balenaOS. This means that your device will be running by itself, with no knowledge of fleets, apps, deployments, and without the cool features a managed solution provides.

To truly take advantage of balenaOS you’ll need to have it be managed, currently you can do so by using balenaCloud or openBalena:

  • openBalena is our open source platform to deploy and manage your balenaOS devices.
  • balenaCloud is our own platform, based on openBalena, that adds a lot of very useful features (device diagnostics for example).

For a beginner I would recommend to check out balenaCloud, for example here is a guide for your board: https://www.balena.io/docs/learn/getting-started/odroid-c1/nodejs/
balenaCloud is free and fully featured for your first 10 devices, so it’s a great starting point. Once you are comfortable with it, you can look into running your own instance of openBalena or upgrade your balenaCloud account to a paid one. Remember that in all cases your device will still be running balenaOS, it’s only the “cloud” aspect that changes.

Hi, one more thing. Make sure you have local mode enabled on your device. You enable local mode from the device dashboard page, left pane Actions section and then click on Enable local mode. After that, you can try to push again as you did before.

Really thanks for that support.

I use 2 different sd cards, 1 with image from balena cloud the other from balena os. the device won’t appear on the dashboard (even after balena login with cli). And I really want to use the cloud version but for now I just try to understand why it’s stuck.

This is the return of the commands you told me:

root@balena:~# journalctl -u balena --no-pager
-- Logs begin at Thu 1970-01-01 00:00:00 UTC, end at Mon 2020-06-15 19:36:25 UTC. --
-- No entries --

dmesg is too long to post but there is the dmesg with only critical messages

root@balena:~# dmesg -l err,crit,alert,emerg
[    0.000000] Global timer: MESON TIMER-F (c1186bc0) initialized
[    7.954996] mmcblk0: r/w command failed, status = 0x80000b00
[    7.955200] end_request: I/O error, dev mmcblk0, sector 60751864
[    7.961449] Buffer I/O error on device mmcblk0, logical block 7593983
[    7.971387] mmcblk0: r/w command failed, status = 0x80000b00
[    7.973784] mmc_blk_reset 939 reset error md->reset_done:1 and type:1
[    7.980448] end_request: I/O error, dev mmcblk0, sector 60751864
[    7.987590] Buffer I/O error on device mmcblk0, logical block 7593983
[    8.057199] mmcblk0: r/w command failed, status = 0x80000b00
[    8.057405] end_request: I/O error, dev mmcblk0, sector 60751864
[    8.063578] Buffer I/O error on device mmcblk0p6, logical block 7415807
[    8.101607] mmcblk0: r/w command failed, status = 0x80000b00
[    8.101812] end_request: I/O error, dev mmcblk0, sector 60751864
[    8.109256] Buffer I/O error on device mmcblk0p6, logical block 7415807
[    9.508897] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    9.521904] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[   17.379841] mmcblk0: r/w command failed, status = 0x80000b00
[   17.380048] end_request: I/O error, dev mmcblk0, sector 60751864
[   17.386220] Buffer I/O error on device mmcblk0, logical block 7593983
[   17.412196] mmcblk0: r/w command failed, status = 0x80000b00
[   17.415461] end_request: I/O error, dev mmcblk0, sector 60751864
[   17.421828] Buffer I/O error on device mmcblk0, logical block 7593983
[   17.537705] mmcblk0: r/w command failed, status = 0x80000b00
[   17.537916] end_request: I/O error, dev mmcblk0, sector 60751864
[   17.547931] Buffer I/O error on device mmcblk0p6, logical block 7415807
[   17.561247] mmcblk0: r/w command failed, status = 0x80000b00
[   17.561461] end_request: I/O error, dev mmcblk0, sector 60751864
[   17.568089] Buffer I/O error on device mmcblk0p6, logical block 7415807

I’ll try with an other sd or it’s the sd controller!!!

Yes, it does look like hw issues. So make sure first that you verify the hw is fine, you could also try the vendor provided OS and check there’s no I/O errors and then balenaOS should work too

Thanks all,

I try with 3 different micro sd buyed at legal store, all faulty!!!
but the 4th from cheap ali… is working fine.
Really sorry for this waste of your time (and my money :laughing: )

The only thing I know now, is that I found a really great support forum!
First rule now check, no double check, no quadruple check your sd card.

Sorry to hear about all the faulty SD cards.
But glad you got it working in the end.
Enjoy Balena and happy hacking!