How do I manually update Discourse and Docker image to latest?


(Danilo) #43

The container is independent of the data, right? So I can safely upgrade without losing data?

(Of course, I’ll do a backup anyways. But still :))


(Jeff Atwood) #44

Yes, the data is outside the image.


(Steve) #45

The cleanup appears to have been updated, far less verbose, much more intelligible:

root@discourse:/var/discourse# ./launcher cleanup

The following command will
- Delete all docker images for old containers
- Delete all stopped and orphan containers

Are you sure (Y/n): Y
Starting Cleanup (bytes free 20588424)
Finished Cleanup (bytes free 24927676)
root@discourse:/var/discourse#

(Dean Peterson) #49

Did you ever find a solution to this? I am getting the exact same thing trying to update now.


(Avorio) #50

Hi all,

I’m trying to update Discourse to the latest version (1.5.0.beta6) and was asked to update the Docker image first. Cool. I logged into the server but the process has been stuck at the same point for over 3 hours! Here’s the output:

ubuntu@discourse:/var/discourse$ sudo ./launcher rebuild app

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

Unable to find image 'discourse/discourse:1.0.15' locally
1.0.15: Pulling from discourse/discourse
5fe96dd0c297: Pulling fs layer
93bfdb4fbb87: Pulling fs layer
709ef95b65df: Pulling fs layer
3f7b4a652638: Pulling fs layer
0706480e0511: Pulling fs layer
2332d8973c93: Already exists
93bfdb4fbb87: Layer already being pulled by another client. Waiting.
709ef95b65df: Layer already being pulled by another client. Waiting.
3f7b4a652638: Layer already being pulled by another client. Waiting.
0706480e0511: Layer already being pulled by another client. Waiting.
5fe96dd0c297: Verifying Checksum
5fe96dd0c297: Download complete
Pulling repository docker.io/discourse/discourse
0706480e0511: Layer already being pulled by another client. Waiting.

What’s going on? Is there something I can do to move forward? The forum is down.


(Simon King) #51

I think this can happen if a docker pull operation gets interrupted for some reason. Since it’s the docker daemon that actually downloads images, interrupting the client leaves it in a funny state.

You may be able to fix it by restarting the docker daemon.


(Avorio) #52

Thanks for your input, Simon! I tried the following without much success:

ubuntu@discourse:/var/discourse$ sudo docker restart app
app
ubuntu@discourse:/var/discourse$ sudo ./launcher cleanup

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

Unable to find image 'discourse/discourse:1.0.15' locally
1.0.15: Pulling from discourse/discourse
5fe96dd0c297: Pulling fs layer
93bfdb4fbb87: Pulling fs layer
709ef95b65df: Pulling fs layer
3f7b4a652638: Pulling fs layer
0706480e0511: Pulling fs layer
2332d8973c93: Already exists
93bfdb4fbb87: Layer already being pulled by another client. Waiting.
709ef95b65df: Layer already being pulled by another client. Waiting.
3f7b4a652638: Layer already being pulled by another client. Waiting.
0706480e0511: Layer already being pulled by another client. Waiting.
5fe96dd0c297: Verifying Checksum
5fe96dd0c297: Download complete
Pulling repository docker.io/discourse/discourse
0706480e0511: Layer already being pulled by another client. Waiting.

(Simon King) #53

I don’t think this is restarting the docker daemon:

You need something like sudo /etc/init.d/docker restart, or possibly sudo service docker restart.


(Avorio) #54

You are right! Thanks for pointing that out.

Following your suggestion, I ran sudo service docker restart but I am still stuck in the same place:

ubuntu@discourse:/var/discourse$ sudo service docker restart
docker stop/waiting
docker start/running, process 2121
ubuntu@discourse:/var/discourse$ sudo ./launcher cleanup

WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed

Please be patient

Unable to find image 'discourse/discourse:1.0.15' locally
1.0.15: Pulling from discourse/discourse
5fe96dd0c297: Pulling fs layer
93bfdb4fbb87: Pulling fs layer
709ef95b65df: Pulling fs layer
3f7b4a652638: Pulling fs layer
0706480e0511: Pulling fs layer
2332d8973c93: Already exists
709ef95b65df: Verifying Checksum
709ef95b65df: Download complete
3f7b4a652638: Verifying Checksum
3f7b4a652638: Download complete
0706480e0511: Verifying Checksum
0706480e0511: Download complete
5fe96dd0c297: Verifying Checksum
Pulling repository docker.io/discourse/discourse
0706480e0511: Layer already being pulled by another client. Waiting.

(Simon King) #55

Hmm. So some of the images that were previously blocked have now completed, but one still remains. I’m afraid you’ve reached the limit of my docker knowledge; you need to find out whether the docker server really is downloading that layer, or whether something has got stuck. I don’t know how to do that.

Can you see network traffic or perhaps filesystem activity in the /var/lib/docker directory that suggests anything is still happening?


(Kane York) #56

I’m going to guess “do that again”.


(Jeff Wong) #57

Worst case you could delete all local images and re-pull.


(omfg) #58

An ugly workaround that could apply: docker pull: always show me "Layer already being pulled by another client. Waiting." · Issue #15603 · moby/moby · GitHub
Another thread on this docker bug: Docker can hang indefinitely waiting for a nonexistant process to pull an image. · Issue #12823 · moby/moby · GitHub


(Vannak Eng) #59

I followed the command and i got this ERROR: Docker version 1.5.0 not supported, please upgrade to at least 1.6.0, or recommended 1.6.0


(Allen - Watchman Monitoring) #60

At some time near 1.5, the apt package for docker was changed… you may need to

sudo apt-get remove lxc-docker
sudo apt-get install docker-engine


(Jim Ehrlich) #61

I’m trying to upgrade a 6 month old Discourse (updated regularly) on Digital Ocean, I had to first upgrade Ubuntu, then Docker, then Discourse,

./launcher bootstrap app runs without problems, then

./launcher start app

starting up existing container
+ /usr/bin/docker start app
Error response from daemon: Cannot start container app: failed to create endpoint app on network bridge: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
Error: failed to start containers: [app]

Apparently I have messed something up. What?

 docker info
Containers: 1
Images: 45
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 47
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.16.0-23-generic
Operating System: Ubuntu 15.04
CPUs: 1
Total Memory: 993.6 MiB
Name: discourse
ID: 4BWJ:QO6W:SKS3:ELA2:N56W:NE6U:P3DN:2LYX:FWZO:IR7J:HTBK:XWHL
WARNING: No swap limit support

Loading the URL which should go to Discourse gets "“welcome to Nginx on ubuntu”


(Sam Saffron) #62
apt-get remove nginx
apt-get dist-upgrade docker-engine
cd /var/discourse
./launcher rebuild app

(Jim Ehrlich) #63

Following your instructions ->

`193:M 20 Dec 02:31:30.810 # Redis is now ready to exit, bye bye...
e5ed91a7f5a35f35b06625790dfc7e6ccd576c88675d500a637ecbb9623178b7
baacc10ab0fdc27fe352ecc7031aea16e61e0a5e15ce4c69e86f20b609160024
Removing old container
+ /usr/bin/docker rm app
app

+ /usr/bin/docker run -d --restart=always -e LANG=en_US.UTF-8 -e RAILS_ENV=production -e UNICORN_WORKERS=2 -e UNICORN_SIDEKIQS=1 -e RUBY_GC_MALLOC_LIMIT=40000000 -e RUBY_HEAP_MIN_SLOTS=800000 -e DISCOURSE_DB_SOCKET=/var/run/postgresql -e DISCOURSE_DB_HOST= -e DISCOURSE_DB_PORT= -e HOME=/root -e db_shared_buffers=256MB -e DISCOURSE_DEVELOPER_EMAILS=jehrlich@dairyvets.com -e DISCOURSE_HOSTNAME=discourse.VCPR.ORG -e DISCOURSE_SMTP_ADDRESS=smtp.mandrillapp.com -e DISCOURSE_SMTP_PORT=587 -e DISCOURSE_SMTP_USER_NAME=jim.ehrlich@gmail.com -e DISCOURSE_SMTP_PASSWORD=gJfzej99BF-pvqqodmOgzw -h discourse-app -e DOCKER_HOST_IP=172.17.0.1 --name app -t -p 80:80 -p 2222:22 -v /var/discourse/shared/standalone:/shared -v /var/discourse/shared/standalone/log/var-log:/var/log local_discourse/app /sbin/boot
80e3ae3d8495f5333b9c43bd8ee8873a48b08a7b58fecf4a2bddff7e4a3a7028
Error response from daemon: Cannot start container 80e3ae3d8495f5333b9c43bd8ee8873a48b08a7b58fecf4a2bddff7e4a3a7028: failed to create endpoint app on network bridge: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
`

and same result in browser.


(Sam Saffron) #64

try rebooting, try figuring out what is running on port 80 and removing it


(Vannak Eng) #65

I got this E: Unable to locate package docker-engine