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


(Sam Saffron) #66

See


(Jim Ehrlich) #68

stop/restart the droplet had no effect.

nginx is listening on port 80 ; http://(domain).org, http://(domain).org, loads the “nginx on ubuntu” welcome page. http://discourse.(domain).org gets “connection refused”

It seems nginx is not serving the app? I’m not very experienced with this. Would this be nginx config?

update:

another ./launcher rebuild app
now serves Discourse from http://discourse.(domain).org but not from http://(domain).org
This is something I should be able to figure out myself, but if you want to tip me …

update update: nginx welcome from root domain was just a browser cache issue.
All working now.
Thanks.


(Vannak Eng) #69

following your instruction i got this

The following packages have unmet dependencies:
docker-engine : Depends: init-system-helpers (>= 1.18~) but 1.14 is to be installed
Depends: lsb-base (>= 4.1+Debian11ubuntu7) but 4.1+Debian11ubuntu6 is to be installed
Depends: libdevmapper1.02.1 (>= 2:1.02.99) but 2:1.02.77-6ubuntu2 is to be installed
Recommends: aufs-tools but it is not going to be installed
Recommends: cgroupfs-mount but it is not installable or
cgroup-lite but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


(Vannak Eng) #70

Your Docker installation is not using a supported filesystem if we were to proceed you may have a broken install.
aufs is the recommended filesystem you should be using (zfs/btrfs and overlay may work as well)
You can tell what filesystem you are using by running “docker info” and looking at the driver

If you wish to continue anyway using your existing unsupported filesystem
read the source code of launcher and figure out how to bypass this.


(Jesse Perry) #71

I was having the same errors as you in this thread. I messed up things enough that I had to restore from a (thankfully recent) DigitalOcean backup.

However simply doing this (at the top directory, not after you cd /var/discourse) worked for me to update Docker:
https://meta.discourse.org/t/docker-gc-version-mismatch/36382/4?u=jesselperry&source_topic_id=23325

Just run apt-get install lxc-docker there. Do you have a backup you can restart on?


(Zachary Lewis) #72

Went to update my Docker image and had to update my Ubuntu 12.04 kernel (was at 3.8, now 3.13) and my docker (now at 1.9.1).

Launching the app causes the following:

FAILED
--------------------
RuntimeError: cd /var/www/discourse && gem update bundler failed with return #<Process::Status: pid 303 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"web", "cmd"=>["gem update bundler", "chown -R discourse $home"]}
48800a914039a06d73db07578e7ded11b03007da821911040fc067914415b71a
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Any clue as to what’s causing this?

Scrolling up, I see

