ERROR: You are running an old version of the Discourse image

Hello, this is my first topic! I am Nelly Eggsy, and I am building a website using Ghost and Discourse.

I usually lurk the forums and read topics in the shadows. If I’m stuck, I search the forums for an answer, and that usually works. However, I am stuck and need help.

After upgrading Discourse via the admin UI, I encounter a message:

You are running an old version of the Discourse image.
Upgrades via the web UI are disabled until you run the latest image.

To do so, log in to your server using SSH and run:

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

I followed the guide on how to upgrade Discourse and Docker image to the latest version using console commands. However, I am unable to successfully upgraded due to an error.

Here is the error message I get when I run the ./launcher rebuild app command.

> --------------------
> Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 671 exit 1>
> Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
> exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
> 9c3a1b4a72818216aaafa5de742f7d1a325aa61497ea49f5b4f1660c6e503fd0
> ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
> ./discourse-doctor may help diagnose the problem.

My Digital Ocean droplet has 2 GB Memory / 50 GB Disk + 50 GB / SFO2 - Discourse on Ubuntu 20.04.

Thank you for taking the time to read my post! I look forward to reading your message.

1 Like

Welcome, @nelly! Sorry you are having trouble! This is a big unexpected. EDIT: That’s a bit unexpected.

Do you have any custom plugins or themes?

Can you please scroll up and paste the actual error messages here?


Thanks, @pfaffman! I appreciate your response. Yes, I have a few custom themes and plugins.

Here are the plugins I have:

      - git clone
      - git clone
      - git clone
      - git clone
      - git clone
      - git clone

I am not sure how to access/delete the custom themes.


Here is what I see right above the “failed” error:

