Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injected user application won't start on first boot without connection #34

Closed
KemperVreden opened this issue Mar 9, 2017 · 16 comments
Closed
Assignees
Labels

Comments

@KemperVreden
Copy link

KemperVreden commented Mar 9, 2017

In a blogpost which mentions the resin-preload-image-script the author says:

Our supervisor now supports running a preloaded application before registering with the resin.io API. This means your devices can be provisioned with an application's code loaded up and ready to go on the very first boot. Saving you bandwidth and time in the factory, and in an extreme case even allowing your device to function without ever been connected to the Internet.

but (especially) ...

This means your devices can be provisioned with an application's code loaded up and ready to go on the very first boot.

and (readme of this repository) ...

Using this will allow images with supervisor version above 1.0.0 to run the user application without connectivity, and without the need to download the container.

... is unfortunately not true. We are using resin-preload-image-script in production but we always have to connect devices to the internet. The device needs to register itself before the application is being started. If there is no connection, the application won't run.

If the device has successfully registered itself you can restart the device without connection and the application will start.

This script is a HUGE timesaver but it would be even better if the application starts on first boot without the need to connect the device to the internet!

Here's a thread on resins forum: link

@KemperVreden KemperVreden changed the title Injected user application won't start on first boot Injected user application won't start on first boot without connection Mar 9, 2017
@jhermsmeier jhermsmeier self-assigned this Mar 9, 2017
@jhermsmeier jhermsmeier added the bug label Mar 9, 2017
@alexandrosm
Copy link

alexandrosm commented Mar 9, 2017 via email

@jhermsmeier
Copy link
Contributor

I'm already looking into it, and currently setting up to test / reproduce this.

@KemperVreden
Copy link
Author

KemperVreden commented Mar 9, 2017

@alexandrosm

Host OS Version is Resin OS 1.24.1
Supervisor Version is 2.8.3

Here's the output of the resin-preload-image-script:

https://gist.github.com/KemperVreden/032483678ed0c4247804366973cf5741

I was able to reproduce this every time I tried it again - so it's definitely not working. Tried it at least six different times on two different applications. Both applications required connectivity to resin - otherwise the container application will not run ...

@pcarranzav
Copy link
Contributor

@KemperVreden @jhermsmeier @alexandrosm sorry, this is most likely the bug that was fixed in balena-os/balena-supervisor#384 - and will be deployed with supervisor 3.0.1.

@KemperVreden
Copy link
Author

KemperVreden commented Mar 9, 2017

@pcarranzav Oh that's a bit frustrating to hear since I really thought this would be a fault on our side - So we have to wait for the new version of the supervisor to be release I guess and there is no workaround?

We are manufacturing a lot of devices in the upcoming next weeks and this would greatly improve the time needed to manufacture a single device.

Is there an estimated release date for the new version?

@jhermsmeier
Copy link
Contributor

jhermsmeier commented Mar 9, 2017

I can confirm, nothing happens until the device gets network access, ~~also on resinOS 2.~~~
EDIT: I wasn't very smart the first time around, testing again.
@pcarranzav is there a temporary workaround we could put in place?

@KemperVreden
Copy link
Author

KemperVreden commented Mar 9, 2017

@pcarranzav @jhermsmeier What happens if I use the Resin CLI to perform os configure <image> <uuid> or os initialize <image> on the preloaded image? Would that be a workaround?

-> Just tested it - that does not work ...

Another thought: What happens when running CLI command device init to download a new image and running the preload-script with this image?

@jhermsmeier
Copy link
Contributor

@KemperVreden so, there's a bug in the preload script as well; the referenced pull request should fix this for supervisor version 3.0.1+ (which is available in resin OS 2), but sadly not for the older supervisors.

@KemperVreden
Copy link
Author

@pcarranzav @jhermsmeier Today I've been testing the ResinOS 2.0 rc1 Image with latest commit of the resin-preload-image-script and I was able to preload and run the application without having a connection to the internet.

However. In our application we are using a personalized version of resin-wifi-connect and when the injected application starts up it is not going to start up the WiFi hotspot that it normally creates. Maybe this is another bug? Or is it a bug of Resin OS 2.0 because the network manager changed, something like that?

@pcarranzav
Copy link
Contributor

@KemperVreden that could indeed be a bug in wifi-connect with OS 2.0 - the network manager changed but there should be support in the latest versions. Could you confirm you're using the latest wifi-connect? Otherwise, could you file a bug report in github.com/resin-io/resin-wifi-connect ? Including the logs from the device and what versions you're running will probably help us diagnose.
(@josephroberts might know better about current status of wifi-connect with NetworkManager?)

@KemperVreden
Copy link
Author

@pcarranzav As you I read your comment I realized that the version we are using is not the latest - Version 1.x something like that - but it was definitely before version 2.0 was released! So yes - that could be causing it ...

@alexandrosm
Copy link

alexandrosm commented Mar 13, 2017 via email

@imrehg
Copy link
Contributor

imrehg commented Apr 4, 2017

@pcarranzav just checked this with resinOS v2.0.0+rev2 / supervisor 4.1.1 (the latest release for Raspberry Pi 3) and does not seem to start the application on device start, only works when network is available.

Also on resinOS 2.0.0-rc1.rev2 / supervisor 4.0.0 (just tested to see whether there was a cut-off point where it stopped working).

@pcarranzav
Copy link
Contributor

@imrehg I've tracked this down to balena-os/balena-supervisor#420 - should be safe to close this issue as it is not related to preloading, it's the supervisor as a whole that is crashing.

@jhermsmeier
Copy link
Contributor

Okay, closing this then – @KemperVreden please do reopen this, if you run into issues again.

@pcarranzav
Copy link
Contributor

@KemperVreden, @imrehg please follow balena-os/balena-supervisor#421 for a fix to this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants