Postgres قديم على Docker Image مع حاويتين: web و data

مرحبًا بالجميع،

أنا عالق في محاولة ترقية نسخة Discourse تعمل عبر Docker. أحصل على الخطأ التالي عند محاولة إعادة البناء أو التمهيد أو إعداد الحاوية بأي طريقة أخرى:

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
                      ^

من خلال التحقيق، يبدو أن PostgreSQL 12 مطلوب لأحدث إصدار من Discourse، لكن هذا غير مُضمَّن حاليًا في صورة Docker الرسمية.

يبدو أن هناك فرعًا للتطوير في المستودع خاص بـ بناء الحاوية مع PostgreSQL 12، لكن لا توجد طلبات دمج مفتوحة أو أي شيء آخر…

كيف يمكنني إصلاح/تحديث تثبيت Discourse الخاص بي؟ مسار التحديث غير صحيح، والآن أنا أبذل قصارى جهدي لإعادة رفع المنتديات في أسرع وقت ممكن!

إعجابَين (2)

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…

That is not the case. The base image for Discourse ships with PostgreSQL for many months already, since PostgreSQL 12 update.

Can you share you app.yml? Maybe you forced an old base image in it and forgout about it?

إعجابَين (2)

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.

The latest base image should be:

image="discourse/base:2.0.20201004-2310"

What do you get if you run

docker images | grep discourse/base

Also that plugin was deprecated 3 years ago :scream:

إعجابَين (2)

Strange, I’m on the latest commit:

$ git branch -v
* master 4a4b0f8 DOCS: correct syntax error in readme

And I seem to have the latest image:

$ 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

Also that plugin was deprecated 3 years ago :scream:

:see_no_evil: that’s next on my list to bring up-to-date but have been stuck with current update!

Oh you are using the advanced data setup?

You need to stop web and rebuild data to get all data software updated. There is a section for that in PostgreSQL 12 update

8 إعجابات

Thanks for your help, rebuilding the data container now…

Okay that seems to have done it, thanks again all!

This is the sort of burn to be expected from inheriting a discourse installation and doing an upgrade for the first time :sweat_smile:

4 إعجابات

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.