Systematic mismatch in UI theme hashes gives 500 after last update.
Summary
After the latest update there seems to be a systematic mismatch in theme (hash) names and what available on disk. This results in 500 error when trying to open gitlab.
What is the expected correct behavior?
Opening the web ui.
Relevant logs and/or screenshots
In the log file: /var/log/gitlab/gitlab-rails/production.log I find reflections of this error.
Completed 500 Internal Server Error in 31459ms (ActiveRecord: 153.3ms | Elasticsearch: 0.0ms | Allocations: 57706)
ActionView::Template::Error (No such file or directory @ rb_sysopen - /opt/gitlab/embedded/service/gitlab-rails/public/assets/themes/
theme_indigo-190bf26ce6f97432bbca6d74618009b7eb07738094143cefed5cb9856d26f9e7.css):
1: - startup_filename = current_path?("sessions#new") ? 'signin' : user_application_theme == 'gl-dark' ? 'dark' : 'general'
2:
3: %style
4: = Rails.application.assets_manifest.find_sources("themes/#{user_application_theme_css_filename}.css").first.to_s.html_safe i
f user_application_theme_css_filename
5: = Rails.application.assets_manifest.find_sources("startup/startup-#{startup_filename}.css").first.to_s.html_safe
On my disk, the themes come with different hash, which I assume yields the error.
[root@jerry gitlab-rails]# ls /opt/gitlab/embedded/service/gitlab-rails/public/assets/themes/
_dark-b669c892afe8a5afb1387363afbed22c680978e1230bf6231b906506afc1911f.css
_dark-b669c892afe8a5afb1387363afbed22c680978e1230bf6231b906506afc1911f.css.gz
theme_blue-96587f8684990b09066b0946ce12be47182a1da285509d65c2ea9e33063b9ad0.css
theme_blue-96587f8684990b09066b0946ce12be47182a1da285509d65c2ea9e33063b9ad0.css.gz
theme_dark-83588ac9304da21496fa22b8438a522f79664277ab1083c9b6af8e6b5d0d6b96.css
theme_dark-83588ac9304da21496fa22b8438a522f79664277ab1083c9b6af8e6b5d0d6b96.css.gz
theme_green-45ddb2cee11cb1f22745af2b8050835f1c8e98b78dc68d0868c1401add6814b8.css
theme_green-45ddb2cee11cb1f22745af2b8050835f1c8e98b78dc68d0868c1401add6814b8.css.gz
theme_helper-2c70023ecf9740284eb7a4aa718dfa35e8fbd89545333dbe5432fef75281b61d.css
theme_helper-2c70023ecf9740284eb7a4aa718dfa35e8fbd89545333dbe5432fef75281b61d.css.gz
theme_indigo-d2c9449820ffa13c80c5eb240e0c2eebddc7685c90d3965b3fa9b70a1918a359.css
theme_indigo-d2c9449820ffa13c80c5eb240e0c2eebddc7685c90d3965b3fa9b70a1918a359.css.gz
theme_light-a566f1521721a1cf0e4e469cdb0392056c06b0ad8f171e72b4079728d43a8541.css
theme_light-a566f1521721a1cf0e4e469cdb0392056c06b0ad8f171e72b4079728d43a8541.css.gz
theme_light_blue-fe1afd2920a106c1b80bf84c0e678c56295667784b9e6f5bf9c9c63cf1a461d6.css
theme_light_blue-fe1afd2920a106c1b80bf84c0e678c56295667784b9e6f5bf9c9c63cf1a461d6.css.gz
theme_light_green-a5476a46cd0592eba8e5d61777130dab69db2e17cea3b9246fb51ee7ab8dcb2d.css
theme_light_green-a5476a46cd0592eba8e5d61777130dab69db2e17cea3b9246fb51ee7ab8dcb2d.css.gz
theme_light_indigo-1c37e170352b1d69a6e76d9917461a38e5e06f0549a24fb8a7434465e4f9633a.css
theme_light_indigo-1c37e170352b1d69a6e76d9917461a38e5e06f0549a24fb8a7434465e4f9633a.css.gz
theme_light_red-967e57340d3d79323a683476070c95d9737b93301511f54fae4331b6bfb47955.css
theme_light_red-967e57340d3d79323a683476070c95d9737b93301511f54fae4331b6bfb47955.css.gz
theme_red-333103aa35fb7d2aa2214ffb7d05d5dea53de9a88e06aa32ed36614b42f9b01b.css
theme_red-333103aa35fb7d2aa2214ffb7d05d5dea53de9a88e06aa32ed36614b42f9b01b.css.gz
Output of checks
Results of GitLab environment info
Note I have yum based gitlab installation on Centos 7.
Everything is from the gitlab bundle except a system-wide nginx installation (v 1.16.1).
[root@jerry gitlab-rails]# gitlab-rake gitlab:env:info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.7.2p137
Gem Version: 3.1.4
Bundler Version:2.1.4
Rake Version: 13.0.3
Redis Version: 6.0.10
Git Version: 2.29.0
Sidekiq Version:5.2.9
Go Version: unknown
GitLab information
Version: 13.9.2
Revision: 189a15a9118
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 12.5
URL: https://git.phys.tue.nl
HTTP Clone URL: https://git.phys.tue.nl/some-group/some-project.git
SSH Clone URL: git@git.phys.tue.nl:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 13.16.1
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
[root@jerry etc]# sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 13.16.1 ? ... OK (13.16.1)
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 ... 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: ...
4/3 ... yes
4/4 ... yes
OMISSIS .. came out all yes
275/1131 ... yes
2/1132 ... yes
192/1134 ... yes
85/1135 ... yes
61/1136 ... yes
Redis version >= 4.0.0? ... yes
Ruby version >= 2.7.2 ? ... yes (2.7.2)
Git version >= 2.29.0 ? ... yes (2.29.0)
Git user has default SSH configuration? ... yes
Active users: ... 125
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
Edited by Alessandro Corbetta