Errors updating old beta Discourse docker install to latest


(Hecbuma) #1

HI, I’m trying to bootstrap my already running discourse docker, I wanna do this 'cause it’s out to date, I try to update it from the docker manager, but it’s not working.

this is my output

$ ./launcher bootstrap app
Calculated ENV: -e HOME=/root -e RAILS_ENV=production -e UNICORN_WORKERS=3 -e RUBY_GC_MALLOC_LIMIT=40000000 -e RUBY_HEAP_MIN_SLOTS=800000 -e 
From https://github.com/SamSaffron/pups
   526de62..f7a125b  master     -> origin/master
Updating 526de62..f7a125b
Fast-forward
 lib/pups/cli.rb              |    3 +-
 lib/pups/command.rb          |    5 ++-
 lib/pups/config.rb           |   14 +++-----
 lib/pups/exec_command.rb     |    4 +--
 lib/pups/file_command.rb     |   19 ++++-------
 lib/pups/merge_command.rb    |    3 ++
 lib/pups/replace_command.rb  |   15 +++++---
 test/config_test.rb          |    6 ++++
 test/file_command_test.rb    |   11 ------
 test/merge_command_test.rb   |   11 ++++++
 test/replace_command_test.rb |   77 +++++++++++++++++++++++++++++++++---------
 11 files changed, 111 insertions(+), 57 deletions(-)
