Some services failed to build

Hi all,

Looking for some help please!

I’ve used Screenly OSE on pi’s for a while and it works well but I have been reading about Balena and the ability to remotely update my signage without having to physically visit is very appealing.

However I’m getting stuck, I’m trying to follow the instructions here:
https://www.balena.io/blog/deploy-a-digital-signage-application-with-screenly-and-resin/

and all seems to work well until I start to build and then I get errors:

[main] W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-armhf/Packages 404 Not Found
[main] E: Some index files failed to download. They have been ignored, or old ones used instead.
[main]
[main] Removing intermediate container 064ceac91bbd
[main] The command ‘/bin/sh -c apt-get update && apt-get -y install build-essential curl git-core libffi-dev libssl-dev matchbox net-tools nginx-light omxplayer psmisc python-dev python-imaging python-netifaces python-simplejson libraspberrypi0 ifupdown sqlite3 uzbl x11-xserver-utils xserver-xorg && apt-get clean’ returned a non-zero code: 100
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command ‘/bin/sh -c apt-get update && apt-get -y install build-essential curl git-core libffi-dev libssl-dev matchbox net-tools nginx-light omxplayer psmisc python-dev python-imaging python-netifaces python-simplejson libraspberrypi0 ifupdown sqlite3 uzbl x11-xserver-utils xserver-xorg && apt-get clean’ returned a non-zero code: 100
[Error] Not deploying release.
remote: error: hook declined to update refs/heads/master

I’m wondering if it’s crashing out because it’s looking for Jessie but I’m not sure where I’m going from here - any help?

Paul

Yes, that resource is no longer valid as you can see from here:
http://cdn-fastly.deb.debian.org/debian/dists/

Can you tell me what you do when on this step:
https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/#add-your-first-device

and this one:
https://www.balena.io/docs/learn/getting-started/raspberrypi3/nodejs/#deploy-code

Hi @ealmonte32 thank you for the speedy reply :running_man:

Can you tell me what you do when on these steps:
Get Started with balenaCloud using Raspberry Pi 3 and Node.js - Balena Documentation
and Get Started with balenaCloud using Raspberry Pi 3 and Node.js - Balena Documentation

Both the repositories on this page build successfully using
git clone https://github.com/balena-io-projects/simple-server-node.git
and
git clone git@github.com:balena-io-projects/multicontainer-getting-started.git:smiley:

however for Screenly I have found two repositories: Screenly/screenly-ose.git
which I tried:
git clone https://github.com/Screenly/screenly-ose.git
and this is what fails to build. :thinking:

(I also found an older one: balena-io-playground/balena-scenly-ose-playground.git but I think it’s abandoned in favour of the one above which gives the same error :crazy_face:).

I don’t understand why it’s trying to find the Jessie repros when https://github.com/Screenly/screenly-ose.git has been updated ready for stretch?

It’s probably something really simple… :thinking:

That’s weird, as far as I know that’s correct based on this, so it seems something is outdated… that is the only thing I can think of that makes sense…
Did you create a new balenaOS before doing this?

image

And selecting the newest balenaOS?
image

Yup, new account and default settings.

As the other repositories build I thought it must be something in the screenly github but then why isn’t there more people complaining?

Hmm… did this process from start to finish to see if I encounter the same… and I did not.

(You’re right about the dockerfile info though, I thought stretch was default, the image being built is jessie and not stretch, you can see this from Dockerfile.template and not Dockerfile, I’ll have to ask @vpetersson to chime in and answer that for you, although this does not cause the error you are seeing…)

Your account must be pulling from the wrong source…
Are you 100% that you have the balena cloud with proper configuration, and in your computer you did:

$ git clone https://github.com/Screenly/screenly-ose.git
$ cd screenly-ose
$ git remote add balena your_balena_username@git.balena-cloud.com:your_balena_username/balena_appname.git
$ git push balena master

Screenshots of process from start to finish:

image
image

@ealmonte32 Yeah - we need to rework this. We haven’t touched the Balena support in a while so probably would be helpful to schedule that work in the near future.

Hi @vpetersson and @ealmonte32,

Happy to help be a guinea-pig in this if it would help?

Paul

@Paul
But as you see, even with jessie being built, my compiling of image and build worked, so this is why I want to get a step by step reproduction of what you are doing.
If you can tell me exactly what you’re doing and just replace private words or usernames etc with asterisks.
Example:

  1. Logged in to balena.com
  2. Clicked on this…
  3. Clicked on that…
  4. Selected this… added wifi option…
  5. Flashed to SD card…
  6. Etc…
  7. Went on terminal on computer (OS and all)
  8. Typed git etc in terminal…

Literally like that, step by step, so I can see the difference between how I built it yesterday and how you’re doing it.
Also, it would help if you delete the git cloned folder you created, start fresh, in a new directory…

Hi @ealmonte32,

Thank you for your perseverance with me! I’m wondering if you’ve got the time if it might be worth showing you on hangouts or something rather than filling this forum too much.

I notice my build differs from yours but that might be because you’re building for Pi Zero?

26

My dev computer is a MacBook Pro on macOS 10.14.4 and I’m running git 2.21.0 via HomeBrew

@Paul
Just confirmed that is correct, the resin/raspberry pi 3 repository contains jessie-updates commands but that comes from the hub.docker.com server, which repo for resin/ is controlled by resin/balena, which is called on the Dockerfile.template on the FROM line…