rake aborted!
NameError: undefined local variable or method `name' for main:Object
/var/www/discourse/lib/tasks/assets.rake:251:in `rescue in block (2 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:240:in `block (2 levels) in <main>'

Caused by:
OpenURI::HTTPError: 401 Error: Invalid license key
/var/www/discourse/lib/file_helper.rb:63:in `block in download'
/var/www/discourse/lib/final_destination.rb:422:in `block (3 levels) in safe_get'
/var/www/discourse/lib/final_destination.rb:421:in `catch'
/var/www/discourse/lib/final_destination.rb:421:in `block (2 levels) in safe_get'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/patches/net_patches.rb:19:in `block in request_with_mini_profiler'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/mini_profiler/profiling_methods.rb:46:in `step'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-mini-profiler-2.3.2/lib/patches/net_patches.rb:18:in `request_with_mini_profiler'
/var/www/discourse/lib/final_destination.rb:393:in `block in safe_get'
/var/www/discourse/lib/final_destination.rb:437:in `block in safe_session'
/var/www/discourse/lib/final_destination.rb:434:in `safe_session'
/var/www/discourse/lib/final_destination.rb:385:in `safe_get'
/var/www/discourse/lib/final_destination.rb:134:in `get'
/var/www/discourse/lib/file_helper.rb:55:in `download'
/var/www/discourse/lib/discourse_ip_info.rb:39:in `mmdb_download'
/var/www/discourse/lib/tasks/assets.rake:242:in `block (3 levels) in <main>'
/var/www/discourse/lib/tasks/assets.rake:241:in `each'
/var/www/discourse/lib/tasks/assets.rake:241:in `block (2 levels) in <main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
I, [2021-05-02T20:17:42.823237 #1]  INFO -- : Downloading MaxMindDB...
Compressing Javascript and Generating Source Maps

I hope that helps. Thanks in advance!

1 Like

You’re going to need to scroll up a bit more, I think. That license key message is for Maxmind, and I don’t think that’s the problem.

1 Like


Here is the output. I trimmed a lot of it, so the forum allows me to post it.

2021-05-03 00:32:20.635 UTC [63] postgres@postgres ERROR:  database "discourse" already exists
2021-05-03 00:32:20.635 UTC [63] postgres@postgres STATEMENT:  CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR:  database "discourse" already exists
I, [2021-05-03T00:32:20.639714 #1]  INFO -- : 
I, [2021-05-03T00:32:20.640335 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
2021-05-03 00:32:20.760 UTC [74] postgres@discourse ERROR:  role "discourse" already exists
2021-05-03 00:32:20.760 UTC [74] postgres@discourse STATEMENT:  create user discourse;
ERROR:  role "discourse" already exists

I, [2021-05-03T00:32:21.634456 #1]  INFO -- : File > /etc/service/redis/run  chmod: +x  chown: 
I, [2021-05-03T00:32:21.640838 #1]  INFO -- : File > /etc/service/redis/log/run  chmod: +x  chown: 
I, [2021-05-03T00:32:21.646998 #1]  INFO -- : File > /etc/runit/3.d/10-redis  chmod: +x  chown: 
I, [2021-05-03T00:32:21.648588 #1]  INFO -- : Replacing daemonize yes with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.650175 #1]  INFO -- : Replacing (?-mix:^pidfile.*$) with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.651303 #1]  INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2021-05-03T00:32:21.656597 #1]  INFO -- : 
I, [2021-05-03T00:32:21.657900 #1]  INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.659157 #1]  INFO -- : Replacing (?-mix:^bind .*$) with  in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.660353 #1]  INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.661652 #1]  INFO -- : Replacing (?-mix:^protected-mode yes) with protected-mode no in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.662825 #1]  INFO -- : Replacing # io-threads 4 with io-threads $redis_io_threads in /etc/redis/redis.conf
I, [2021-05-03T00:32:21.663908 #1]  INFO -- : > echo redis installed
I, [2021-05-03T00:32:21.668192 #1]  INFO -- : redis installed
I, [2021-05-03T00:32:21.669144 #1]  INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2021-05-03T00:32:21.679111 #1]  INFO -- : logfile ""
I, [2021-05-03T00:32:21.680077 #1]  INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2021-05-03T00:32:21.683045 #1]  INFO -- : > sleep 10
167:C 03 May 2021 00:32:21.698 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
167:C 03 May 2021 00:32:21.698 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=167, just started
167:C 03 May 2021 00:32:21.699 # Configuration loaded
167:M 03 May 2021 00:32:21.700 * monotonic clock: POSIX clock_gettime
167:M 03 May 2021 00:32:21.702 * Running mode=standalone, port=6379.
167:M 03 May 2021 00:32:21.702 # Server initialized
167:M 03 May 2021 00:32:21.703 # 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.
I, [2021-05-03T00:32:41.096190 #1]  INFO -- : > cd /var/www/discourse && bash -c "touch -a           /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log"
terser '/var/www/discourse/public/assets/_vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js' -m -c -o '/var/www/discourse/public/assets/vendor-892d5a1f7dfb58e3f80950989c67133fd6062344153d17e67db8ba3d126c7a1a.js' --source-map "base='/var/www/discourse/public/assets',root='/assets',url='/assets/'"
#<Thread:0x000055a7feb17780 /var/www/discourse/lib/tasks/assets.rake:239 run> terminated with exception (report_on_exception is true):
/var/www/discourse/lib/tasks/assets.rake:251:in `rescue in block (2 levels) in <main>': undefined local variable or method `name' for main:Object (NameError)
	from /var/www/discourse/lib/tasks/assets.rake:240:in `block (2 levels) in <main>'
/var/www/discourse/lib/file_helper.rb:63:in `block in download': 401 Error: Invalid license key (OpenURI::HTTPError)

I hope it helps!

1 Like

Do you app.yml has a line for the MaxMind license key? Try removing it and rebuilding.


Thanks! That seems to do the trick, sort of. When I visit the forum’s homepage, it takes me to the “Congratulations, you installed Discourse!” page. Here are my questions:

Do I re-install the forum? Will my existing content remain, or did everything get deleted?


It sounds like everything got deleted, but it’s likely still there. Was this your first update in a while? Did your postgres get updated? My best guess is hat something went wrong in the postgres update and you need to rename postgres_old and start over again. There are some details in PostgreSQL 13 update.


Jay, I (just) remember I had attempted to move the uploads and backups to DigitalOcean Block Storage. Moments ago, I attempted to do it again and received the “Oops” error message while visiting the homepage:

The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.

Detailed information about the error was logged, and an automatic notification generated. We’ll take a look at it.

No further action is necessary. However, if the error condition persists, you can provide additional detail, including steps to reproduce the error, by posting a discussion topic in the site’s feedback category.

Here are the commands I made:

mv /var/discourse/shared/standalone/postgres_data /var/postgres_data_discourse
mv /var/discourse/shared /mnt/discourse-sfo2-01

On app.yml I added this:

## The Docker container is stateless; all data is stored in /shared
  - volume:
      host: /mnt/discourse-sfo2-01/shared/standalone
      guest: /shared
  - volume:
      host: /mnt/discourse-sfo2-01/shared/standalone/log/var-log
      guest: /var/log
  - volume:
      host: /var/postgres_data_discourse
      guest: /shared/postgres_data

All commands ran ./launcher rebuild app without incident.

I’m sorry everyone. I had forgotten I had done this. I’m certain this is probably causing the issues.


That worked for me too after a failed rebuild - what’s the issue here? Thanks!