500 error when accessing project page

Hi Everyone !

Encountered a problem when trying to access my project page ! This is what happened :

  1. Created a group, set it as ‘internal’
  2. Created a new project, set it as ‘internal’
  3. Push stuff into project for the first time
  4. Change project visibility to ‘public’. (at this point there was a prompt saying visibility can’t be set correctly)
  5. Refreshed the page. Boom. 500.

I suspect that even though the visibility could not be set to that level (due to the group visibility), the settings command still went through and got set. Now I cant access the project.

So, is there anyway i can revert this? Or rather is there a physical file that I can edit on the file system in order to force change the visibility? The webpage isnt working for me since, everything that is linked to that project just shows a 500 page.

Help help !

Thanks in advance !

The first thing I suggest is for you to reproduce that while looking at the logs. gitlab-ctl tail. Then post what you found. :slight_smile:

Sorry for the rather late reply. Thanks @pmatos, for introducing the command.

We manage to catch something in the logs and here it is :

Started PATCH “/Miscellaneous/tester2” for 192.168.18.114 at 2017-12-13 11:19:51 +0700
Processing by ProjectsController#update as JS
Parameters: {“utf8”=>“✓”, “authenticity_token”=>"[FILTERED]", “project”=>{“visibility_level”=>“20”, “project_feature_attributes”=>{“repository_access_level”=>“20”, “merge_requests_access_level”=>“20”, “builds_access_level”=>“20”, “snippets_access_level”=>“20”, “issues_access_level”=>“20”, “wiki_access_level”=>“20”, “id”=>“49”}, “request_access_enabled”=>“0”}, “commit”=>“Save changes”, “namespace_id”=>“Miscellaneous”, “id”=>“tester2”}
Completed 200 OK in 32ms (Views: 3.8ms | ActiveRecord: 7.1ms)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{“method”:“PATCH”,“path”:"/Miscellaneous/tester2",“format”:“js”,“controller”:“ProjectsController”,“action”:“update”,“status”:200,“duration”:33.14,“view”:3.81,“db”:7.12,“time”:“2017-12-13T04:19:51.457Z”,“params”:{“utf8”:“✓”,"_method":“patch”,“authenticity_token”:"[FILTERED]",“project”:{“visibility_level”:“20”,“project_feature_attributes”:{“repository_access_level”:“20”,“merge_requests_access_level”:“20”,“builds_access_level”:“20”,“snippets_access_level”:“20”,“issues_access_level”:“20”,“wiki_access_level”:“20”,“id”:“49”},“request_access_enabled”:“0”},“commit”:“Save changes”,“namespace_id”:“Miscellaneous”,“id”:“tester2”},“remote_ip”:“192.168.18.114”,“user_id”:2,“username”:“lionel.tan”}

==> /var/log/gitlab/gitlab-workhorse/current <==
2017-12-13_04:19:51.49177 vc1 @ - - [2017-12-13 11:19:51.449766879 +0700 WIB] “POST /Miscellaneous/tester2 HTTP/1.1” 200 342 “http://vc1/Miscellaneous/tester2/edit” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36” 0.041941

==> /var/log/gitlab/nginx/gitlab_access.log <==
192.168.18.114 - - [13/Dec/2017:11:19:51 +0700] “POST /Miscellaneous/tester2 HTTP/1.1” 200 255 “http://vc1/Miscellaneous/tester2/edit” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36”

==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET “/-/metrics” for 127.0.0.1 at 2017-12-13 11:19:53 +0700
Processing by MetricsController#index as HTML
Filter chain halted as :validate_prometheus_metrics rendered or redirected
Completed 404 Not Found in 1ms (Views: 0.3ms | ActiveRecord: 0.0ms)

In which after the above logs, refreshing the webpage produced the following :

==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET “/Miscellaneous/tester2/edit” for 192.168.18.114 at 2017-12-13 11:23:55 +0700
Processing by ProjectsController#edit as HTML
Parameters: {“namespace_id”=>“Miscellaneous”, “id”=>“tester2”}
Completed 500 Internal Server Error in 39ms (ActiveRecord: 1.8ms)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{“method”:“GET”,“path”:"/Miscellaneous/tester2/edit",“format”:“html”,“controller”:“ProjectsController”,“action”:“edit”,“status”:500,“error”:“ActionView::Template::Error: undefined method `merge_requests_access_level’ for nil:NilClass”,“duration”:39.84,“view”:0.0,“db”:1.76,“time”:“2017-12-13T04:23:55.673Z”,“params”:{“namespace_id”:“Miscellaneous”,“id”:“tester2”},“remote_ip”:“192.168.18.114”,“user_id”:2,“username”:“lionel.tan”}

==> /var/log/gitlab/gitlab-rails/production.log <==

ActionView::Template::Error (undefined method merge_requests_access_level' for nil:NilClass): 148: = f.submit 'Save changes', class: "btn btn-save" 149: 150: 151: %section.settings.merge-requests-feature{ style: ("display: none;" if @project.project_feature.send(:merge_requests_access_level) == 0) } 152: .settings-header 153: %h4 154: Merge request settings app/views/projects/edit.html.haml:151:in _app_views_projects_edit_html_haml___1227689737581903746_69961614892360’
app/controllers/projects_controller.rb:26:in edit' lib/gitlab/i18n.rb:46:in with_locale’
lib/gitlab/i18n.rb:52:in with_user_locale' app/controllers/application_controller.rb:326:in set_locale’
lib/gitlab/middleware/multipart.rb:93:in call' lib/gitlab/request_profiler/middleware.rb:14:in call’
lib/gitlab/middleware/go.rb:17:in call' lib/gitlab/etag_caching/middleware.rb:11:in call’
lib/gitlab/request_context.rb:18:in call' lib/gitlab/metrics/requests_rack_middleware.rb:27:in call’

Anyone able to make sense out of what the logs is showing?