A user, stuts, encountered an error when trying to upgrade their Discourse instance. The error indicated a PostgreSQL version issue, suggesting that PostgreSQL 12 is required for the latest Discourse version. However, Falco corrected this, stating that the base image for Discourse has shipped with PostgreSQL 12 for months.
Falco suggested that stuts may have forced an old base image in their app.yml file. simonk recommended checking the discourse_docker checkout and running git pull to ensure the latest version.
stuts confirmed they were using the latest commit and image, but were still experiencing issues. Falco then pointed out that stuts was using an advanced data setup, which required stopping the web container and rebuilding the data container to update the data software.
stuts rebuilt the data container and was able to resolve the issue, thanking the community for their help.
I’m stuck trying to upgrade a docker Discourse instance. I get the following error when I attempt to rebuild, bootstrap or in any other way setup the container:
I, [2020-11-18T15:23:37.357104 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake plugin:pull_compatible_all'
I, [2020-11-18T15:23:40.298932 #1] INFO -- : discourse-slack-official is already at latest compatible version
docker_manager is already at latest compatible version
I, [2020-11-18T15:23:40.299193 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
PG::SyntaxError: ERROR: syntax error at or near "NOT"
LINE 2: ADD COLUMN IF NOT EXISTS image_upload_id bigint
^
Additional note: the pg12 branch also doesn’t work (even though it does seem to try and download a different container version), still getting the same error on db:migrate…
How old is your discourse_docker checkout? I know the launcher script is meant to update itself automatically, but iIt might be worth running git pull by hand just to be sure.
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
discourse/base 2.0.20201004-2310 b64c37d7ab06 6 weeks ago 2.4GB
local_discourse/data latest 253fd4d68068 3 years ago 1.7GB
I’ve been sure to clear up old docker images and have attempted a rebuild of the web app multiple times.
Ahhh, do I need to rebuild the data container first or something? Haven’t touched it yet