Error upgrading, failed to bootstrap

Hi there! I have a problem in last update:

FAILED -------------------- Pups::ExecError: cd /var/www/discourse && su discourse -c ‘bundle exec rake db:migrate’ failed with return #<Process::Status: pid 690 exit 1> Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn’
exec failed with the params {“cd”=>"$home", “hook”=>“db_migrate”, “cmd”=>[“su discourse -c ‘bundle exec rake db:migrate’”]}
7027ff0ccd166f831f9728472676ad91704fdd4caa6833a219d44697e740acdc ** 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.

Sideqik stopped too.

Can someone help me? Thanks!!

P.s. site is llastres.com

2 Likes

Can you please do as the message says and

We need the whole log in order to troubleshoot.

3 Likes

Ok, how can I identify them? Searching for the word “error”? If you tell me how to run the log, I will attach it. I am new to using servers. Thank you very much for your help.

Edit, I found this:

Caused by:                                              
PG::DuplicateTable: ERROR:  relation "discourse_reactions_reactions" already exists
2 Likes

Can you share your app.yml file?

3 Likes

Sorry, I was at work. This is my app.yml:

## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
  - "80:80"   # http
  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.spanish"

  ## Set db_shared_buffers to a max of 25% of the total memory.
  ## will be set automatically by bootstrap based on detected RAM, or you can override
  db_shared_buffers: "2048MB"

  ## can improve sorting performance, but adds memory usage per-connection
  #db_work_mem: "40MB"

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

env:
  LC_ALL: es_ES.UTF-8
  LANG: es_ES.UTF-8
  LANGUAGE: es_ES.UTF-8
  DISCOURSE_DEFAULT_LOCALE: es

  ## How many concurrent web requests are supported? Depends on memory and CPU cores.
  ## will be set automatically by bootstrap based on detected CPUs, or you can override
  UNICORN_WORKERS: 8

  ## TODO: The domain name this Discourse instance will respond to
  ## Required. Discourse will not work with a bare IP number.
  DISCOURSE_HOSTNAME: EDITED

  ## Uncomment if you want the container to be started with the same
  ## hostname (-h option) as specified above (default "$hostname-$config")
  #DOCKER_USE_HOSTNAME: true

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example 'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: 'EDITED'

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!
  DISCOURSE_SMTP_ADDRESS: EDITED
  DISCOURSE_SMTP_PORT: EDITED
  DISCOURSE_SMTP_USER_NAME: EDITED
  DISCOURSE_SMTP_PASSWORD: EDITED
  DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
  DISCOURSE_SMTP_DOMAIN: EDITED
  DISCOURSE_NOTIFICATION_EMAIL: EDITED

  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
  LETSENCRYPT_ACCOUNT_EMAIL: EDITED

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

  ## The maxmind geolocation IP address key for IP address lookup
  ## see https://meta.discourse.org/t/-/137387/23 for details
  DISCOURSE_MAXMIND_LICENSE_KEY: EDITED

## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-reactions
## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec: echo "End of custom commands"
1 Like

The truth is that I have never had any problem updating. I wasn’t doing anything weird, I just updated the system and I got the warning that an error had occurred.

This is the whole log:

1 Like

It’s having trouble running a migration from May 2021. Was this site moved between the release channels (beta/stable/tests-passed) or restored from backup at some point?

1 Like

I seem to remember that we migrated from mybb on that date (may 21)

Yes it is true that today I tried to recover a backup from the beginning of the month to try to have a working copy before the error, but when I clicked on start, an error screen appeared.

Sorry if my writing is strange, I’m using a translator.

2 Likes

I still can’t find a solution and the forums are still down, any idea where to go from here? Thanks!!

2 Likes

I had my forum go down after the upgrade. The update seems to go okay, but when I went to the forum page the forum page was blank.

I updated it manually, and the forum was okay. Don’t know if this will help you or not.

2 Likes

Thank you for your reply. I think my problem is related to a database error related to the migration of the forums. Rebuild app doesnt work.

I have checked the FAQ and the manuals, but I can’t find any solution.

I have some backups before (I think) the error, but I can’t load them because the app won’t run. I can only think of deleting everything, doing a clean install and loading a backup…

1 Like

Having a backup, and considering that I can’t run the app (to restore the backup), what can I do? I see no alternative but to delete the Docker and start again?

1 Like

The only topic I could find with a similar problem was Unable to login into discourse suddenly - #8 by Tarek_Khalil, and the advice was to restore a backup from before the migration snafu, which may not be the best option in your case as it was some time ago.

I’m afraid database errors are out of my skillset. @pfaffman and @RGJ are normally very good at these (though I don’t know if this is something they’ve come across before). Do you guys have any tricks up your sleeve for this?

2 Likes

What you want to do is to get into postgres and drop that table.

In broad strokes, it’s something like

./launcher enter app 
sudo postgres
psql 
drop table the_table _mentioned above ;

And then you should be able to run the upgrade.

Edit: but hopefully you make a database-only backup first just in case!

4 Likes

I apologize, I am new to using Linux servers and commands. The app was not running, so I do:

./launcher start app
x86_64 arch detected.                                                                                           starting up existing container                          
+ /usr/bin/docker start app
app

After that:

./launcher enter app

And then, following your indications, first error:

sudo postgres            
sudo: postgres: command not found

If I type psql:

psql: error: FATAL: database "root" does not exist

Sorry. I’m on my phone and not quite thinking well enough to explain…

After the start app

su - postgres 
psql discourse 

And then the

 drop table discourse_reactions_reactions ;

And then type exit or control-d a few times to get out of everything

You’re welcome! When I empty a table, another one gives me an error. I have already emptied about 3 tables… Should I keep doing this one by one? Thank you very much for your help.

Hmm. I do hope you have a backup. But maybe? It doesn’t make sense that the migrations would be so out of whack.

1 Like

I answer myself. After emptying 7 tables (discourse_reactions_reactions, directory_columns, external_upload_stubs, associated_groups, user_associated_groups, group_associated_groups, discourse_reactions_reaction_users) the site is up and running. I restore the last backup too!

Thank you all for your help! Have a nice weekend :slight_smile:

2 Likes

But we’re you able to upgrade to the latest version?

1 Like