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…

1 Like

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:

1 Like

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

Could you

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

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=# 
1 Like

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 ?

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

Is this it?

1 Like

:+1:

so replace #version: tests-passed

With version: cd7ce52138bed391d5efc56366e7a6517a6079e7

Then /var/discourse/launcher rebuild app

1 Like

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?

1 Like

Nope first one is good

thanks, Ben

Will rebuild now

Should be aligned with the #

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

Like your first one:

1 Like

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)

2 Likes