Column personal_access_tokens.token does not exist, causing 500 error while cloning over HTTPS
Summary
I'm getting 500 HTTP error while cloning repository over HTTPS, due to an authentication error I think. What I found is that the column column personal_access_tokens.token does not exist and I don't know how to fix this. The fact is that I've downgraded my instance from Gitlab 11.9.1 to Gitlab 11.7.10 because I cannot use Gitlab pages on the upper versions as I described in my last issue which didn't get any support.
Steps to reproduce
(How one can reproduce the issue - this is very important)
What is the current bug behavior?
I'm getting 500 HTTP error while cloning repository over HTTPS.
What is the expected correct behavior?
I should be able to clone my repository without any problem
Relevant logs and/or screenshots
==> /var/log/gitlab/gitlab-rails/production.log <==
Processing by RootController#index as */*
Redirected to https://git.nowtryz.net/explore/groups
Filter chain halted as :redirect_unlogged_user rendered or redirected
Completed 302 Found in 7ms (ActiveRecord: 0.0ms)
Started GET "/cafet-app/java-client.git/info/refs?service=git-upload-pack" for 90.127.163.26 at 2019-04-02 21:06:17 +0000
Processing by Projects::GitHttpController#info_refs as */*
Parameters: {"service"=>"git-upload-pack", "namespace_id"=>"cafet-app", "project_id"=>"java-client.git"}
Completed 500 Internal Server Error in 90ms (ActiveRecord: 9.6ms)
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column personal_access_tokens.token does not exist
LINE 1: ... (expires_at >= NOW() OR expires_at IS NULL)) AND "personal_...
^
: SELECT "personal_access_tokens".* FROM "personal_access_tokens" WHERE (revoked = false AND (expires_at >= NOW() OR expires_at IS NULL)) AND "personal_access_tokens"."token" = '*************' LIMIT 1):
app/models/concerns/token_authenticatable_strategies/insecure.rb:6:in `find_token_authenticatable'
app/models/concerns/token_authenticatable_strategies/digest.rb:11:in `find_token_authenticatable'
app/models/concerns/token_authenticatable.rb:25:in `block in add_authentication_token_field'
lib/gitlab/metrics/instrumentation.rb:161:in `block in find_by_token'
lib/gitlab/metrics/method_call.rb:36:in `measure'
lib/gitlab/metrics/instrumentation.rb:161:in `find_by_token'
app/finders/personal_access_tokens_finder.rb:6:in `find_by_token'
lib/gitlab/metrics/instrumentation.rb:161:in `block in find_by_token'
lib/gitlab/metrics/method_call.rb:36:in `measure'
lib/gitlab/metrics/instrumentation.rb:161:in `find_by_token'
lib/gitlab/auth.rb:157:in `personal_access_token_check'
lib/gitlab/auth.rb:34:in `find_for_git_client'
app/controllers/projects/git_http_client_controller.rb:102:in `handle_basic_authentication'
app/controllers/projects/git_http_client_controller.rb:38:in `authenticate_user'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:417:in `set_locale'
lib/gitlab/middleware/rails_queue_duration.rb:24:in `call'
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
lib/gitlab/metrics/transaction.rb:55:in `run'
lib/gitlab/metrics/rack_middleware.rb:17:in `call'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/correlation_id.rb:15:in `use_id'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:40:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'
Output of checks
Results of GitLab environment info
I use the Gitlab docker image
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.3 Go Version: unknownGitLab information Version: 11.7.7 Revision: 9d826ae Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://git.nowtryz.net HTTP Clone URL: https://git.nowtryz.net/some-group/some-project.git SSH Clone URL: git@git.nowtryz.net:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 8.4.4 Repository storage paths: -default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: 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 ... 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: ... 34/1 ... yes 34/2 ... yes 34/3 ... yes 34/4 ... yes 34/5 ... yes 36/7 ... yes 36/8 ... yes 37/9 ... yes 37/10 ... yes 39/11 ... yes 39/12 ... yes 39/14 ... yes 1/15 ... yes 40/16 ... yes 1/17 ... yes 1/18 ... yes 1/19 ... yes 38/20 ... yes 1/21 ... yes 49/23 ... yes 49/24 ... yes 34/25 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 9
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
I still don't have any ideas to fix this