Multiple failures on master due to QA::Resource::Issue using the API failed with 500 error
Summary
Multiple failures due to QA::Resource::Issue using the API failed with 500 error
in this pipeline: https://gitlab.com/gitlab-org/gitlab-qa-mirror/pipelines/140350591
Other pipelines:
- https://gitlab.com/gitlab-org/gitlab-qa-mirror/pipelines/140381864
- https://gitlab.com/gitlab-org/gitlab-qa-mirror/pipelines/140401558
Stack trace
Plan check xss occurence in @mentions in issues mentions a user in a comment
Failure/Error:
Resource::Issue.fabricate_via_api! do |issue|
issue.project = project
end.visit!
QA::Resource::ApiFabricator::ResourceFabricationFailedError:
Fabrication of QA::Resource::Issue using the API failed (500) with `{"message":"500 Internal Server Error"}`.
# ./qa/resource/api_fabricator.rb:89:in `api_post'
# ./qa/resource/api_fabricator.rb:33:in `fabricate_via_api!'
# ./qa/resource/base.rb:46:in `block (2 levels) in fabricate_via_api
Exception log:
{"severity":"ERROR","time":"2020-04-27T20:26:00.873Z","correlation_id":"fmTY6RHLNe1","tags.correlation_id":"fmTY6RHLNe1","tags.locale":"en","user.id":1,"user.email":"admin@example.com","user.username":"root","extra.server":{"os":{"name":"Linux","version":"#1 SMP Thu Oct 17 19:31:58 UTC 2019","build":"4.19.76-linuxkit","kernel_version":"Linux 192.168.50.160 4.19.76-linuxkit #1 SMP Thu Oct 17 19:31:58 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux"},"runtime":{"name":"ruby","version":"ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]"}},"extra.assignee_ids":null,"extra.labels":null,"extra.title":"[FILTERED]","extra.private_token":"[FILTERED]","exception.class":"NoMethodError","exception.message":"undefined method 'each' for nil:NilClass","exception.backtrace":["app/services/issuable_base_service.rb:166:in 'create'","app/services/issues/create_service.rb:14:in 'execute'","lib/api/issues.rb:230:in 'block (2 levels) in \u003cclass:Issues\u003e'","ee/lib/gitlab/ip_address_state.rb:10:in 'with'","ee/lib/gitlab/jira/middleware.rb:19:in
call'"]} `
Steps to reproduce:
- Use GitLab image from failing pipeline, for example
registry.gitlab.com/gitlab-org/build/omnibus-gitlab-mirror/gitlab-ee:1d38a7754059268f9dd7a630368eb8ab8fa0e8c5
- Run any issue-related spec, for example:
CHROME_HEADLESS=false QA_DEBUG=true bundle exec bin/qa Test::Instance::All http://gitlab_image_p_1 ./qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb:20
Possible fixes
Needs investigation. After initial investigation it appears that 500 error appears when we send POST request with :labels=>[]
in payload {:title=>"Issue title 6448fdc5863d740b", :labels=>[]}
cc @sliaquat @dchevalier2 @tmslvnkc