Docker Webapp - "Services might be starting"

General Discussion

Docker Webapp - "Services might be starting"

Postby lamontfr » Tue Nov 21, 2017 8:00 am

Hi,
I purchased and installed an AD2USB connected to a Vista 15P panel. It works fine with the Windows app. I want to setup the Webapp on a Raspberry Pi 3 running Jessie, using the Docker image. I ran the pull.sh script on the PI and it completed OK. However I noticed this error message just before the end :
Status: Downloaded newer image for jpetazzo/nsenter:latest
standard_init_linux.go:178: exec user process caused "exec format error"

After reboot when I browse to https://alarmdecoder/ I get the AlarmDecoder logo and a message saying "Services might still be starting - please wait ...".

When I do $ docker ps -a, I can see that the alarmdecoder image is running, but that nsenter is always restarting.

Here is the log of my pull.sh :
Code: Select all
pi@raspberrypi:~/ad2usb $ ls -l
total 8
-rw-r--r-- 1 pi pi  266 Nov 21 13:59 config.cfg
-rw-r--r-- 1 pi pi 2497 Nov 21 13:58 pull.sh
pi@raspberrypi:~/ad2usb $ sudo chmod +x pull.sh
pi@raspberrypi:~/ad2usb $ ls -l
total 8
-rw-r--r-- 1 pi pi  266 Nov 21 13:59 config.cfg
-rwxr-xr-x 1 pi pi 2497 Nov 21 13:58 pull.sh
pi@raspberrypi:~/ad2usb $ ./pull.sh
Reading config....
enable_uart=1
disabling serial console...
preparing dependencies...
sed: can't read /etc/apt/listchanges.conf: No such file or directory
Get:1 http://archive.raspberrypi.org jessie InRelease [22.9 kB]
Get:2 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [9,536 kB]
Get:4 http://archive.raspberrypi.org jessie/main armhf Packages [169 kB]
Get:5 http://archive.raspberrypi.org jessie/ui armhf Packages [58.9 kB]       
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB               
Ign http://archive.raspberrypi.org jessie/main Translation-en                 
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB                 
Ign http://archive.raspberrypi.org jessie/ui Translation-en                   
Get:6 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [43.3 kB]
Get:7 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [84.2 kB]
Get:8 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]   
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB       
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en             
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB       
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en         
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB           
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en               
Fetched 9,931 kB in 18s (544 kB/s)                                             
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
rpi-update is already the newest version.
The following NEW packages will be installed:
  apt-transport-https
The following packages will be upgraded:
  ca-certificates libapt-pkg4.12
