selecting a tag in file view of repo gives error
Summary
We are unable to see repository files based on a tag selection. Selecting a tag produces an empty view and the following error: An error occurred while fetching folder content.
Steps to reproduce
On a project go to repository -> files tree-view Click branch/tags drop down and select a tag
Example Project
I was not able to reproduce on gitlab.com.
From what I see, gitlab.com is in 12.9.0-pre.
My server is in 12.8.0. I saw an other user on the forums having the issue on 12.8.1 https://forum.gitlab.com/t/repos-tag-file-view-gives-error/34824
What is the current bug behavior?
We get the error message "An error occurred while fetching folder content." ans file-tree view is empty.
What is the expected correct behavior?
To have the file-tree view content matching the selected tag.
Relevant logs and/or screenshots
Logs in /var/log/gitlab/gitlab-rails/production.log on my server:
NoMethodError (undefined method `tree' for #<Rugged::Tag::Annotation:0x00007f381ed6a5f8>):
lib/gitlab/git/rugged_impl/tree.rb:79:in `get_tree_entries_from_rugged'
lib/gitlab/git/rugged_impl/tree.rb:37:in `tree_entries_from_rugged'
lib/gitlab/git/rugged_impl/tree.rb:26:in `tree_entries_with_flat_path_from_rugged'
lib/gitlab/git/rugged_impl/use_rugged.rb:28:in `block in execute_rugged_call'
lib/gitlab/gitaly_client/storage_settings.rb:31:in `block in allow_disk_access'
lib/gitlab/temporarily_allow.rb:9:in `temporarily_allow'
lib/gitlab/gitaly_client/storage_settings.rb:31:in `allow_disk_access'
lib/gitlab/git/rugged_impl/use_rugged.rb:25:in `execute_rugged_call'
lib/gitlab/git/rugged_impl/tree.rb:19:in `tree_entries'
lib/gitlab/git/tree.rb:21:in `where'
app/models/tree.rb:17:in `initialize'
app/models/repository.rb:673:in `new'
app/models/repository.rb:673:in `tree'
lib/gitlab/metrics/instrumentation.rb:161:in `block in tree'
lib/gitlab/metrics/method_call.rb:36:in `measure'
lib/gitlab/metrics/instrumentation.rb:161:in `tree'
app/graphql/resolvers/tree_resolver.rb:23:in `resolve'
lib/gitlab/graphql/generic_tracing.rb:40:in `with_labkit_tracing'
lib/gitlab/graphql/generic_tracing.rb:30:in `platform_trace'
lib/gitlab/graphql/generic_tracing.rb:40:in `with_labkit_tracing'
lib/gitlab/graphql/generic_tracing.rb:30:in `platform_trace'
lib/gitlab/graphql/generic_tracing.rb:40:in `with_labkit_tracing'
lib/gitlab/graphql/generic_tracing.rb:30:in `platform_trace'
app/graphql/gitlab_schema.rb:46:in `execute'
app/controllers/graphql_controller.rb:48:in `execute_query'
app/controllers/graphql_controller.rb:19:in `execute'
ee/lib/gitlab/ip_address_state.rb:10:in `with'
ee/app/controllers/ee/application_controller.rb:43:in `set_current_ip_address'
app/controllers/application_controller.rb:478:in `set_current_admin'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:463:in `set_locale'
lib/gitlab/application_context.rb:46:in `block in use'
lib/gitlab/application_context.rb:46:in `use'
lib/gitlab/application_context.rb:19:in `with_context'
app/controllers/application_controller.rb:454:in `set_current_context'
lib/gitlab/error_tracking.rb:34:in `with_context'
app/controllers/application_controller.rb:554:in `sentry_context'
lib/gitlab/middleware/rails_queue_duration.rb:27:in `call'
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
lib/gitlab/metrics/transaction.rb:62:in `run'
lib/gitlab/metrics/rack_middleware.rb:17:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
ee/lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/multipart.rb:117:in `call'
lib/gitlab/middleware/read_only/controller.rb:53:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:49:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'
Completed 500 Internal Server Error in 73ms (Views: 0.3ms | ActiveRecord: 9.1ms | Elasticsearch: 0.0ms | Allocations: 19983)
The file view then looks like this:
Logs can also be found on the previously mentioned forum post: https://forum.gitlab.com/t/repos-tag-file-view-gives-error/34824
Output of checks
--
Results of GitLab environment info
Expand for output related to GitLab environment info
$> gitlab-rake gitlab:env:info
System information System: Debian 9.12 Proxy: no Current User: git Using RVM: no Ruby Version: 2.6.5p114 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.7 Git Version: 2.24.1 Sidekiq Version:5.2.7 Go Version: unknown
GitLab information Version: 12.8.0-ee Revision: 0bd32f78864 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.12 URL: https://git.lgo.ninja HTTP Clone URL: https://git.lgo.ninja/some-group/some-project.git SSH Clone URL: git@git.lgo.ninja:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: google_oauth2
GitLab Shell Version: 11.0.0 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
Expand for output related to the GitLab application check
$> gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 11.0.0 ? ... OK (11.0.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 ... 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: ... 20/64 ... yes 16/65 ... yes 16/66 ... yes 54/67 ... yes 16/68 ... yes 16/69 ... yes 16/70 ... yes 16/71 ... yes 16/72 ... yes 16/73 ... yes 16/74 ... yes 16/75 ... yes 54/76 ... yes 16/77 ... yes 16/78 ... yes 17/80 ... yes 19/85 ... yes 19/86 ... yes 19/87 ... yes 16/88 ... yes 12/89 ... yes 12/90 ... yes 12/91 ... yes 12/92 ... yes 12/94 ... yes 16/95 ... yes 54/97 ... yes 54/98 ... yes 12/99 ... yes 12/100 ... yes 54/101 ... yes 21/102 ... yes 12/107 ... yes 12/108 ... yes 21/109 ... yes 36/111 ... yes 38/112 ... yes 54/113 ... yes 38/114 ... yes 54/115 ... yes 16/116 ... yes 54/118 ... yes 38/119 ... yes 33/120 ... yes 38/122 ... yes 38/124 ... yes 38/125 ... yes 21/126 ... yes 38/127 ... yes 54/129 ... yes 20/130 ... yes 42/131 ... yes 54/132 ... yes 42/133 ... yes 42/134 ... yes 42/135 ... yes 42/139 ... yes 38/141 ... yes 42/142 ... yes 42/143 ... yes 12/144 ... yes 38/146 ... yes 42/147 ... yes 42/148 ... yes 45/149 ... yes 45/150 ... yes 45/151 ... yes 42/152 ... yes 21/154 ... yes 42/156 ... yes 16/157 ... yes 36/160 ... yes 47/161 ... yes 21/162 ... yes 12/163 ... yes 42/164 ... yes 54/167 ... yes 42/169 ... yes 54/170 ... yes 54/171 ... yes 42/173 ... yes 49/174 ... yes 42/175 ... yes 42/176 ... yes 55/177 ... yes 38/178 ... yes 42/179 ... yes 58/180 ... yes 42/181 ... yes 38/182 ... yes 42/183 ... yes 16/184 ... yes 42/187 ... yes 42/188 ... yes 42/192 ... yes 60/193 ... yes 38/194 ... yes 36/195 ... yes 42/196 ... yes 21/197 ... yes 42/198 ... yes 61/199 ... yes 42/200 ... yes 42/201 ... yes 42/202 ... yes 36/203 ... yes 12/204 ... yes 16/205 ... yes 42/206 ... yes 16/207 ... yes 49/208 ... yes 20/209 ... yes 64/210 ... yes 64/212 ... yes 42/213 ... yes 42/214 ... yes 20/215 ... yes 64/216 ... yes 12/217 ... yes 58/219 ... yes 42/220 ... yes 38/221 ... yes 38/222 ... yes 73/226 ... yes 20/227 ... yes 42/228 ... yes 38/229 ... yes 38/230 ... yes 10/231 ... yes 12/234 ... yes 42/235 ... yes 24/239 ... yes 42/242 ... yes 42/253 ... yes 16/254 ... yes 16/255 ... yes 20/257 ... yes 128/259 ... yes 38/260 ... yes 12/262 ... yes 30/263 ... yes 44/264 ... yes 30/265 ... yes 20/267 ... yes 86/268 ... yes 12/269 ... yes 42/270 ... yes 16/271 ... yes 40/273 ... yes 60/274 ... yes 42/277 ... yes 38/278 ... yes 16/279 ... yes 20/280 ... yes 16/281 ... yes 16/283 ... yes 60/285 ... yes 60/288 ... yes 90/289 ... yes 60/290 ... yes 60/291 ... yes 42/294 ... yes 42/295 ... yes 38/296 ... yes 49/297 ... yes 12/298 ... yes 54/299 ... yes 16/300 ... yes 30/301 ... yes 30/302 ... yes 54/303 ... yes 16/304 ... yes 16/305 ... yes 16/306 ... yes 60/307 ... yes 60/308 ... yes 60/309 ... yes 16/310 ... yes 30/312 ... yes 24/313 ... yes 16/315 ... yes 30/316 ... yes 42/317 ... yes 10/318 ... yes 16/319 ... yes 98/320 ... yes 42/321 ... yes 38/322 ... yes 60/324 ... yes 16/325 ... yes 12/326 ... yes 42/327 ... yes 38/328 ... yes 16/329 ... yes 58/330 ... yes 55/331 ... yes 12/332 ... yes 36/333 ... yes 114/337 ... yes 115/338 ... yes 116/339 ... yes 116/340 ... yes 42/341 ... yes 38/342 ... yes 38/343 ... yes 20/344 ... yes 12/345 ... yes 12/346 ... yes 16/347 ... yes 12/348 ... yes 129/350 ... yes 129/351 ... yes 129/352 ... yes 129/353 ... yes 12/354 ... yes 42/355 ... yes 38/356 ... yes 38/357 ... yes 49/358 ... yes 12/359 ... yes 12/360 ... yes 12/361 ... yes 42/363 ... yes 38/364 ... yes 10/365 ... yes 49/366 ... yes 42/367 ... yes 30/368 ... yes 42/369 ... yes 42/370 ... yes 16/371 ... yes 42/372 ... yes 12/373 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.5) Git version >= 2.22.0 ? ... yes (2.24.1) Git user has default SSH configuration? ... yes Active users: ... 27 Is authorized keys file accessible? ... yes Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
--