I, [2014-08-20T14:12:58.632895 #37]  INFO -- : Loading --stdin
I, [2014-08-20T14:12:58.654503 #37]  INFO -- : File > /etc/service/cron/run  chmod: +x
I, [2014-08-20T14:12:58.664142 #37]  INFO -- : File > /etc/service/rsyslog/run  chmod: +x
I, [2014-08-20T14:12:58.664993 #37]  INFO -- : > echo cron installed
I, [2014-08-20T14:12:58.669483 #37]  INFO -- : cron installed

I, [2014-08-20T14:12:58.679202 #37]  INFO -- : File > /var/lib/postgresql/take-database-backup  chmod: +x
I, [2014-08-20T14:12:58.685068 #37]  INFO -- : File > /var/spool/cron/crontabs/postgres  chmod:
I, [2014-08-20T14:12:58.685906 #37]  INFO -- : > apt-get install -y socat
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/s/socat/socat_1.7.1.3-1.4ubuntu1_amd64.deb  404  Not Found [IP: 91.189.91.15 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I, [2014-08-20T14:13:00.905641 #37]  INFO -- : Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  socat
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 368 kB of archives.
After this operation, 900 kB of additional disk space will be used.
Err http://archive.ubuntu.com/ubuntu/ quantal/universe socat amd64 1.7.1.3-1.4ubuntu1
  404  Not Found [IP: 91.189.91.15 80]

/pups/lib/pups/exec_command.rb:85:in `spawn': apt-get install -y socat failed with return #<Process::Status: pid 47 exit 100> (RuntimeError)
	from /pups/lib/pups/exec_command.rb:55:in `block in run'
	from /pups/lib/pups/exec_command.rb:53:in `each'
	from /pups/lib/pups/exec_command.rb:53:in `run'
	from /pups/lib/pups/command.rb:5:in `run'
	from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
	from /pups/lib/pups/config.rb:76:in `each'
	from /pups/lib/pups/config.rb:76:in `block in run_commands'
	from /pups/lib/pups/config.rb:75:in `each'
	from /pups/lib/pups/config.rb:75:in `run_commands'
	from /pups/lib/pups/config.rb:71:in `run'
	from /pups/lib/pups/cli.rb:31:in `run'
	from /pups/bin/pups:8:in `<main>'
8176d88c15b522f2acf618afbbd22d5e93b1c02ec0360c82c29959e723efbc53

(Homebrew Hops) #2

Is there supposed to be a space between ‘/’ and quantal? You’re getting a 404 not found.


(Michael Brown) #3

That package is no longer in the repository - hence the error. Oops - we should be running apt-get update before any install call to avoid this situation (stale repo indexes).

If you edit postgres.template.yml and add an apt-get update command as follows:

# temporary
 - exec: apt-get update       <----- this line
 - exec: apt-get install -y socat

and rebuild, you should be up and running again soon.


(Hecbuma) #4

Ok good catch, but how can i edit this?


(Tomosovich) #5

You would need to open the postgres.template.yml file using nano or whatever you like and then add the information above.


(Hecbuma) #6

Well, I think this is a bigger problem I cannot run the apt-get update as well. I read this Update on Ubuntu 12.10 server failing (Not Found) | DigitalOcean and looks like ubuntu is not given support anymore. any ideas?

BTW thank you for the quick response.

$ ./launcher bootstrap app
Calculated ENV: -e HOME=/root -e RAILS_ENV=production -e UNICORN_WORKERS=3 -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 
From https://github.com/SamSaffron/pups
   526de62..f7a125b  master     -> origin/master
Updating 526de62..f7a125b
Fast-forward
 lib/pups/cli.rb              |    3 +-
 lib/pups/command.rb          |    5 ++-
 lib/pups/config.rb           |   14 +++-----
 lib/pups/exec_command.rb     |    4 +--
 lib/pups/file_command.rb     |   19 ++++-------
 lib/pups/merge_command.rb    |    3 ++
 lib/pups/replace_command.rb  |   15 +++++---
 test/config_test.rb          |    6 ++++
 test/file_command_test.rb    |   11 ------
 test/merge_command_test.rb   |   11 ++++++
 test/replace_command_test.rb |   77 +++++++++++++++++++++++++++++++++---------
 11 files changed, 111 insertions(+), 57 deletions(-)
I, [2014-08-20T17:50:23.759162 #37]  INFO -- : Loading --stdin
I, [2014-08-20T17:50:23.782297 #37]  INFO -- : File > /etc/service/cron/run  chmod: +x
I, [2014-08-20T17:50:23.793091 #37]  INFO -- : File > /etc/service/rsyslog/run  chmod: +x
I, [2014-08-20T17:50:23.794234 #37]  INFO -- : > echo cron installed
I, [2014-08-20T17:50:23.798813 #37]  INFO -- : cron installed

I, [2014-08-20T17:50:23.809823 #37]  INFO -- : File > /var/lib/postgresql/take-database-backup  chmod: +x
I, [2014-08-20T17:50:23.816388 #37]  INFO -- : File > /var/spool/cron/crontabs/postgres  chmod:
I, [2014-08-20T17:50:23.817603 #37]  INFO -- : > apt-get update
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal/main/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal/multiverse/binary-amd64/Packages  404  Not Found [IP: 91.189.88.149 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
I, [2014-08-20T17:50:26.983423 #37]  INFO -- : Ign http://ppa.launchpad.net quantal InRelease
Ign http://archive.ubuntu.com quantal InRelease
Ign http://ppa.launchpad.net quantal InRelease
Ign http://archive.ubuntu.com quantal Release.gpg
Ign http://archive.ubuntu.com quantal Release
Ign http://ppa.launchpad.net quantal InRelease
Ign http://archive.ubuntu.com quantal/main amd64 Packages/DiffIndex
Get:1 http://ppa.launchpad.net quantal Release.gpg [316 B]
Ign http://archive.ubuntu.com quantal/universe amd64 Packages/DiffIndex
Get:2 http://ppa.launchpad.net quantal Release.gpg [316 B]
Ign http://archive.ubuntu.com quantal/multiverse amd64 Packages/DiffIndex
Get:3 http://ppa.launchpad.net quantal Release.gpg [316 B]
Get:4 http://ppa.launchpad.net quantal Release [11.9 kB]
Get:5 http://ppa.launchpad.net quantal Release [11.9 kB]
Get:6 http://ppa.launchpad.net quantal Release [11.8 kB]
Get:7 http://ppa.launchpad.net quantal/main Sources [1574 B]
Get:8 http://ppa.launchpad.net quantal/main amd64 Packages [4479 B]
Get:9 http://ppa.launchpad.net quantal/main Sources [14 B]
Get:10 http://ppa.launchpad.net quantal/main amd64 Packages [14 B]
Get:11 http://ppa.launchpad.net quantal/main Sources [718 B]
Get:12 http://ppa.launchpad.net quantal/main amd64 Packages [876 B]
Ign http://archive.ubuntu.com quantal/main Translation-en
Ign http://archive.ubuntu.com quantal/multiverse Translation-en
Ign http://ppa.launchpad.net quantal/main Translation-en
Ign http://archive.ubuntu.com quantal/universe Translation-en
Ign http://ppa.launchpad.net quantal/main Translation-en
Ign http://ppa.launchpad.net quantal/main Translation-en
Err http://archive.ubuntu.com quantal/main amd64 Packages
  404  Not Found [IP: 91.189.88.149 80]
Err http://archive.ubuntu.com quantal/universe amd64 Packages
  404  Not Found [IP: 91.189.88.149 80]
Err http://archive.ubuntu.com quantal/multiverse amd64 Packages
  404  Not Found [IP: 91.189.88.149 80]
Fetched 44.2 kB in 3s (14.1 kB/s)

/pups/lib/pups/exec_command.rb:85:in `spawn': apt-get update failed with return #<Process::Status: pid 47 exit 100> (RuntimeError)
	from /pups/lib/pups/exec_command.rb:55:in `block in run'
	from /pups/lib/pups/exec_command.rb:53:in `each'
	from /pups/lib/pups/exec_command.rb:53:in `run'
	from /pups/lib/pups/command.rb:5:in `run'
	from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
	from /pups/lib/pups/config.rb:76:in `each'
	from /pups/lib/pups/config.rb:76:in `block in run_commands'
	from /pups/lib/pups/config.rb:75:in `each'
	from /pups/lib/pups/config.rb:75:in `run_commands'
	from /pups/lib/pups/config.rb:71:in `run'
	from /pups/lib/pups/cli.rb:31:in `run'
	from /pups/bin/pups:8:in `<main>'
baf1ace75c62b47a3aa8c352df9918c293ca6e36347bce3ec6ed7067b1fc7ac7
d719fa5e880ede8a47e65d96417e4839d66b223b2770f192c53e7dafec2e44ab

(Michael Brown) #7

Have you updated discourse_docker? You’re probably running from very old templates that reference 12.10.


(Hecbuma) #8

Ok how can I update it, I tried via the docker_manager, but it’s not working, probably for the same reason. how is the process to update discourse_docker from the CLI ? I looked for doc but I couldn’t find anything.


(Michael Brown) #9

discourse_docker is the part that lives outside the container - sorry.

Run: cd /var/docker; git pull


(Hecbuma) #10

ok, one last questions, I did the putl and before doing the ./launcher bootstrap app, I wanna know if there any chances of losing any data, and if I lost data is there any restore mechanisms ?


(Kane York) #11

Nope - there shouldn’t be. The data is all in /var/docker/shared - outside the container.


(Michael Brown) #12

But as always before doing maintenance, ensure you have a current backup of your data before proceeding!


(Kane York) #13

Yeah - I would have suggested taking a backup from the admin panel, but it seems the site is down.


(Hecbuma) #14

damm thing, I did the backup but know I still cannot bootstrap or rebuild

$ ./launcher rebuild app
WARNING: No swap limit support
flag provided but not defined: -version
Usage of /usr/bin/docker:
  -D=false: Enable debug mode
  -H=[]: Multiple tcp://host:port or unix://path/to/socket to bind in daemon mode, single connection otherwise
  -api-enable-cors=false: Enable CORS headers in the remote API
  -b="": Attach containers to a pre-existing network bridge; use 'none' to disable container networking
  -bip="": Use this CIDR notation address for the network bridge's IP, not compatible with -b
  -d=false: Enable daemon mode
  -dns=[]: Force docker to use specific DNS servers
  -g="/var/lib/docker": Path to use as the root of the docker runtime
  -icc=true: Enable inter-container communication
  -ip="0.0.0.0": Default IP address to use when binding container ports
  -iptables=true: Disable docker's addition of iptables rules
  -mtu=1500: Set the containers network mtu
  -p="/var/run/docker.pid": Path to use for daemon PID file
  -r=true: Restart previously running containers
  -s="": Force the docker runtime to use a specific storage driver
  -v=false: Print version information and quit
ERROR: Docker version  not supported, please upgrade to at least 0.9.1, or recommended 0.11.1

(Régis Hanol) #15

What version of docker are you running?


(Hecbuma) #16

I was runnig a outdated docker version, I update it and works… well not totally now looks worst

this is on rebuild also occurs at bootstrap

I, [2014-08-20T23:41:20.835259 #38]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake db:migrate
rake aborted!
PG::Error: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

(Sam Saffron) #17

its unable to talk to sql, are you sure you are using the standalone template and not the web only one?


(Hecbuma) #18

a’right my bad my the postgres template was after the other ones in the container/app.yml

this is where I am now, I tried what i says, but doesn’t work neither, when I try to bootstrap with base_image: "samsaffron/discourse:0.1.1" I’m having the ubuntu dist error agaon

UPGRADE OF POSTGRES FAILED

You are going to need to export your data and import into a clean instance:

Add the line: base_image: "samsaffron/discourse:0.1.1"
Change: templates/postgres.template.yml TO templates/postgres.9.2.template.yml

Run ./launcher bootstrap again

When your instance is running:
- Go to the admin UI, enable readonly and backup your site

Then destroy your container ./launcher destroy standalone
Undo the base_image and postgres.9.2 template from your container config
Run: sudo mv /var/docker/shared/postgres_data /var/shared/postgres_data_old
Run: ./launcher bootstrap

Login to the blank site, and import your backup (remember to set the allow_restore site setting)
Restart your container: ./launcher restart
-------------------------------------------------------------------------------------

/pups/lib/pups/exec_command.rb:85:in `spawn': /root/upgrade_postgres failed with return #<Process::Status: pid 64 exit 1> (RuntimeError)
	from /pups/lib/pups/exec_command.rb:55:in `block in run'
	from /pups/lib/pups/exec_command.rb:53:in `each'
	from /pups/lib/pups/exec_command.rb:53:in `run'
	from /pups/lib/pups/command.rb:5:in `run'
	from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
	from /pups/lib/pups/config.rb:76:in `each'
	from /pups/lib/pups/config.rb:76:in `block in run_commands'
	from /pups/lib/pups/config.rb:75:in `each'
	from /pups/lib/pups/config.rb:75:in `run_commands'
	from /pups/lib/pups/config.rb:71:in `run'
	from /pups/lib/pups/cli.rb:31:in `run'
	from /pups/bin/pups:8:in `<main>'
85f9b4b7bbbc3b054a4c2bcce19d84ffeff8f86dfec5dbdc34a85df80016b572
FAILED TO BOOTSTRAP

(Hecbuma) #19

ok so this is bad the container is gone the db is gone, I cannot start discourse from base_image: "samsaffron/discourse:0.1.1" with postgres.9.2, because the ubuntu issue.

So I have the postgres_data and I should be able to start a postgres server with this files, in theory right? so how can I update this samsaffron/discourse:0.1 to make it able to run, basically is a matter of update the etc/apt/source.list removing quantal


(Hecbuma) #20

ok emergency solved, we ended calling a postgressql support firm, they give a correct db dump, then we load this dump in a new db, then we replace the discourse db with this new one, then I edit the db:migrate task to avoid the seeding and done

Thank you all