So what you need to do is a bit complicated if you dont understand git much, but basically, get into your screenly-ose directory that you cloned, so you are on your mac, you are on the terminal, and you did git clone https://github… etc ok so far so good
then you did cd screenly-ose, ok in that directory you need to edit the Dockerfile.template file, you can simply use nano , so type in terminal nano Dockerfile.template and on the top edit the line that says FROM, you need to change it to FROM balenalib/raspberrypi3

Ok, now that you are telling the docker which image to build and from which repo, you need to commit the changes, so when you finish editing that FROM line in Dockerfile.template, press ctrl+x, then press y, then press enter.
That should have saved the file, or you can simply edit in your computers textedit or whatever editor you like.
Once that Dockerfile.template contains the correct info, type in terminal, git status and you should see something telling you that you have one modified change, then you type git commit -a which brings up vim editor, and on the top type something like changed dockerfile to new balenalib repo
and then press Esc on your keyboard to stop “Inserting”, then to exit that editor press :x (yup, colon and x, then press enter)

now if you press git status you should not see the modified message anymore, you should see something like Your branch is ahead of origin/master

now type git push balena master and press enter…

You should be golden now… that new image from balena contains the latest build for raspberry pi 3.

1 Like

awesome, looks like we’re building on stretch now - still building so can’t confirm completion but it’s looking promising.

If anyone if following this in the the future and doesn’t know vim then you need :wq to exit to write then quit and you’re away.

Thanks @ealmonte32 I wasn’t familiar with the dockerfile.template - I’d been looking in dockerfile…

2 Likes

so close I can almost smell success…

So now we build successfully and I get the nice ASCII Unicorn :unicorn:

However when the device boots I’m getting errors in the log on balenaCloud:

main bin/start_resin.sh: line 31: systemctl: command not found
main bin/start_resin.sh: line 32: systemctl: command not found
main bin/start_resin.sh: line 33: systemctl: command not found
main bin/start_resin.sh: line 34: systemctl: command not found
main bin/start_resin.sh: line 35: systemctl: command not found
main bin/start_resin.sh: line 42: journalctl: command not found

which would seem to align to the following lines in bin/start_resin.sh

systemctl start X.service
systemctl start matchbox.service
systemctl start screenly-viewer.service
systemctl start screenly-web.service
systemctl start screenly-websocket_server_layer.service

help me out @ealmonte32 we’re nealy there - is there something missing in my path or similar? I know it’s going to be really simple… (or not)

:thinking:

Ugh, I am getting the same error, but I thought it was because the screenly install did not successfully happen since I forgot to whitelist the Pi which needs to connect to all the repos… but this is different… ugh… I am trying to rebuild docker image now, maybe instead of us putting the manual raspberry pi we need to use the proper FROM like this: FROM balenalib/%%BALENA_MACHINE_NAME%%

I am going to try one more time…

update; same error… i don’t have a lot of time to play with this now but if i can get it to work in the next 10 mins i’ll post back, if not, it’ll have to wait =[ cause i think vpetersson has to build a new screenly image specific for the new balenalib/ repo…

1 Like

I’m on leave next week so no great rush. Thank you for your help, v. Impressed with this level of support for an OSE project.

How can I say thank you without switching to Screenly Pro? :wink:

1 Like

Well, I am actually just a support volunteer myself because I am learning so much more by troubleshooting this as a side project/hobby on free time.

@Paul
Just thought of this real quick, when you build the balenaOS by selecting Add a new device, pick 2.29.x instead of recommended one… I have a feeling it would work on that since that is the OS version of balenaOS on the pi zero which worked… which has supervisor of lower version as well…
I would do it myself but already in process of building new docker image.

^^^ tried the above, didnt work… ugh I am annoyed at this…

Just to chime in here quickly - the goal with the experimental and celery branches are to move everything into Docker containers. This will vastly simply the architecture as everything is running inside confined containers w/out any dependencies on system components. It’s still a bit rough but we should probably make a push to finalize that in the next sprint.

@vpetersson Yup, using the moby containers and balena is def an IoT dream when all is worked out.

@Paul I’ve been playing with the different host images (balena vs resin vs raspbian ones), and building screenly into the docker there, one of the recurring issues I am getting is that the container does not seem to find the systemctl application so the command fails and therefore cannot run the screenly services copied into the /etc/systemd/system directory when called. This is probably what viktor is saying regarding dependencies, the container is trying to access system services which it depends on, but they are either on the host and cannot be accessed by container, or they were not installed on the container itself properly…
Regardless, give us some time to figure this out and maybe you will be the first one to know when it works. :upside_down_face:

Hi @ealmonte32,

I’m back from my holidays. Looking back at this threat it seems it’s not so much a screenly OSE problem but a more generic balena / docker issue? If so is it going to affect lots of projects?

Paul

@Paul
Welcome back.

Yes it is not screenly at all, it’s the building of the screenly application on this new balena container that needs to be redone.


Well, when you say lots of projects, do you mean like other people who were going to build IoT devices and use screenly on those devices? If so, I guess yeah…
I haven’t had time at all lately to mess with the Dockerfile.
We have a ticket open on github specific for this, so it is just whoever gets to it first does it.
Balena changed how their containers work or are build, it’s a bit confusing, I was reading some of the documentation, but I’d rather do some more research on properly doing it the new way before just changing the code in the build file.