Recovering from failed/partially applied upgrade

hum… :thinking: that’s weird, I’ve setup a fresh 2.9.0.beta2, commit 5374e587a3,
…and rebuild to 2.9.0.beta3 latest (commit 6555f0c11b) without any issue…

Maybe the issue was somewhere before that?

I’m guessing that manually deleting the extra stuff may be the way to go.

:weary: I have to admit that I don’t fully grasp what’s going on. I’m guessing somehow Nick is missing the db/post_migrate/20220107014925_drop_bookmark_polymorphic_columns.rb because of this commit ?

Was there any output for the drop column commands?

I’ve just tried the commands again and after ./launcher enter app i get this error

Error response from daemon: Container 69b56d9734c3654d0b0e0661ff612c1020781191d3ec1d866e453747df03fcdf is not running

New issue?

Managed to start app with sudo ./launcher enter app

This is my input:

root@discourseSwingrz:~# cd /var/discourse
root@discourseSwingrz:/var/discourse# ./launcher enter app
x86_64 arch detected.
Error response from daemon: Container 69b56d9734c3654d0b0e0661ff612c1020781191d3ec1d866e453747df03fcdf is not running
root@discourseSwingrz:/var/discourse# sudo ./launcher start app
x86_64 arch detected.

starting up existing container
+ /usr/bin/docker start app
app
root@discourseSwingrz:/var/discourse# cd /var/discourse
root@discourseSwingrz:/var/discourse# ./launcher enter app
x86_64 arch detected.
root@discourseSwingrz-app:/var/www/discourse# su - postgres
postgres@discourseSwingrz-app:~$ psql
psql (13.2 (Debian 13.2-1.pgdg100+1))
Type "help" for help.

postgres=# ALTER TABLE bookmarks 
postgres-# DROP COLUMN bookmarkable_id
postgres-# DROP COLUMN bookmarkable_type;
ERROR:  syntax error at or near "DROP"
LINE 3: DROP COLUMN bookmarkable_type;
        ^
postgres=# 

I appreciate all your help with this guys :slight_smile:

Not sure if I’m entering @pfaffman code correctly?

Could you

  • make a backup :sweat_smile:
  • try
ALTER TABLE bookmarks 
DROP COLUMN bookmarkable_id;

like so?

Backup done.
Output file is in: /var/www/discourse/public/backups/default/swingrz-2022-04-03-101750-v20220316150247.tar.gz

root@discourseSwingrz-app:/var/www/discourse# ALTER TABLE bookmarks 
bash: ALTER: command not found
root@discourseSwingrz-app:/var/www/discourse# su - postgres
postgres@discourseSwingrz-app:~$ psql
psql (13.2 (Debian 13.2-1.pgdg100+1))
Type "help" for help.

postgres=# ALTER TABLE bookmarks 
postgres-# DROP COLUMN bookmarkable_id;
ERROR:  relation "bookmarks" does not exist
postgres=# 

Could you edit your app.yml, uncomment the version line (beware of the indentation) to
version: cd7ce52138bed391d5efc56366e7a6517a6079e7
and rebuild

Cant seem to find the version line, Ben ?

 ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

Is this it?

:+1:

so replace #version: tests-passed

With version: cd7ce52138bed391d5efc56366e7a6517a6079e7

Then /var/discourse/launcher rebuild app

Just making sure this is correct before i rebuild

  ## Which Git revision should this container use? (default: tests-passed)
  version: cd7ce52138bed391d5efc56366e7a6517a6079e7

do i have to indent it again?

(beware of the indentation)

Now the code looks like this

## Which Git revision should this container use? (default: tests-passed)
   version: cd7ce52138bed391d5efc56366e7a6517a6079e7

Rebuild?

Nope first one is good

thanks, Ben

Will rebuild now

Should be aligned with the #

## Which Git revision should this container use? (default: tests-passed)
version: cd7ce52138bed391d5efc56366e7a6517a6079e7

Like your first one:

Ben, It worked! :grin:

Thank you so much for your time & effort in assisting me!

(please PM me so i can send you some coffee or beer money)