2 upgraded, 1 newly installed, 0 to remove and 316 not upgraded.
Need to get 1,054 kB of archives.
After this operation, 179 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libapt-pkg4.12 armhf 1.0.9.8.4 [713 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main apt-transport-https armhf 1.0.9.8.4 [134 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main ca-certificates all 20141019+deb8u3 [207 kB]
Fetched 1,054 kB in 1s (843 kB/s)   
Preconfiguring packages ...
(Reading database ... 126659 files and directories currently installed.)
Preparing to unpack .../libapt-pkg4.12_1.0.9.8.4_armhf.deb ...
Unpacking libapt-pkg4.12:armhf (1.0.9.8.4) over (1.0.9.8.2) ...
Setting up libapt-pkg4.12:armhf (1.0.9.8.4) ...
Processing triggers for libc-bin (2.19-18+deb8u3) ...
Selecting previously unselected package apt-transport-https.
(Reading database ... 126659 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.0.9.8.4_armhf.deb ...
Unpacking apt-transport-https (1.0.9.8.4) ...
Preparing to unpack .../ca-certificates_20141019+deb8u3_all.deb ...
Unpacking ca-certificates (20141019+deb8u3) over (20141019+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up apt-transport-https (1.0.9.8.4) ...
Setting up ca-certificates (20141019+deb8u3) ...
Updating certificates in /etc/ssl/certs... 10 added, 10 removed; done.
Processing triggers for ca-certificates (20141019+deb8u3) ...
Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
alarmdecoder
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.Dwv60DqB0k --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
gpg: requesting key 2C52609D from hkp server p80.pool.sks-keyservers.net
gpg: key 2C52609D: public key "Docker Release Tool (releasedocker) <docker@docker.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
deb https://apt.dockerproject.org/repo raspbian-jessie main
installing docker-engine...
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie InRelease
Get:1 https://apt.dockerproject.org raspbian-jessie InRelease [48.7 kB]
Hit http://archive.raspberrypi.org jessie/main armhf Packages                 
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages             
Get:2 https://apt.dockerproject.org raspbian-jessie/main armhf Packages [3,540 B]
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages           
Hit http://archive.raspberrypi.org jessie/ui armhf Packages                   
Get:3 https://apt.dockerproject.org raspbian-jessie/main Translation-en_GB [454 B]
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages         
Get:4 https://apt.dockerproject.org raspbian-jessie/main Translation-en [454 B]
Get:5 https://apt.dockerproject.org raspbian-jessie/main Translation-en_GB [454 B]
Get:6 https://apt.dockerproject.org raspbian-jessie/main Translation-en [454 B]
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages               
Get:7 https://apt.dockerproject.org raspbian-jessie/main Translation-en_GB [454 B]
Get:8 https://apt.dockerproject.org raspbian-jessie/main Translation-en [454 B]
Get:9 https://apt.dockerproject.org raspbian-jessie/main Translation-en_GB [454 B]
Get:10 https://apt.dockerproject.org raspbian-jessie/main Translation-en [454 B]
Get:11 https://apt.dockerproject.org raspbian-jessie/main Translation-en_GB [454 B]
Ign https://apt.dockerproject.org raspbian-jessie/main Translation-en_GB       
Get:12 https://apt.dockerproject.org raspbian-jessie/main Translation-en [454 B]
Ign https://apt.dockerproject.org raspbian-jessie/main Translation-en         
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB               
Ign http://archive.raspberrypi.org jessie/main Translation-en                 
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB                 
Ign http://archive.raspberrypi.org jessie/ui Translation-en                   
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB       
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB           
Ign http://mirrordirector.raspbian.org jessie/main Translation-en             
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB       
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en         
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB           
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en               
Fetched 52.2 kB in 10s (4,815 B/s)                                             
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  aufs-tools cgroupfs-mount libapparmor1
The following NEW packages will be installed:
  aufs-tools cgroupfs-mount docker-engine libapparmor1
0 upgraded, 4 newly installed, 0 to remove and 316 not upgraded.
Need to get 16.7 MB of archives.
After this operation, 83.0 MB of additional disk space will be used.
Get:1 https://apt.dockerproject.org/repo/ raspbian-jessie/main docker-engine armhf 17.05.0~ce-0~raspbian-jessie [16.6 MB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main aufs-tools armhf 1:3.2+20130722-1.1 [91.0 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main cgroupfs-mount all 1.1 [4,572 B]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main libapparmor1 armhf 2.9.0-3 [58.1 kB]
Fetched 16.7 MB in 11s (1,410 kB/s)                                           
Selecting previously unselected package aufs-tools.
(Reading database ... 126665 files and directories currently installed.)
Preparing to unpack .../aufs-tools_1%3a3.2+20130722-1.1_armhf.deb ...
Unpacking aufs-tools (1:3.2+20130722-1.1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../cgroupfs-mount_1.1_all.deb ...
Unpacking cgroupfs-mount (1.1) ...
Selecting previously unselected package libapparmor1:armhf.
Preparing to unpack .../libapparmor1_2.9.0-3_armhf.deb ...
Unpacking libapparmor1:armhf (2.9.0-3) ...
Selecting previously unselected package docker-engine.
Preparing to unpack .../docker-engine_17.05.0~ce-0~raspbian-jessie_armhf.deb ...
Unpacking docker-engine (17.05.0~ce-0~raspbian-jessie) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u3) ...
Setting up aufs-tools (1:3.2+20130722-1.1) ...
Setting up cgroupfs-mount (1.1) ...
Setting up libapparmor1:armhf (2.9.0-3) ...
Setting up docker-engine (17.05.0~ce-0~raspbian-jessie) ...
Processing triggers for libc-bin (2.19-18+deb8u3) ...
Processing triggers for systemd (215-17+deb8u3) ...
groupadd: group 'docker' already exists
Synchronizing state for docker.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d docker defaults
Executing /usr/sbin/update-rc.d docker enable
Adding user pi to group docker
Pulling latest alarmdecoder image...
latest: Pulling from alarmdecoder/alarmdecoder
702c243dd433: Pulling fs layer
31f58ce5f96f: Pulling fs layer
5e7cd99e3914: Pulling fs layer
b3fa71226532: Pulling fs layer
509f4a378d24: Pulling fs layer
42532529acf9: Pulling fs layer
734258860cdf: Pulling fs layer
fee4d7e02789: Pulling fs layer
2ba2ede4525f: Pulling fs layer
d59f36329302: Waiting
a3ed95caeb02: Waiting
6b06f0d82d4b: Waiting
2d3f6461f146: Waiting
2cf0af99f7bb: Waiting
61631c5845ae: Waiting
aab4a6305406: Waiting
149d1a57e3f1: Waiting
f5e10fb565e0: Waiting
509f4a378d24: Waiting
6b4619ca710b: Waiting
5a65446b986e: Waiting
aca90bc7e362: Waiting
908daa032b74: Waiting
7e91e23b616f: Waiting
d330087f42bd: Waiting
36d38f91ce2d: Waiting
8f21d5d77525: Waiting
ed29bc519149: Waiting
86043e4e7f18: Waiting
ed53d83b2f9a: Waiting
f8e8e7f27650: Waiting
6bb51c935f56: Waiting
295ced4d3008: Waiting
4dad480f3c39: Waiting
47f5c6c6fe35: Waiting
fc532b861bb5: Waiting
8e660cacff51: Waiting
b31d1374c338: Waiting
90bdc3130928: Waiting
bce05b596e41: Waiting
7955551d40f1: Waiting
4b69b8de2d8c: Waiting
b3fa71226532: Waiting
fb353b8646be: Waiting
c15848ff2dcb: Waiting
5e8ab1081637: Waiting
9d56e1309228: Waiting
25cc762b79f4: Waiting
c6d78fe85408: Waiting
c407c4988b21: Waiting
5b39fe5fd85d: Pull complete
465d48a4bdde: Pull complete
1c57a9b1c543: Pull complete
82f55aa4cdca: Pull complete
1b330363888f: Pull complete
890868a1d9de: Pull complete
b56c5c6abb0e: Pull complete
e3a4f7b35fd9: Pull complete
50f6a398c46b: Pull complete
3a092cd3e987: Pull complete
e327398c0803: Pull complete
3f026f33f017: Pull complete
48cb787c518c: Pull complete
02d23fb1cabc: Pull complete
f99caf8b2f79: Pull complete
ad348cababac: Pull complete
c7c0bb6f27b7: Pull complete
fe2bc6aea86d: Pull complete
ddce8c64b4ae: Pull complete
bc4a0661cd0e: Pull complete
f16459e6ae8a: Pull complete
831a62b62f7e: Pull complete
1cee3474ef14: Pull complete
Digest: sha256:1ac6188007eaea60083805661959e8810a253711aa5d97d5fe3ef10fb11e3a53
Status: Downloaded newer image for alarmdecoder/alarmdecoder:latest
sudo: unable to resolve host alarmdecoder
Fetching nsenter...
Unable to find image 'jpetazzo/nsenter:latest' locally
latest: Pulling from jpetazzo/nsenter
5c90d4a2d1a8: Pull complete
c6c4c486dd77: Pull complete
0ed6ac9f06ed: Pull complete
404416bec766: Pull complete
4bf954ba4ae2: Pull complete
23f698ff1fd0: Pull complete
b39fba43fbdb: Pull complete
7889943d47f6: Pull complete
446df4bc8efe: Pull complete
6074415f722e: Pull complete
72024cea4c47: Pull complete
6c4b4f4219d3: Pull complete
93da7ec1688f: Pull complete
0c4337c5a938: Pull complete
Digest: sha256:a30e7da907a9abb715027677c21468005beee06251b7737c86f84fa148d572b0
Status: Downloaded newer image for jpetazzo/nsenter:latest
standard_init_linux.go:178: exec user process caused "exec format error"
Starting alarmdecoder container...
fc4d89f9bd293518aa328c652d2ea855e9d588a8b153ad26d40ab3b5a607a35c
Seems everything went OK - please reboot to finish...
pi@raspberrypi:~/ad2usb $


Can you please let me know what I did wrong ?
Thanks in advance.
lamontfr
newt
newt
 
Posts: 6
Joined: Tue Nov 21, 2017 7:38 am

Re: Docker Webapp - "Services might be starting"

Postby kevin » Tue Nov 21, 2017 8:27 am

nsenter is not anything to do with the container running or not, it's just an extra way to attach to the container.

I would verify by attaching to the container that all services (ser2sock, gunicorn especially) are starting properly.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Docker Webapp - "Services might be starting"

Postby lamontfr » Tue Nov 21, 2017 8:52 am

Thanks Kevin for your quick reply. Here is what I get from inspecting :
Code: Select all
pi@alarmdecoder:~ $ docker ps -a
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                          PORTS               NAMES
fc4d89f9bd29        alarmdecoder/alarmdecoder   "/usr/bin/entry.sh..."   2 hours ago         Up 2 hours                                          adoring_saha
4a52e28a0b68        jpetazzo/nsenter            "/bin/sh -c /insta..."   2 hours ago         Restarting (1) 24 seconds ago                       goofy_volhard


pi@alarmdecoder:~ $ docker top fc4d89f9bd29
UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD

pi                  1649                1612                0                   14:58               pts/0               00:00:00            /bin/bash /usr/bin/entry.sh sudo /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

pi                  1979                1649                0                   14:58               pts/0               00:00:00            tini -sg -- /usr/bin/sudo /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

root                1980                1979                0                   14:58               pts/0               00:00:00            /usr/bin/sudo /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

root                2084                1980                0                   14:58               pts/0               00:00:03            /usr/bin/python /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

sshd                3179                1979                0                   14:58               ?                   00:00:00            /usr/bin/dbus-daemon --system

pi                  5048                1979                0                   14:58               ?                   00:00:55            /usr/local/bin/ser2sock -d -f /etc/ser2sock/ser2sock.conf -P /var/run/ser2sock.pid

root                6527                1979                0                   14:59               ?                   00:00:00            sendmail: MTA: accepting connections

root                6559                1979                0                   15:00               ?                   00:00:00            nginx: master process /usr/sbin/nginx

www-data            6560                6559                0                   15:00               ?                   00:00:00            nginx: worker process

www-data            6562                6559                0                   15:00               ?                   00:00:00            nginx: worker process

www-data            6564                6559                0                   15:00               ?                   00:00:00            nginx: worker process

www-data            6565                6559                0                   15:00               ?                   00:00:00            nginx: worker process
pi@alarmdecoder:~ $



I guess that nginx = gunicorn seems to be alive, but the application does not respond.

Any hints you can give me ? I am a newbie with Docker.
lamontfr
newt
newt
 
Posts: 6
Joined: Tue Nov 21, 2017 7:38 am

Re: Docker Webapp - "Services might be starting"

Postby kevin » Tue Nov 21, 2017 8:55 am

Hi,

nginx is just a proxy to the gunicorn wsgi worker - it appears that gunicorn is not starting properly for some reason - so I would suggest looking at the application and service log files to see why it isn't starting

/opt/alarmdecoder-webapp/instance/logs/*.log
/var/log/syslog
/var/log/daemon.log
/var/log/gurnicorn.d/*
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Docker Webapp - "Services might be starting"

Postby lamontfr » Tue Nov 21, 2017 9:02 am

Hi again Kevin,

I rebooted my PI once more (without changing anything else) and I am now getting a SETUP form. I will let you know how it goes.
lamontfr
newt
newt
 
Posts: 6
Joined: Tue Nov 21, 2017 7:38 am

Re: (SOLVED) Docker Webapp - "Services might be starting"

Postby lamontfr » Tue Nov 21, 2017 12:22 pm

Kevin,

Thanks for your good and rapid feedback. You gave me confidence to continue knowing that I was supported.
I connected the AD2USB to the PI and everything worked. I had to reboot in order for the device to be recognized, but I did not change anything after running the pull.sh script.

I will now use the Webapp to setup notifications.

Thanks for such a great product (hardware and software) !
lamontfr
newt
newt
 
Posts: 6
Joined: Tue Nov 21, 2017 7:38 am

Re: Docker Webapp - "Services might be starting"

Postby lamontfr » Fri Nov 24, 2017 8:12 am

Hi Kevin,

I got the notifications to work perfectly 2 days ago and tested extensively.

However, when I reboot or power off /on the Raspberry PI, the WebApp server behavior is inconsistent. Sometimes it works by itself after about 1-2 minutes after booting. But sometimes after rebooting it gets stuck with "Services might be still starting". Just now I have rebooted 6 times and I cannot get the Webapp server to work properly. By the way I have not changed anything outside of the WebApp UI.

Regarding the log files that you suggested I look at, are these INSIDE the docker file system ?

I cannot see :
/opt/alarmdecoder-webapp/instance/logs/*.log
/var/log/gurnicorn.d/*

and these logs have no recent entries :
/var/log/syslog
/var/log/daemon.log

I will be grateful for your advice as I am leaving for a vacation in a few days and would like to get the webapp to work.
lamontfr
newt
newt
 
Posts: 6
Joined: Tue Nov 21, 2017 7:38 am

Re: Docker Webapp - "Services might be starting"

Postby lamontfr » Fri Nov 24, 2017 5:43 pm

I browsed this forum and was lucky enough to found my answers. Here is how I fixed the problem :

$ docker ps
# shows the <container ID> of alarmdecoder

$ docker exec -it <container ID> bash
# we are now in the container's file system

$ python manage.py initdb
# this re-initializes the database

$ exit
# we are out of the container

$ docker restart <container ID>
# wait 1-2 minutes
# open browser page https://127.0.1.1/
# click retry until see "Setup" with Start button.
lamontfr
newt
newt
 
Posts: 6
Joined: Tue Nov 21, 2017 7:38 am

Re: Docker Webapp - "Services might be starting"

Postby kevin » Sat Nov 25, 2017 9:37 am

Now that you know how to attach to the container, you can now find the logs - if it happens again, attach, look at the logs and post them so we can figure it out
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am


Return to General

Who is online

Users browsing this forum: No registered users and 31 guests

cron