[16.5] TypeError (can't cast Class) in connection_proxy.rb when accessing repositories
Summary
Accessing repositories in the web UI and pulling/pushing via git client is not possible. Other web UI features like admin area etc are working. Clicking on a project causes an error 500.
Steps to reproduce
Open web UI and click on any project.
What is the current bug behavior?
Error 500
What is the expected correct behavior?
No error.
Relevant logs and/or screenshots
production.log show this error:
TypeError (can't cast Class):
lib/gitlab/database/load_balancing/connection_proxy.rb:111:in `public_send'
lib/gitlab/database/load_balancing/connection_proxy.rb:111:in `block in read_using_load_balancer'
lib/gitlab/database/load_balancing/load_balancer.rb:63:in `read'
lib/gitlab/database/load_balancing/connection_proxy.rb:110:in `read_using_load_balancer'
lib/gitlab/database/load_balancing/connection_proxy.rb:48:in `select_all'
app/models/concerns/routable.rb:34:in `find_by_full_path'
app/models/concerns/routable.rb:76:in `find_by_full_path'
lib/gitlab/repo_path.rb:69:in `find_project'
lib/gitlab/repo_path.rb:62:in `find_container'
lib/gitlab/repo_path.rb:28:in `block in parse'
lib/gitlab/repo_path.rb:19:in `each'
lib/gitlab/repo_path.rb:19:in `parse'
lib/api/helpers/internal_helpers.rb:150:in `parse_repo_path'
lib/api/helpers/internal_helpers.rb:23:in `project'
lib/api/internal/base.rb:15:in `block (2 levels) in <class:Base>'
lib/gitlab/utils/lazy_attributes.rb:29:in `block (2 levels) in define_lazy_reader'
lib/gitlab/utils/lazy_attributes.rb:27:in `block in define_lazy_reader'
lib/gitlab/application_context.rb:154:in `project_path'
lib/gitlab/application_context.rb:112:in `block (2 levels) in to_lazy_hash'
lib/gitlab/application_context.rb:75:in `current'
lib/gitlab/application_context.rb:79:in `current_context_include?'
lib/gitlab/grape_logging/loggers/context_logger.rb:12:in `parameters'
lib/gitlab/middleware/memory_report.rb:13:in `call'
lib/gitlab/middleware/speedscope.rb:13:in `call'
lib/gitlab/database/load_balancing/rack_middleware.rb:23: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/query_analyzer.rb:11:in `block in call'
lib/gitlab/database/query_analyzer.rb:37:in `within'
lib/gitlab/middleware/query_analyzer.rb:11:in `call'
lib/gitlab/middleware/multipart.rb:173: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/path_traversal_check.rb:25: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:15:in `call'
lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
config/initializers/fix_local_cache_middleware.rb:11:in `call'
lib/gitlab/middleware/compressed_json.rb:44: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:79:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Gentoo 2.14 Current User: gitlab Using RVM: no Ruby Version: 3.1.4p223 Gem Version: 3.3.26 Bundler Version:2.3.26 Rake Version: 13.0.6 Redis Version: 7.2.1 Sidekiq Version:6.5.7 Go Version: go1.21.4 linux/amd64 GitLab information Version: 16.5.1 Revision: d59d7a49a1f Directory: /var/www/git.replaced.de/htdocs/gitlab DB Adapter: PostgreSQL DB Version: 15.4 URL: https://git.replaced.de HTTP Clone URL: https://git.replaced.de/some-group/some-project.git SSH Clone URL: gitlab@git.replaced.de:some-group/some-project.git Using LDAP: no Using Omniauth: no GitLab Shell Version: 14.29.0 Repository storages: - default: unix:/var/www/git.replaced.de/htdocs/gitlab/tmp/sockets/private/gitaly.socket GitLab Shell path: /var/www/git.replaced.de/htdocs/gitlab-shell Gitaly - default Address: unix:/var/www/git.replaced.de/htdocs/gitlab/tmp/sockets/private/gitaly.socket - default Version: 16.1.0-rc2-1786-g6da3bc061 - default Git Version: 2.42.1
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ... [85/1984]Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 14.29.0 ? ... OK (14.29.0) Running /var/www/git.replaced.de/htdocs/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 ...
Database config exists? ... yes Tables are truncated? ... skipped All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... no Try fixing it: sudo chmod 700 /var/www/git.replaced.de/htdocs/gitlab/public/uploads For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Uploads directory tmp has correct permissions? ... no Try fixing it: sudo chown -R gitlab /var/www/git.replaced.de/htdocs/gitlab/public/uploads sudo find /var/www/git.replaced.de/htdocs/gitlab/public/uploads -type f -exec chmod 0644 {} ; sudo find /var/www/git.replaced.de/htdocs/gitlab/public/uploads -type d -not -path /var/www/git.replaced.de/htdocs/gitlab/public/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Systemd unit files or init script exist? ... yes Systemd unit files or init script up-to-date? ... yes Projects have namespace: ... 5/6 ... yes 5/7 ... yes 5/8 ... yes 2/9 ... yes 5/10 ... yes 5/11 ... yes 5/12 ... yes 5/13 ... yes 5/14 ... yes 5/15 ... yes 5/16 ... yes 5/18 ... yes 5/19 ... yes 5/20 ... yes 5/22 ... yes 5/23 ... yes 5/25 ... yes 5/26 ... yes 2/27 ... yes 2/28 ... yes 2/29 ... yes 5/30 ... yes 2/31 ... yes 5/32 ... yes 5/33 ... yes 5/34 ... yes 5/35 ... yes 2/36 ... yes 5/37 ... yes 5/38 ... yes 5/40 ... yes 4/42 ... yes 5/43 ... yes 5/44 ... yes 4/45 ... yes 5/46 ... yes 5/47 ... yes 5/48 ... yes 5/49 ... yes 5/50 ... yes 5/51 ... yes 4/52 ... yes 5/53 ... yes 2/54 ... yes 5/55 ... yes 5/56 ... yes 5/57 ... yes 5/58 ... yes 5/59 ... yes 5/60 ... yes 5/61 ... yes 5/62 ... yes 5/63 ... yes 5/64 ... yes 5/65 ... yes 5/66 ... yes 5/68 ... yes 5/69 ... yes 2/70 ... yes 5/71 ... yes 5/72 ... yes 5/73 ... yes 2/74 ... yes 2/75 ... yes 4/76 ... yes 10/77 ... yes 10/78 ... yes 5/79 ... yes 5/80 ... yes 5/81 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 3.0.6 ? ... yes (3.1.4) Git user has default SSH configuration? ... yes Active users: ... 3 Is authorized keys file accessible? ... no Trying to fix error automatically. ...Exception: No such file or directory @ rb_sysopen - /home/git/.ssh/authorized_keys 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