question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vote container not starting + fix

See original GitHub issue

Description

Vote container not starting. Running latest example-voting-app on up-to-date Docker Desktop on a Mac

Steps to reproduce the issue, if relevant:

  1. git clone latest version
  2. docker-compose up --build -d
  3. docker-compose ps

Describe the results you received: “docker-compose ps” shows “Exit 1” on vote_1 container. Rest is Up:

$ docker-compose ps
          Name                        Command               State                       Ports                    
-----------------------------------------------------------------------------------------------------------------
7_microservices_result_1   nodemon server.js                Up       0.0.0.0:5858->5858/tcp, 0.0.0.0:5001->80/tcp
7_microservices_vote_1     python app.py                    Exit 1                                               
7_microservices_worker_1   /bin/sh -c dotnet src/Work ...   Up                                                   
db                         docker-entrypoint.sh postgres    Up       5432/tcp                                    
redis                      docker-entrypoint.sh redis ...   Up       0.0.0.0:32769->6379/tcp 

‘docker-compose logs’ shows the following error:

OSError: [Errno 8] Exec format error

Describe the results you expected: Well… Up instead of Exit 1 😎

Additional information you deem important (e.g. issue happens only occasionally): I’ve fixed it… see below.

Output of docker version:

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:39 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     true

Output of docker info:

Containers: 5
 Running: 5
 Paused: 0
 Stopped: 0
Images: 33
Server Version: 18.09.2
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 5.818GiB
Name: linuxkit-025000000001
ID: F4NW:FVGS:ZLTR:PEZA:T625:TSHW:4PB6:XX4C:WOVM:UIGB:TWSE:NYAA
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 66
 Goroutines: 83
 System Time: 2019-05-15T21:29:37.0272169Z
 EventsListeners: 2
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.): Docker Desktop on macOS 10.14.4.

The Fix I’ve added a ‘shebang’ to ‘example-voting-app/vote/app.py’:

#!/usr/bin/env python2.7

Now it runs like expected:

$ docker-compose ps
          Name                        Command               State                      Ports                    
----------------------------------------------------------------------------------------------------------------
7_microservices_result_1   nodemon server.js                Up      0.0.0.0:5858->5858/tcp, 0.0.0.0:5001->80/tcp
7_microservices_vote_1     python app.py                    Up      0.0.0.0:5000->80/tcp                        
7_microservices_worker_1   /bin/sh -c dotnet src/Work ...   Up                                                  
db                         docker-entrypoint.sh postgres    Up      5432/tcp                                    
redis                      docker-entrypoint.sh redis ...   Up      0.0.0.0:32769->6379/tcp 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

2reactions
robeatozcommented, Jun 20, 2019

I had the same issue on Docker for Windows and I fixed it with two changes:

0reactions
wusatosicommented, Jun 25, 2019

hmm… looks ok. Strange. And you’re using the original Dockerfile to build ‘vote’? I mean: it 's still using python:2.7-alpine?

Yes… I did not change the Dockerfile, more strangly, if I compile and build it as an single image, it runs smoothly without any warning. even with the shebang removed, I think it is an docker-compose issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker container startup hangs while trying to run voting app
Please guide how to fix this issue, and how to get the vote app running on container. My OS details are as follows:...
Read more >
docker - Failed to start Container after reboot
Starting a new container works fine. How can a fix, it and sould the container not start by itself because of "--restart alway"...
Read more >
cannot start docker container v1.25.0 #2510
container does not start correctly. When typing docker logs vaultwarden I get the following error. thread 'main' panicked at 'called `Result::unwrap()` on ...
Read more >
Diagnose container start issues in Azure App Service for ...
I deployed successfully a simple rails app to my Azure App Service following this Microsoft Learn tutorial but the app does not start....
Read more >
containers won't start after manual backup removal #2350
I regularly have to remove old backups to free up disk space. This usually leads to my containers not starting up again until...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found