Failure when trying to install older version of discourse

(Henti Smith) #1

Good day,

We use discourse on one of our sites and I’ve been tasked with setting up a dev version so we can test changes and upgrades before taking them live.

My plan was to install the current version of discourse on a dev server and restore from a backup.

Looking at the page source, I found the current live version is “Discourse 1.6.0.beta11”

Using as a guide I installed debian stretch on VM on our internal cluster and docker from Index of /repo/

sudo -s
mkdir /var/discourse
git clone discourse_docker.git /var/discourse
cd /var/discourse
git checkout 0cc8a82249c86532a9f4333a0f2715e9e3c68b2d

The last checkout is to match the production setup. Production is running image based off 1.3.5
Running with latest master attempts to pulls the latest image (1.3.10), but fails with boot strap fails with

(<unknown>): did not find expected key while parsing a block mapping at line 40 column 3 -e LANG=en_US.UTF-8
YAML syntax error. Please check your containers/*.yml config files.

According to How do you install an earlier version of Discourse? I need to put the version number in app.yml.

cp samples/standalone.yml samples/standalone.yml.original
sed -i 's/^  #version: tests-passed/  version: v1.6.0.beta11/g' samples/standalone.yml

This fails with :

= Seed from /var/www/discourse/db/fixtures/009_users.rb
 - User {:id=>-1, :name=>"system", :username=>"system", :username_lower=>"system", :email=>"no_email", :password=>"<Large_string_goes_here>", :active=>true, :admin=>true, :moderator=>true, :approved=>true, :trust_level=>4}

I, [2017-04-27T14:45:19.423385 #18]  INFO -- : Terminating async processes
I, [2017-04-27T14:45:19.423465 #18]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main pid: 47
2017-04-27 14:45:19 UTC [47-2] LOG:  received fast shutdown request
2017-04-27 14:45:19 UTC [47-3] LOG:  aborting any active transactions
2017-04-27 14:45:19 UTC [54-2] LOG:  autovacuum launcher shutting down
I, [2017-04-27T14:45:19.425013 #18]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 160
160:signal-handler (1493304319) Received SIGTERM scheduling shutdown...
2017-04-27 14:45:19 UTC [51-1] LOG:  shutting down
160:M 27 Apr 14:45:19.465 # User requested shutdown...
160:M 27 Apr 14:45:19.465 * Saving the final RDB snapshot before exiting.
160:M 27 Apr 14:45:19.514 * DB saved on disk
160:M 27 Apr 14:45:19.514 # Redis is now ready to exit, bye bye...
2017-04-27 14:45:19 UTC [51-2] LOG:  database system is shut down

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 400 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108: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'"]}
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Please can you assist in how to get the installation working with v1.6.0.beta11 alternatively, how do I create an exactly, easily replicable development environment from our current production.


Creating a duplicate of production environment
(Joshua Rosenfeld) #2

I’d first try fixing that. The correct copy is LANG: en_US.UTF-8 (colon, not equals).

(Henti Smith) #3

Hi Joshua,

The second error when running with master, likely breaks due to the version of yml from 1.3.5 still being present. I will confirm when I’m back at the office.


(Rafael dos Santos Silva) #4

If you want to

I would recommend using a local dev environment (follow the guide, clone discourse, checkout your tag/commit).

(Henti Smith) #5

I have confirmed.

root@web-docker-dev-01:/srv/discourse# sed '40!d' samples/standalone.yml 
  LANG: en_US.UTF-8

The yml contains the correct formatting.

(Henti Smith) #6

Good morning Rafael.

Thank you for the link, but I think you misunderstand.

I’m not looking to build a general development environment for discourse. I want to create an exact copy of our current production instance for development purposes.

We do not want to make changes to our production environment directly, and need a place to test all changes before making them live on production.

Hence, trying to replicate the exact deployment of our current production versions in a new instance.

(Henti Smith) #7

For future notes.

When a launch fails, and you want to clean up before running ./launch again, remove both the docker images as well as the /var/discourse directory where the shared data is kept.