I, [2015-12-21T21:26:14.018309 #36]  INFO -- : > cd /var/www/discourse && gem update bundler
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Not Found 404 (https://rubygems.global.ssl.fastly.net/specs.4.8.gz)

But that’s the only other error I see.


(Caue Rego) #73

Disclaimer: general feedback here, without reading almost anything on the topic.

My discourse was all up to date, according to dashboard (although /admin/upgrade says there is a new discourse version available, it also says everything else is up to date). Then, after modifying app.yml to include a couple plugins (if you must know, it was Spoiler Alert! and discourse-solved, not that it matters for this post), I had this completely unexpected error:

root@cregox-talk:/var/discourse# ./launcher rebuild app
ERROR: Docker version 1.4.1 not supported, please upgrade to at least 1.6.0, or recommended 1.6.0

All I can say is, at some point between apt-get upgrade docker-engine, going through wget -N https://get.docker.com/ | sh all the sudden rebuild app just worked! I think it was the removing and re-installing lxc-docker with apt-get, but right now I can’t tell for sure (or care).

All I know is it’s now working! :smile:

Here’s the full log for whoever it may worth anything:

root@cregox-talk:/var/discourse# apt-get upgrade docker-engine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
E: Unable to locate package docker-engine
root@cregox-talk:/var/discourse# wget -N https://get.docker.com/ | sh
--2015-12-24 05:34:17--  https://get.docker.com/
Resolving get.docker.com (get.docker.com)... 54.230.100.33, 54.230.100.234, 54.230.100.229, ...
Connecting to get.docker.com (get.docker.com)|54.230.100.33|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12865 (13K) [text/plain]
Saving to: 'index.html'

100%[======================================================================================================================>] 12,865      --.-K/s   in 0s      

2015-12-24 05:34:17 (169 MB/s) - 'index.html' saved [12865/12865]

root@cregox-talk:/var/discourse# ./launcher rebuild app
ERROR: Docker version 1.4.1 not supported, please upgrade to at least 1.6.0, or recommended 1.6.0
root@cregox-talk:/var/discourse# sudo apt-get upgrade docker-engine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
E: Unable to locate package docker-engine
root@cregox-talk:/var/discourse# sudo apt-get remove lxc-docker
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  aufs-tools cgroup-lite lxc-docker-1.4.1
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  lxc-docker
0 upgraded, 0 newly installed, 1 to remove and 183 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 87457 files and directories currently installed.)
Removing lxc-docker (1.4.1) ...
root@cregox-talk:/var/discourse# sudo apt-get upgrade docker-engine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
E: Unable to locate package docker-engine
root@cregox-talk:/var/discourse# sudo apt-get install docker-engine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package docker-engine
root@cregox-talk:/var/discourse# apt-get dist-upgrade docker-engine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
E: Unable to locate package docker-engine
root@cregox-talk:/var/discourse# apt-get install lxc-docker
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  lxc-docker-1.9.1
The following packages will be REMOVED:
  lxc-docker-1.4.1
The following NEW packages will be installed:
  lxc-docker lxc-docker-1.9.1
0 upgraded, 2 newly installed, 1 to remove and 183 not upgraded.
Need to get 8497 kB of archives.
After this operation, 15.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://get.docker.io/ubuntu/ docker/main lxc-docker-1.9.1 amd64 1.9.1 [8495 kB]
Get:2 https://get.docker.io/ubuntu/ docker/main lxc-docker amd64 1.9.1 [2094 B]
Fetched 8497 kB in 1s (7114 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 87455 files and directories currently installed.)
Removing lxc-docker-1.4.1 (1.4.1) ...
docker stop/waiting
Processing triggers for man-db (2.6.7.1-1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package lxc-docker-1.9.1.
(Reading database ... 87404 files and directories currently installed.)
Preparing to unpack .../lxc-docker-1.9.1_1.9.1_amd64.deb ...
Unpacking lxc-docker-1.9.1 (1.9.1) ...
Selecting previously unselected package lxc-docker.
Preparing to unpack .../lxc-docker_1.9.1_amd64.deb ...
Unpacking lxc-docker (1.9.1) ...
Processing triggers for man-db (2.6.7.1-1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up lxc-docker-1.9.1 (1.9.1) ...
Installing new version of config file /etc/init.d/docker ...
Installing new version of config file /etc/init/docker.conf ...
docker start/running, process 1494
Processing triggers for ureadahead (0.100.0-16) ...
Setting up lxc-docker (1.9.1) ...
root@cregox-talk:/var/discourse# git pull
Already up-to-date.
root@cregox-talk:/var/discourse# ./launcher rebuild app
Ensuring discourse docker is up to date
Fetching origin
Discourse Docker is up-to-date
Stopping old container

Now a not-so-important question, since I’m here:

Does anyone think I should bother about those 183 “apps not upgraded”? 80mb for a docker installation that’s not broken anymore seen like it could break something… :fearful:


(Anton) #74

Cannot rebuild app:

./launcher rebuild app
ERROR: Docker version 1.3.1 not supported, please upgrade to at least 1.6.0, or recommended 1.6.0

However, to update Docker, I need:

So, how do I update docker?


(Jeff Atwood) #75

Search for the howto on upgrading Docker, it is not difficult.

Edit: good point @meglio we should have the Docker upgrade instructions in this topic too so I added them by editing the first post.


#76

Thanks for adding those instructions. I did a search on how to upgrade docker and only got posts telling me to search for how to upgrade docker and this discussion, so putting it here is great.

For any idiots like me who have no real idea what any of these commands are actually doing, it’s worth noting that in this line:

apt-get upgrade lxc-docker

That’s a lower-case L, not a number one 1.


(Henrik Johansson) #77

In the replies here i’ve seen several mentions that the data outside the container is not touched (external db). What if there is a breaking db change, is not db:migrate run when rebuilding?


(Kane York) #78

Yes, db:migrate is run, but that doesn’t mean your data is ever actually gone.


(Henrik Johansson) #79

Thats good, I just wanted to know if I should bring down all containers but one when upgrading, that container will then do the database migration and then I can bring other online based on the same image that is created in the rebuild.


(Barry Parr) #80

While running an update, it ended with the following message:

FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c 'bundle exec rake assets:precompile' failed with return #<Process::Status: pid 342 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
09f46f2316c693a190015cf1bdd123a00dc1763cb0e225bd01c471d0cbf9af1f
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
root@coastsider:/var/discourse# 

Looking back in the output, I found this:

I, [2016-01-27T18:56:41.396923 #344]  INFO -- : Writing /var/www/discourse/public/assets/locales/da-cf95f5df1aa2559d3b0eb48868f23f7b.js
rake aborted!
I18n::InvalidLocaleData: can not load translations from /var/www/discourse/plugins/discourse-tagging/config/locales/server.de.yml: #<Psych::SyntaxError: (/var/www/discourse/plugins/discourse-tagging/config/locales/server.de.yml): found character that cannot start any token while scanning for the next token at line 5 column 1>
  (in /var/www/discourse/app/assets/javascripts/locales/de.js.erb)
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n/backend/base.rb:184:in `rescue in load_yml'

What do I do now?


(Dean Taylor) #81

I can confirm that the following commit (9 days ago) to discourse-tagging introduced a yml syntax error (note red mark in diff):

http://yaml-online-parser.appspot.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdiscourse%2Fdiscourse-tagging%2Fmaster%2Fconfig%2Flocales%2Fserver.de.yml


(Sam Saffron) #82

I just merged in a fix by @Falco can you re-test?


(Barry Parr) #83

Just to be clear, should I re-enter these commands?

cd /var/discourse
git pull
./launcher rebuild app

(Dean Taylor) #84

Yes - that should be it :thumbsup:


(Barry Parr) #85

That did the job. I’m back online.


(Justin Pierce) #86

When I tried to rebuild, it says

ERROR: Docker version 1.4.1 not supported, please upgrade to at least 1.6.0, or recommended 1.6.0

So I go to upgrade Docker with apt-get update, but it fails with a bunch of errors like

Err http://security.ubuntu.com utopic-security/main Sources
404 Not Found [IP: 91.189.92.201 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

Anything I can do?

edit: it appears my ubuntu dist is EOL – looking into upgrading that now.

edit2: yep, that was it. followed this guide EOLUpgrades - Community Help Wiki