dockersamples / example-voting-app Goto Github PK
View Code? Open in Web Editor NEWExample distributed app composed of multiple containers for Docker, Compose, Swarm, and Kubernetes
License: Apache License 2.0
Example distributed app composed of multiple containers for Docker, Compose, Swarm, and Kubernetes
License: Apache License 2.0
Ran docker-machine upgrade and then docker-compose up from within this repo dir, it stalls after connection to redis:
$ docker-compose up
Starting examplevotingappmaster_vote_1
Starting examplevotingappmaster_result_1
Starting examplevotingappmaster_db_1
Starting examplevotingappmaster_worker_1
Starting examplevotingappmaster_redis_1
ERROR: for vote mkdir /c/Users/xcs2188-ta/My Documents: file exists
ERROR: for result mkdir /c/Users/xcs2188-ta/My Documents: file exists
Attaching to examplevotingappmaster_redis_1, examplevotingappmaster_worker_1, examplevotingappmaster_db_1
←[36mredis_1 |←[0m _._
←[36mredis_1 |←[0m _.-``__ ''-._
←[36mredis_1 |←[0m _.-`` `. `_. ''-._ Redis 3.2.1 (00000000/0) 64 bit
←[36mredis_1 |←[0m .-`` .-```. ```\/ _.,_ ''-._
←[36mredis_1 |←[0m ( ' , .-` | `, ) Running in standalone mode
←[36mredis_1 |←[0m |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
←[36mredis_1 |←[0m | `-._ `._ / _.-' | PID: 1
←[36mredis_1 |←[0m `-._ `-._ `-./ _.-' _.-'
←[36mredis_1 |←[0m |`-._`-._ `-.__.-' _.-'_.-'|
←[36mredis_1 |←[0m | `-._`-._ _.-'_.-' | http://redis.io
←[36mredis_1 |←[0m `-._ `-._`-.__.-'_.-' _.-'
←[36mredis_1 |←[0m |`-._`-._ `-.__.-' _.-'_.-'|
←[36mredis_1 |←[0m | `-._`-._ _.-'_.-' |
←[36mredis_1 |←[0m `-._ `-._`-.__.-'_.-' _.-'
←[36mredis_1 |←[0m `-._ `-.__.-' _.-'
←[36mredis_1 |←[0m `-._ _.-'
←[36mredis_1 |←[0m `-.__.-'
←[36mredis_1 |←[0m
←[36mredis_1 |←[0m 1:M 29 Jul 18:19:52.438 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/
sys/net/core/somaxconn is set to the lower value of 128.
←[36mredis_1 |←[0m 1:M 29 Jul 18:19:52.439 # Server started, Redis version 3.2.1
←[36mredis_1 |←[0m 1:M 29 Jul 18:19:52.439 # WARNING overcommit_memory is set to 0! Background save may fail under low
memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the comma
nd 'sysctl vm.overcommit_memory=1' for this to take effect.
←[36mredis_1 |←[0m 1:M 29 Jul 18:19:52.439 # WARNING you have Transparent Huge Pages (THP) support enabled in your ker
nel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/k
ernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a
reboot. Redis must be restarted after THP is disabled.
←[36mredis_1 |←[0m 1:M 29 Jul 18:19:52.439 * The server is now ready to accept connections on port 6379
←[32mdb_1 |←[0m LOG: database system was shut down at 2016-07-29 18:17:50 UTC
←[32mdb_1 |←[0m LOG: MultiXact member wraparound protections are now enabled
←[32mdb_1 |←[0m LOG: database system is ready to accept connections
←[32mdb_1 |←[0m LOG: autovacuum launcher started
←[33mworker_1 |←[0m Connected to db
←[33mworker_1 |←[0m Found redis at 172.18.0.2
←[33mworker_1 |←[0m Connected to redis
Description
Is there a reason to publish redis service port ?
It seems to me that publishing it in docker-stack.yml is unecessary (redis is accessed internally in the swarm by other services).
When deploying the stack, one can see the published port and try to access it from a web browser but will have the following message which can be confusing :
-ERR wrong number of arguments for 'get' command
Steps to reproduce the issue, if relevant:
Following the request of @alexellis in #64 , build an example stack for aarch64 (ARM64, ARMv8).
hi
I got the voting application working in a single node cluster. When I initially tried to use the same Compose file in a Swarm cluster, I got the following error:
Unable to find a node fulfilling all dependencies: --link=examplevotingapp_db_1:db --link=examplevotingap
p_db_1:db_1 --link=examplevotingapp_db_1:examplevotingapp_db_1 --link=examplevotingapp_redis_1:examplevotingapp_redis_1 -
-link=examplevotingapp_redis_1:redis --link=examplevotingapp_redis_1:redis_1
The reason I had this problem was redis and db container were scheduled on 2 different nodes and docker compose could not schedule worker container that links to both redis and db. After some experimentation, I solved this problem by changing "links" to "depends_on" in the compose file. Looks like "links" will schedule containers in same node. Is that correct?
This is what "links" description says in documentation:
"Containers for the linked service will be reachable at a hostname identical to the alias, or the service name if no alias was specified."
Its not clear when links would be absolutely needed?
Is there a way to get this application working with links in Swarm cluster?
Thanks
Sreenivas
There are two redis services and one worker service. Worker service would start, resolve redis host name to an ip and use this ip until stopped. Second redis service is never going to be talked to.
Voting server on nodes does not run
result_1 | [nodemon] starting node --debug server.js
result_1 | _stream_readable.js:498
result_1 | dest.end();
result_1 | ^
result_1 |
result_1 | TypeError: Cannot read property 'end' of null
result_1 | at Socket.onend (_stream_readable.js:498:9)
result_1 | at Socket.g (events.js:273:16)
result_1 | at emitNone (events.js:85:20)
result_1 | at Socket.emit (events.js:179:7)
result_1 | at endReadableNT (_stream_readable.js:913:12)
result_1 | at _combinedTickCallback (internal/process/next_tick.js:74:11)
result_1 | at process._tickCallback (internal/process/next_tick.js:98:9)
I am new to AWS - no problems with Digital Ocean.
ec2-user@ip-172-31-20-77:~/docker/example-voting-app$ docker-compose up -d
ERROR: The engine version is lesser than the minimum required by compose. Your current project requires a Docker Engine of version 1.10.0 or superior.
ec2-user@ip-172-31-20-77:~/docker/example-voting-app$ docker --version
Docker version 1.9.1, build a34a1d5/1.9.1
Ok. So I turned to https://docs.docker.com/engine/installation/linux/centos/
ec2-user@ip-172-31-20-77:~/docker/example-voting-app$ sudo yum-config-manager --add-repo https://packages.docker.com/1.10/yum/repo/main/centos/7
Loaded plugins: priorities, update-motd, upgrade-helper
adding repo from: https://packages.docker.com/1.10/yum/repo/main/centos/7
[packages.docker.com_1.10_yum_repo_main_centos_7]
name=added from: https://packages.docker.com/1.10/yum/repo/main/centos/7
baseurl=https://packages.docker.com/1.10/yum/repo/main/centos/7
enabled=1
ec2-user@ip-172-31-20-77:~/docker/example-voting-app$ sudo yum update docker-engine
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
https://yum.dockerproject.org/repo/main/centos/latest/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
Trying other mirror.
packages.docker.com_1.10_yum_repo_main_centos_7 | 2.9 kB 00:00
packages.docker.com_1.10_yum_repo_main_centos_7/primary_db | 3.7 kB 00:00
Package(s) docker-engine available, but not installed.
No packages marked for update
Looks like they don't tell which kind of OS they use on AMI, have to guess from their usage of yum
Changed to Fedora:
ec2-user@ip-172-31-20-77:~/docker/example-voting-app$ sudo nano /etc/yum.repos.d/docker.repo
To no avail:
ec2-user@ip-172-31-20-77:~/docker/example-voting-app$ sudo yum update docker-engine
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
https://yum.dockerproject.org/repo/main/fedora/latest/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
Trying other mirror.
Package(s) docker-engine available, but not installed.
No packages marked for update
Any idea? BTW, somebody suggested adding proxy=_none_
to /etc/yum.repos.d/docker.repo but this didn't help.
Labels from the voting app don't match the results. While the voting app appears to use variables, the results are statically defined (cats vs dogs - java vs .net)
Followed the procedure at (https://docs.docker.com/engine/getstarted-voting-app/node-setup/#interacting-with-the-machines), copy and pasted the file in the right directory of the manager.
When i launch docker stack deploy --compose-file docker-stack.yml vote
i get volumes must be a mapping"
I'm working on Ubuntu 16.10, i tried also with Windows and it works fine.
Description
When starting application with docker-compose up -d
, both vote and result services do not work.
Steps to reproduce the issue, if relevant:
docker-compose up -d
docker-compose ps
Describe the results you received:
$ docker-compose ps
Name Command State Ports
---------------------------------------------------------------------------------------------------
db docker-entrypoint.sh postgres Up 5432/tcp
examplevotingappmaster_result_1 nodemon server.js Exit 0
examplevotingappmaster_vote_1 python app.py Exit 2
examplevotingappmaster_worker_1 /bin/sh -c dotnet src/Work ... Up
redis docker-entrypoint.sh redis ... Up 0.0.0.0:32770->6379/tcp
Describe the results you expected:
examplevotingappmaster_result_1 and examplevotingappmaster_vote_1 containers should be in up state.
Additional information you deem important (e.g. issue happens only occasionally):
Here is the result of docker-compose logs
command (db & redis services omitted for clarity)
Attaching to examplevotingappmaster_worker_1, db, examplevotingappmaster_result_1, redis, examplevotingappmaster_vote_1
worker_1 | Waiting for db
worker_1 | Connected to db
worker_1 | Connecting to redis
worker_1 | Found redis at 172.19.0.2
vote_1 | python: can't open file 'app.py': [Errno 2] No such file or directory
result_1 | Usage: nodemon [nodemon options] [script.js] [args]
result_1 |
result_1 | See "nodemon --help" for more.
result_1 |
result_1 | Usage: nodemon [nodemon options] [script.js] [args]
Output of docker version
:
Client:
Version: 17.10.0-ce
API version: 1.33
Go version: go1.8.3
Git commit: f4ffd25
Built: Tue Oct 17 19:00:02 2017
OS/Arch: windows/amd64
Server:
Version: 17.11.0-ce
API version: 1.34 (minimum version 1.12)
Go version: go1.8.5
Git commit: 1caf76c
Built: Mon Nov 20 18:39:28 2017
OS/Arch: linux/amd64
Experimental: false
Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):
Running Docker Toolbox on Windows 8.1
The results
app does not handle postgres disconnections.
The worker
app does not handle redis disconnections.
This is my ugly workaround for the results
app in server.js
:
connect();
function connect() {
async.retry(
{times: 1000, interval: 1000},
function(callback) {
pg.connect('postgres://postgres@marathon-lb:10014/postgres', function(err, client, done) {
if (err) {
console.error("Waiting for db");
}
callback(err, client);
});
},
function(err, client) {
if (err) {
return console.err("Giving up");
}
console.log("Connected to db");
getVotes(client);
}
);
}
function getVotes(client) {
client.query('SELECT vote, COUNT(id) AS count FROM votes GROUP BY vote', [], function(err, result) {
if (err) {
console.error("Error performing query: " + err);
connect();
} else {
var votes = collectVotesFromResult(result);
io.sockets.emit("scores", JSON.stringify(votes));
}
setTimeout(function() {getVotes(client) }, 1000);
});
}
Image Problems
Old Images: Code has changed in this repo and images are older than the code, causing old PR fixes to have no effect if you're using the official images. One example:
dockersamples/examplevotingapp_worker:latest
is two years old but I fixed a 100% CPU issue nearly two years ago. Running current image will still spike CPU.
Missing Images: Images for alternate builds don't always exist. One example:
This repo has a java worker
as an alternative to the default dotnet worker
, but Hub has no image for that. I recommend building it as tag java
.
Duplicate Image Repos: Images are duplicated in different Hub repos. One example:
dockersamples/examplevotingapp_worker
and dockersamples/worker
are the same app but different build dates. The former is what's used in all yaml and in README and what we've used for many years. The latter has a new build, and I'm guessing was created by the new Jenkinsfile added a year ago to help automate image builds, which is great, but that file is pushing to the wrong Hub repos and is not complete with the various tags and alt builds. Doing some quick searching it looks like no one is using the new image repos, so it would be OK to remove them and stick with the origionals.
No Image Tag Docs: To help people get the most out of these images and demo, it would be quite helpful to have a table in the README.md listing all the images, their tags, and the reason for those tags. One example:
What is the difference between :latest
, :before
, and :after
? What tags are for what OS/arch?
Suggested Solutions
If the Jenkinsfile is indeed the future, I think a single PR could fix all these issues by fixing the current image repo/tags and adding all the alt builds to it, along with a README update on tag options for demos.
I'm looking for a thumbs up from maintainers that this would be the prefered resolution, and I'll get started on a PR. It looks like the Jenkinsfile will test the new builds in the PR but won't test the push commands until it's merged to master 😬
Heya
I got issues accessing the voting-app on a swarm deployment through docker stack
.
frontend
overlay-network not need to be marked as external
in the docker-stack.yml
?docker stack deploy
?Thx for any help on making this work for me, Christian.
We now have many compose files, some for (what seems like) local dev-focused docker-compose workflows, and some focused on swarm/k8s stack workflows.
I'm working on some updates to these files based on the last 1-2 years of feature enhancements but I don't understand the use case for the simple.yml files. These seem to be 90% of what's in the "normal" files but there's no docs or comments on why they exist. Can someone give us a backstory or info on their usage?
May I add a License file, unless its specifically unlicensed. I am unsure as to where the github terms of service really leave anyone with no license selected - "By setting your repositories to be viewed publicly, you agree to allow others to view and fork your repositories". Happy to put in a pull request if a license type is selected.
** PLEASE ONLY USE THIS ISSUE TRACKER TO SUBMIT ISSUES WITH THE EXAMPLE VOTING APP **
Please provide the following information so we can assess the issue you're having
Description
780ede8fb4a7Step 2/7 : WORKDIR /app
---> Running in 1e8b0ea9248f
Removing intermediate container 1e8b0ea9248f
---> d7b2bf6590e9
Step 3/7 : ADD requirements.txt /app/requirements.txt
---> 6ddfe351d3ba
Step 4/7 : RUN pip install -r requirements.txt
---> Running in c4e0827691c6
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f04b201cd10>: Failed to establish a new connection: [Errno -3] Try again',)': /simple/flask/Output of docker info
:
(paste your output here)
Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):
Something is wrong with .NET
:
log : Installing runtime.native.System.Net.Http 4.0.1-rc2-24027.
log : Installing System.Reflection.Emit.ILGeneration 4.0.1-rc2-24027.
log : Installing System.Reflection.TypeExtensions 4.1.0-rc2-24027.
log : Installing System.Diagnostics.Tools 4.0.1-rc2-24027.
log : Installing System.Globalization.Extensions 4.0.1-rc2-24027.
log : Installing System.Runtime.InteropServices.PInvoke 4.0.0-rc2-24027.
�[91mSegmentation fault (core dumped)
�[0mThe command '/bin/sh -c dotnet restore -v minimal src/ && dotnet publish -c Release -o ./ src/Worker/ && rm -rf src/ $HOME/.nuget/' returned a non-zero code: 139
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Hi,
I'm not sure to asking questions here is appropriate but i need some help.
docker-compose up
command works in my machine without problem but i want to try debug only .NET worker project with Visual Studio or VS Code.
I don't know where to start? How to prepare project structure? How to configure dockerfile or docker-compose.yml?
Description
There's something with the .net version of the worker app that causes it to randomly not connect to db or redis on startup, which results in a crash. Over the last year I've had thousands of students use this app to learn docker and swarm, and one of the most common issues is this worker failing on startup. It happens on all modern docker versions, across platforms, and there is no common theme to why it doesn't work.
Today in testing, we killed the broken service, which was re-creating the task over and over and it was failing, and once the service was recreated, and it worked... with no changes in how we created it. See log below for typical behavior. The stack trace tells you it can't resolve something, but doesn't show what it can't look up, so I can't tell what it thinks the problem is. From all the cases I've seen and testing I've done, it's not related to other services being down or general network issues.
This also happens for Kubernetes, as seen by other issues reported in this repo.
Hundreds of people have reported this problem to me, and deploying the java version fixes the issue.
Workaround
Deploy the java version of the worker, which I have build here: bretfisher/examplevotingapp_worker:java
Steps to reproduce the issue, if relevant:
In swarm:
Describe the results you received:
Notice below that we created a worker service with two replicas, and you'll see one replica work, and the other fail, then get re-created on the same node and work the 2nd time. It's random if it fails, and which one would fail.
➜ vote git:(master) ✗ docker service logs 413rw4tamzd6
vote_worker.2.itk0wfpt22gh@node3 | Waiting for db
vote_worker.2.itk0wfpt22gh@node3 | Connected to db
vote_worker.2.itk0wfpt22gh@node3 | Found redis at 10.0.4.7
vote_worker.2.itk0wfpt22gh@node3 | Connecting to redis
vote_worker.2.itk0wfpt22gh@node3 | Processing vote for 'a' by 'fb54d895d481b473'
vote_worker.2.tv9i1viknli2@node3 | System.AggregateException: One or more errors occurred. (No such device or address) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No such device or address
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.ResolveCallback(Object context)
vote_worker.2.tv9i1viknli2@node3 | --- End of stack trace from previous location where exception was thrown ---
vote_worker.2.tv9i1viknli2@node3 | at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.<>c.<GetHostAddressesAsync>b__25_1(IAsyncResult asyncResult)
vote_worker.2.tv9i1viknli2@node3 | at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
vote_worker.2.tv9i1viknli2@node3 | --- End of inner exception stack trace ---
vote_worker.2.tv9i1viknli2@node3 | at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
vote_worker.2.tv9i1viknli2@node3 | at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
vote_worker.2.tv9i1viknli2@node3 | at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
vote_worker.2.tv9i1viknli2@node3 | at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
vote_worker.2.tv9i1viknli2@node3 | at Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout)
vote_worker.2.tv9i1viknli2@node3 | at Npgsql.NpgsqlConnection.OpenInternal()
vote_worker.2.tv9i1viknli2@node3 | at Worker.Program.OpenDbConnection(String connectionString) in /code/src/Worker/Program.cs:line 78
vote_worker.2.tv9i1viknli2@node3 | at Worker.Program.Main(String[] args) in /code/src/Worker/Program.cs:line 19
vote_worker.2.tv9i1viknli2@node3 | ---> (Inner Exception #0) System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (0x00000005): No such device or address
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.ResolveCallback(Object context)
vote_worker.2.tv9i1viknli2@node3 | --- End of stack trace from previous location where exception was thrown ---
vote_worker.2.tv9i1viknli2@node3 | at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
vote_worker.2.tv9i1viknli2@node3 | at System.Net.Dns.<>c.<GetHostAddressesAsync>b__25_1(IAsyncResult asyncResult)
vote_worker.2.tv9i1viknli2@node3 | at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)<---
vote_worker.2.tv9i1viknli2@node3 |
vote_worker.1.hjt41aigtbwq@node2 | Waiting for db
vote_worker.1.hjt41aigtbwq@node2 | Waiting for db
vote_worker.1.hjt41aigtbwq@node2 | Waiting for db
vote_worker.1.hjt41aigtbwq@node2 | Waiting for db
vote_worker.1.hjt41aigtbwq@node2 | Waiting for db
vote_worker.1.hjt41aigtbwq@node2 | Connected to db
vote_worker.1.hjt41aigtbwq@node2 | Found redis at 10.0.4.7
vote_worker.1.hjt41aigtbwq@node2 | Connecting to redis
vote_worker.1.hjt41aigtbwq@node2 | Processing vote for 'b' by 'fb54d895d481b473'
Describe the results you expected:
Worker always works :)
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version
:
root@node3:~# docker version
Client:
Version: 18.09.5
API version: 1.39
Go version: go1.10.8
Git commit: e8ff056
Built: Thu Apr 11 04:44:24 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.5
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: e8ff056
Built: Thu Apr 11 04:10:53 2019
OS/Arch: linux/amd64
Experimental: false
Output of docker info
:
root@node3:~# docker info
Containers: 20
Running: 0
Paused: 0
Stopped: 20
Images: 38
Server Version: 18.09.5
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 macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
NodeID: 1zyd50hmid7dado3s02tago7y
Is Manager: true
ClusterID: spa40crzsqgtn4pix7hj4sac1
Managers: 3
Nodes: 3
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 134.209.46.216
Manager Addresses:
134.209.46.216:2377
165.227.220.117:2377
68.183.159.208:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-154-generic
Operating System: Ubuntu 16.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 992.1MiB
Name: node3
ID: UA2M:37YB:EPX6:BKDU:WMNA:3F4A:GVE6:X3GD:Q3UK:YKYF:6J2H:QQNC
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: No swap limit support
Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):
This has happened on Docker Desktop, Digital Ocean, Docker Toolbox on VirtualBox, and more.
docker-compose up
gives this
ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.
I have multiple containers running services. In my code I am using service name to access other services. issue is there is no link option so no entry in /etc/hosts file to resolve name to IP of container.
How can I fix this issue?
cloned the repo, ran docker-compose up.
on voting, the logs gives
vote_1 | 10.0.19.2 - - [22/Dec/2016 20:04:10] "POST / HTTP/1.1" 200 -
worker_1 | Processing vote for 'a' by 'cceb022e236a011b'
db | ERROR: duplicate key value violates unique constraint "votes_id_key"
db | DETAIL: Key (id)=(cceb022e236a011b) already exists.
db | STATEMENT: INSERT INTO votes (id, vote) VALUES ($1, $2)
also it does not reflect any change on the result app , even when voting for the first time.
I don't know how to integrate with HAproxy
Hello,
I tried to use "Voting App" in docker 1.12 swarm (Docker version 1.12.1, build 23cf638, experimental
), I followed here-->https://blog.docker.com/2016/06/docker-app-bundle/ to how to use bundle. I was able to docker deploy
the application and the containers are up and running. But, the ports were not exposed. I was not able to curl http:127.0.0.1:5000
--> curl: (7) Failed to connect to localhost port 5000: Connection refused
. Checked in docker events
, the voting app container are continuously recreating!. (I have changed the yaml file: Removed "Build" and added "Image". Attaching the yaml file)
My YAML File:
version: "2"
services:
vote:
image: docker/example-voting-app-vote
command: python app.py
volumes:
- ./vote:/app
ports:
- "5000:80"
redis:
image: redis:alpine
ports: ["6379"]
worker:
image: docker/example-voting-app-worker
db:
image: postgres:9.4
result:
image: mantika/docker-example-voting-app-result
command: nodemon --debug server.js
volumes:
- ./result:/app
ports:
- "5001:80"
- "5858:5858"
ERROR: Service 'vote' failed to build: no matching manifest for windows/amd64 in the manifest list entries
I cloned the repository
PS C:\samples> git clone https://github.com/dockersamples/example-voting-app.git
Cloning into 'example-voting-app'...
remote: Counting objects: 377, done.
Receiving objects: 94% (355/377) 0 (delta 0), pack-reused 377
Receiving objects: 100% (377/377), 204.57 KiB | 0 bytes/s, done.
Resolving deltas: 100% (133/133), done.
Changed into the clone directory and attempted to build the sample
PS C:\samples\example-voting-app> docker-compose up
Building vote
Step 1/7 : FROM python:2.7-alpine
2.7-alpine: Pulling from library/python
ERROR: Service 'vote' failed to build: no matching manifest for windows/amd64 in the manifest list entries
PS C:\samples\example-voting-app>
I'm running on a Windows 10 dev box with the Docker for Windows client installed. It is running in Windows Container mode.
Any ideas why the sample will not come up?
Hello,
I tried to compose the app on an Amazon Linux. I got the following error:
Unsupported config option for services service: 'db'
Are there any prerequisites that I missed?
Thanks
**Got error when trying to reproduce the "docker-compose up" **
Output of docker version
:
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:22:34 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:29:19 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
output of running "docker-compose up
Building worker
Step 1/5 : FROM microsoft/dotnet:2.0.0-sdk
---> fde8197d13f4
Step 2/5 : WORKDIR /code
---> Using cache
---> 669d92fbc80d
Step 3/5 : ADD src/Worker /code/src/Worker
---> Using cache
---> 71a36dd19109
Step 4/5 : RUN dotnet restore -v minimal src/Worker && dotnet publish -c Release -o "./" "src/Worker/"
---> Running in f9dd38f5733c
MSBUILD : error MSB1050: Specify which project or solution file to use because the folder "src/Worker" contains more than one project or solution file.
ERROR: Service 'worker' failed to build: The command '/bin/sh -c dotnet restore -v minimal src/Worker && dotnet publish -c Release -o "./" "src/Worker/"' returned a non-zero code: 1
Docker for mac:
The worker service seems to busy poll Redis with listleftpop()
in a busy loop. This results in excessive CPU usage. This may be due to fact that StackExchange.Redis (SE.Redis) does not offer matching methods for the blocking left or rights pops of the Redis (BLPOP/BLROP)? According to the SE.redis documentation blocking primitives will never be supported and pub/sub should be used instead. This would require subscription to be added to the worker. Since the voting service does redis.rpush('votes', data)
without publish
it would need to be modified as well.
Description
The result
service app, as provided, fails to start and thus the web app is down.
Steps to reproduce the issue, if relevant:
git clone https://github.com/dockersamples/example-voting-app.git
docker-compose up -d
docker-compose logs -f result
Describe the results you received:
result_1 | [nodemon] 1.12.1
result_1 | [nodemon] to restart at any time, enter `rs`
result_1 | [nodemon] watching: *.*
result_1 | [nodemon] starting `node --debug server.js`
result_1 | (node:19) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
result_1 | [nodemon] app crashed - waiting for file changes before starting...
Describe the results you expected:
result_1 | [nodemon] 1.12.1
result_1 | [nodemon] to restart at any time, enter `rs`
result_1 | [nodemon] watching: *.*
result_1 | [nodemon] starting `node server.js`
result_1 | Thu, 23 Nov 2017 17:20:51 GMT body-parser deprecated bodyParser: use individual json/urlencoded middlewares at server.js:67:9
result_1 | Thu, 23 Nov 2017 17:20:51 GMT body-parser deprecated undefined extended: provide extended option at ../node_modules/body-parser/index.js:105:29
result_1 | App running on port 80
result_1 | Connected to db
Additional information you deem important (e.g. issue happens only occasionally):
The service command
seems to be faulty.
Output of docker version
:
Client:
Version: 17.11.0-ce-rc4
API version: 1.34
Go version: go1.8.4
Git commit: 587f1f0
Built: Thu Nov 16 01:17:06 2017
OS/Arch: darwin/amd64
Server:
Version: 17.11.0-ce-rc4
API version: 1.34 (minimum version 1.12)
Go version: go1.8.5
Git commit: 587f1f0
Built: Thu Nov 16 01:43:23 2017
OS/Arch: linux/amd64
Experimental: true
Output of docker info
:
Containers: 18
Running: 5
Paused: 0
Stopped: 13
Images: 583
Server Version: 17.11.0-ce-rc4
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 logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 992280e8e265f491f7a624ab82f3e238be086e49
runc version: 0351df1c5a66838d0c392b4ac4cf9450de844e2d
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.60-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: HDHC:P4O3:CPUG:QWG7:EMRL:XDGC:76QM:U4JZ:YBLM:TPDY:JMEJ:OFMW
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 63
Goroutines: 73
System Time: 2017-11-23T17:32:35.384856415Z
EventsListeners: 2
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):
Docker for Mac
The .NET part of the sample (https://github.com/docker/example-voting-app/tree/master/worker) is now using an old .NET Core SDK. It needs to be updated, both in the Dockerfile and move to csproj (as opposed to project.json). I assume that actual code doesn't need to be changed. There is an opportunity to move it to C# 7 if there are some good cases for that (I didn't look).
We should treat DockerCon as the deadline for this, in case anyone gets interested in the combination of .NET and Docker together. Imagine that!
Hey, @kendrahavens @MichaelSimons ... can one of you do this?
** PLEASE ONLY USE THIS ISSUE TRACKER TO SUBMIT ISSUES WITH THE EXAMPLE VOTING APP **
Please provide the following information so we can assess the issue you're having
Description
The docker-compose.yml (and docker-compose-simple.yml) file use volume mounts for the vote & result apps. While this is something a developer might do while conducting 'inner-loop' debugging, it seems unnecessary and poor practice to have as part of an example of "real code". It also assumes that the source code is on the same machine as the compose file, which really should not be a pre-req.
Note that the containers build and execute perfectly fine without the volume mounts
Steps to reproduce the issue, if relevant:
see this code:
services:
vote:
build: ./vote
command: python app.py
volumes:
- ./vote:/app
ports:
- "5000:80"
networks:
- front-tier
- back-tier
result:
build: ./result
command: nodemon server.js
volumes:
- ./result:/app
ports:
- "5001:80"
- "5858:5858"
networks:
- front-tier
- back-tier
How can I use this behind a corporate proxy
Please provide the following information so we can assess the issue you're having
Description
Follow instruct Start a sample application
error of run docker-compose up --build.
Steps to reproduce the issue, if relevant:
1.Install Docker Desktop on Windows
2.Start a Redis container
3.download the Example voting app from the Docker samples page.
4.run docker-compose up --build
Describe the results you received:
ERROR: Encountered errors while bringing up the project.
Describe the results you expected:
the application successfully starts
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version
:
ERROR: for result Cannot start service result: Ports are not available: listen tcp 0.0.0.0:5858: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):
Docker for Windows
A Java worker which consumes votes and stores them in…
Nope.
Hi to all,
**Trying to use Docker Swarm on Windows with Windows Containers **
Steps to reproduce the issue, if relevant:
docker swarm init --advertise-addr Local_IP
Then we connect our worker PC with command which came from docker swarm init --advertise-addr
cd example-voting-app
docker stack deploy --compose-file=docker-stack-windows-1809.yml voting_stack
If we watch one of Services with:
docker service ps voting_stack_vote
we get this view:
8. We would appreciate if someone can write to us what we can do to fix our Issue.
Describe the results you received:
We are getting Error Messege "No such image: dockersamples/..""
Describe the results you expected:
We expected normal installation of required Images and normal connection over localhost:5000 to deployed Site as it is described in dockersamples/example-voting-app GitHub Repository
Hey, I'd like to talk about armhf (RaspPi) support of the example app. There's a branch available at https://github.com/gesellix/example-voting-app/tree/rpi for review.
Since there are many people (including me) playing around with RPi clusters already, so the recently added docker stack
example was an incentive to make the complete stack work in the RPi cluster.
It's actually working on my cluster (surprise ;-) ), so I guess others would also like to see how easy it is these days to adapt a complete stack to another platform. The only thing I skipped was the .NET variant of the worker, because I'm personally more familiar with Java.
The most important aspect for me is to simply carry my whole 5 nodes cluster around with me, being independent on hosting providers and public network access. Demoing the example app becomes a bit different with such a setup, but I guess it will show how easy it is to use Docker tools even on such "playgrounds".
What do you think? I'm open for suggestions - maybe an own branch would make sense so that newbies won't be overwhelmed by the whole lot of Dockerfiles. I'm also thinking of multiarch support for the images used in the docker-stack demo file. Would that even make sense for a simple example like this?
Glad to hear your feedback!
Hi,
I have the newest version of Docker for Ubuntu 16.04,
I've cloned this repo and I've tried to start the app but I've got this message
ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.
docker info:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 1
Server Version: 1.12.3
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 3
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: host bridge overlay null
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-53-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.38 GiB
Name: q-Ralat
ID: DOZ3:YDOH:W6DM:FNTC:QMEX:67XW:7MXZ:B5AX:WLW6:BO7Z:NIZ4:2DMP
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
127.0.0.0/8
docker version:
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 22:01:48 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 22:01:48 2016
OS/Arch: linux/amd64
Any help will be appreciated.
Thanks,
Mike
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:
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
result_1 | Waiting for db
worker_1 | Waiting for db
db | done
db | server stopped
db |
db | PostgreSQL init process complete; ready for start up.
db |
db | LOG: database system was shut down at 2017-02-28 02:53:16 UTC
db | LOG: MultiXact member wraparound protections are now enabled
db | LOG: database system is ready to accept connections
db | LOG: autovacuum launcher started
result_1 | Connected to db
db | ERROR: relation "votes" does not exist at character 38
db | STATEMENT: SELECT vote, COUNT(id) AS count FROM votes GROUP BY vote
result_1 | Error performing query: error: relation "votes" does not exist
worker_1 | Connected to db
worker_1 | Found redis at 172.20.0.3
worker_1 | Connecting to redis
vote_1 | 192.168.1.114 - - [28/Feb/2017 02:55:01] "GET / HTTP/1.1" 200 -
Results into following error.
Proxy is defined into Dockerfile
.
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-jar-plugin:2.4: Plugin org.apache.maven.plugins:maven-jar-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-jar-plugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-compiler-plugin:3.1: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-resources-plugin:2.3: Plugin org.apache.maven.plugins:maven-resources-plugin:2.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.10/maven-surefire-plugin-2.10.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-surefire-plugin:2.10: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.0: Plugin org.apache.maven.plugins:maven-site-plugin:3.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.0
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.0
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2):
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2):
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2):
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2):
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.839s
[INFO] Finished at: Fri Feb 26 02:32:26 UTC 2016
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'dependency' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
ERROR: Service 'worker' failed to build: The command 'mvn dependency:resolve' returned a non-zero code: 1
Building result
Step 1/11 : FROM node:5.11.0-slim
---> cb888ea932ad
Step 2/11 : WORKDIR /app
---> Using cache
---> d6501817bc62
Step 3/11 : RUN npm install -g nodemon
---> Using cache
---> 33415c41649c
Step 4/11 : ADD package.json /app/package.json
---> Using cache
---> a1cf6be1ea33
Step 5/11 : RUN npm config set registry http://registry.npmjs.org
---> Using cache
---> 4d1f7b8fdd8b
Step 6/11 : RUN npm install && npm ls
---> Using cache
---> c57c08940ae2
Step 7/11 : RUN mv /app/node_modules /node_modules
---> Running in 00171c370efd
mv: cannot remove '/app/node_modules/.bin/mime': No such file or directory
mv: cannot remove '/app/node_modules/.bin/semver': No such file or directory
mv: cannot remove '/app/node_modules/accepts/HISTORY.md': No such file or directory
mv: cannot remove '/app/node_modules/accepts/LICENSE': No such file or directory
mv: cannot remove '/app/node_modules/accepts/README.md': No such file or directory
mv: cannot remove '/app/node_modules/accepts/index.js': No such file or directory
mv: cannot remove '/app/node_modules/accepts/package.json': No such file or directory
mv: cannot remove '/app/node_modules/after/.npmignore': No such file or directory
mv: cannot remove '/app/node_modules/after/.travis.yml': No such file or directory
mv: cannot remove '/app/node_modules/after/LICENCE': No such file or directory
mv: cannot remove '/app/node_modules/after/README.md': No such file or directory
mv: cannot remove '/app/node_modules/after/index.js': No such file or directory
mv: cannot remove '/app/node_modules/after/package.json': No such file or directory
The images you use don't exist on docker hub so the user cannot pull it down...
Question inside...
FROM node:5.11.0-slim
WORKDIR /app
RUN npm install -g nodemon
# Why I need to move inside /app ? Can I just npm i?
ADD package.json /app/package.json
# Do I need this and why?
RUN npm config set registry http://registry.npmjs.org
RUN npm install && npm ls
# Why I need to mv node_modules outside to parent /app ?
# Maybe just don't move package.json into /app at first place?
RUN mv /app/node_modules /node_modules
# And then copy . including node_modules back to app again?
ADD . /app
ENV PORT 80
EXPOSE 80
CMD ["node", "server.js"]
It should be something I miss there, Any hint is welcome.
Thanks
** PLEASE ONLY USE THIS ISSUE TRACKER TO SUBMIT ISSUES WITH THE EXAMPLE VOTING APP **
Please provide the following information so we can assess the issue you're having
Description
All pods are running normal except the worker pod. After digging into the logs there is an exception of type AggregateException "no such device or address.
Steps to reproduce the issue, if relevant:
1.
2.
3.
Describe the results you received:
worker pod in crashloopbackoff
Describe the results you expected:
worker pod will run
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version
:
Client:
Version: 18.09.6
API version: 1.39
Go version: go1.10.8
Git commit: 481bc77
Built: Sat May 4 02:35:57 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.6
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 481bc77
Built: Sat May 4 01:59:36 2019
OS/Arch: linux/amd64
Experimental: false
Output of docker info
:
Containers: 17
Running: 16
Paused: 0
Stopped: 1
Images: 8
Server Version: 18.09.6
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 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: bb71b10fd8f58240ca47fbb579b9d1028eea7c84
runc version: 2b18fe1d885ee5083ef9f0838fee39b62d653e30
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-50-generic
Operating System: Ubuntu 18.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.947GiB
Name: node1
ID: BZCL:OEV3:XFPE:CRZ3:ACL4:JE52:7RB4:IZYT:2G5S:BQVT:7QH7:AU27
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
WARNING: No swap limit support
Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):
environment:
virtualbox vm
ubuntu server v18.04
network card is configured as "network bridge adapter"
all machines have an ip address in my own LAN.
output 'kubectl logs
System.AggregateException: One or more errors occurred. (No such device or address) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No such device or address
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
at System.Net.Dns.<>c.<GetHostAddressesAsync>b__14_1(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Npgsql.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnection.OpenInternal()
at Worker.Program.OpenDbConnection(String connectionString) in /code/src/Worker/Program.cs:line 74
at Worker.Program.Main(String[] args) in /code/src/Worker/Program.cs:line 19
---> (Inner Exception #0) System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No such device or address
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
at System.Net.Dns.<>c.<GetHostAddressesAsync>b__14_1(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)<---
I tried to run this application on a single node machine through docker-compose, but it failed with below errors.
[root@fedora-1gb-blr1-01 example-voting-app]# cat /etc/fedora-release
Fedora release 23 (Twenty Three)
[root@fedora-1gb-blr1-01 example-voting-app]# docker -v
Docker version 1.10.3, build f476348/1.10.3
[root@fedora-1gb-blr1-01 example-voting-app]# docker-compose -v
docker-compose version 1.6.2, build 4d72027
# docker-compose up
Creating volume "examplevotingapp_db-data" with default driver
Starting examplevotingapp_db_1
Starting examplevotingapp_redis_1
Starting examplevotingapp_worker_1
Starting examplevotingapp_voting-app_1
Starting examplevotingapp_result-app_1
Attaching to examplevotingapp_db_1, examplevotingapp_redis_1, examplevotingapp_worker_1, examplevotingapp_voting-app_1, examplevotingapp_result-app_1
db_1 | chmod: changing permissions of ‘/var/lib/postgresql/data’: Permission denied
redis_1 | _._
redis_1 | _.-``__ ''-._
redis_1 | _.-`` `. `_. ''-._ Redis 3.2.0 (00000000/0) 64 bit
redis_1 | .-`` .-```. ```\/ _.,_ ''-._
redis_1 | ( ' , .-` | `, ) Running in standalone mode
redis_1 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
redis_1 | | `-._ `._ / _.-' | PID: 1
redis_1 | `-._ `-._ `-./ _.-' _.-'
redis_1 | |`-._`-._ `-.__.-' _.-'_.-'|
redis_1 | | `-._`-._ _.-'_.-' | http://redis.io
redis_1 | `-._ `-._`-.__.-'_.-' _.-'
redis_1 | |`-._`-._ `-.__.-' _.-'_.-'|
redis_1 | | `-._`-._ _.-'_.-' |
redis_1 | `-._ `-._`-.__.-'_.-' _.-'
redis_1 | `-._ `-.__.-' _.-'
redis_1 | `-._ _.-'
redis_1 | `-.__.-'
redis_1 |
redis_1 | 1:M 10 Jun 20:15:11.818 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1 | 1:M 10 Jun 20:15:11.818 # Server started, Redis version 3.2.0
redis_1 | 1:M 10 Jun 20:15:11.818 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1 | 1:M 10 Jun 20:15:11.818 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1 | 1:M 10 Jun 20:15:11.818 * The server is now ready to accept connections on port 6379
worker_1 | Connected to redis
worker_1 | Failed to connect to db - retrying
voting-app_1 | python: can't open file 'app.py': [Errno 13] Permission denied
examplevotingapp_db_1 exited with code 1
examplevotingapp_voting-app_1 exited with code 2
result-app_1 | module.js:341
result-app_1 | throw err;
result-app_1 | ^
result-app_1 |
result-app_1 | Error: Cannot find module '/app/server.js'
result-app_1 | at Function.Module._resolveFilename (module.js:339:15)
result-app_1 | at Function.Module._load (module.js:290:25)
result-app_1 | at Function.Module.runMain (module.js:447:10)
result-app_1 | at startup (node.js:148:18)
result-app_1 | at node.js:405:3
examplevotingapp_result-app_1 exited with code 1
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
worker_1 | Failed to connect to db - retrying
^CGracefully stopping... (press Ctrl+C again to force)
Stopping examplevotingapp_worker_1 ... done
Stopping examplevotingapp_redis_1 ... done
Hi,
a recent change in Microsoft/ASPnet image makes the deployment of the application fail. The repo now is a Windows based images instead a Linux one.
~/example-voting-app$ sudo docker-compose up
Building worker
Step 1 : FROM microsoft/aspnet
latest: Pulling from microsoft/aspnet
9c7f9c7d9bc2: Downloading
081af1807c20: Download complete
552bd0bc6fa3: Download complete
0964ce0f4e6c: Download complete
55a3e459d610: Download complete
1155a9785854: Download complete
ERROR: Service 'worker' failed to build: unknown blob
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.