Skip to content

Upgrade to 14.3 fails with 'relation "project_topics" does not exist'

Summary

After upgrading from 14.2 to 14.3, Gitlab starts but reports a 500. In gitlab-rails/production.log this error appears :

ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "project_topics" does not exist
LINE 8:  WHERE a.attrelid = '"project_topics"'::regclass
                            ^
):

lib/gitlab/database/schema_cache_with_renamed_table.rb:25:in `columns'
lib/gitlab/database/schema_cache_with_renamed_table.rb:29:in `columns_hash'
app/controllers/concerns/renders_member_access.rb:14:in `preload_max_member_access_for_collection'
app/controllers/concerns/renders_projects_list.rb:5:in `prepare_projects_for_rendering'
app/controllers/dashboard/projects_controller.rb:79:in `load_projects'
app/controllers/dashboard/projects_controller.rb:57:in `projects'
app/controllers/root_controller.rb:24:in `block in index'
lib/gitlab/gitaly_client.rb:325:in `allow_n_plus_1_calls'
app/controllers/root_controller.rb:23:in `index'
app/controllers/application_controller.rb:485:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:476:in `set_session_storage'
lib/gitlab/i18n.rb:105:in `with_locale'
lib/gitlab/i18n.rb:111:in `with_user_locale'
app/controllers/application_controller.rb:470:in `set_locale'
app/controllers/application_controller.rb:464:in `set_current_context'
lib/gitlab/middleware/speedscope.rb:13:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:21:in `call'
lib/gitlab/middleware/multipart.rb:172:in `call'
lib/gitlab/middleware/read_only/controller.rb:50:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:21:in `call'
config/initializers/fix_local_cache_middleware.rb:11:in `call'
lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:74:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'

Restarting Gitlab does not help.

Also discussed here, with no fix : https://forum.gitlab.com/t/500-error-and-internal-server-error/58918/9

Steps to reproduce

  • Upgrade from 14.2 to 14.3 using yum upgrade
  • Load the Gitlab interface. As soon as you login, the error occurs.

What is the current bug behavior?

See above

What is the expected correct behavior?

Response should be 200 OK and the page should load.

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

sudo gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.21.0 ? ... OK (13.21.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 2/1 ... yes 10/10 ... yes 10/11 ... yes 11/12 ... yes 11/13 ... yes 10/14 ... yes 10/15 ... yes 12/16 ... yes 5/17 ... yes 2/18 ... yes 10/19 ... yes 14/20 ... yes 10/21 ... yes 10/22 ... yes 10/23 ... yes 10/24 ... yes 10/25 ... yes 10/26 ... yes 10/27 ... yes 6/29 ... yes 10/30 ... yes 12/31 ... yes 12/32 ... yes 19/33 ... yes 20/34 ... yes 10/35 ... yes 10/36 ... yes 10/37 ... yes 12/38 ... yes 10/39 ... yes 4/40 ... yes 10/43 ... yes 41/44 ... yes 41/45 ... yes 41/46 ... yes 41/47 ... yes 41/48 ... yes 46/49 ... yes 41/50 ... yes 41/51 ... yes 41/52 ... yes 12/53 ... yes 50/54 ... yes 41/56 ... yes 46/57 ... yes 12/58 ... yes 41/59 ... yes 14/60 ... yes 41/61 ... yes 41/62 ... yes 12/63 ... yes 12/64 ... yes 41/66 ... yes 41/67 ... yes Redis version >= 5.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.4) Git version >= 2.31.0 ? ... yes (2.33.0) Git user has default SSH configuration? ... yes Active users: ... 12 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Edited by 🤖 GitLab Bot 🤖