Commits made via the API or UI through a relative URL don't appear in Project Activity and don't trigger Pipelines
Summary
If GitLab has a relative URL, commits made via the API or UI don't appear in Project Activity and don't trigger Pipelines. They do appear in the repository itself.
Steps to reproduce
- Configure GitLab with a relative URL
- Create a project
- Add
.gitlab-ci.yml
with a basic pipeline. - Commit a file via the UI or the API. E.g.:
curl --request POST --header "PRIVATE-TOKEN: $ACCESS_TOKEN" --header 'Content-Type: application/json' \
-d '{"branch":"master", "commit_message":"initial commit", "actions":[{ "action":"create", "file_path":"foo", "content":"foo"}]}' \
http://gitlab.test/relative/api/v4/projects/10/repository/commits
- Check the Project Activity. Note that the commit does not appear.
- Note that no pipeline starts
QA test details
Seen in multiple tests in master, no errors in commit fabrication, but they do not appear in UI.
qa/specs/features/ee/browser_ui/4_verify/locked_artifacts_spec.rb qa/specs/features/browser_ui/4_verify/pipeline/create_and_process_pipeline_spec.rb qa/specs/features/browser_ui/6_release/pipeline/parent_child_pipelines_dependent_relationship_spec.rb qa/specs/features/ee/browser_ui/4_verify/pipeline_status_on_operation_dashboard_spec.rb qa/specs/features/ee/browser_ui/3_create/repository/merge_with_code_owner_in_root_group_spec.rb qa/specs/features/browser_ui/3_create/web_ide/review_merge_request_spec.rb qa/specs/features/ee/browser_ui/3_create/merge_request/add_batch_comments_in_merge_request_spec.rb qa/specs/features/ee/browser_ui/3_create/repository/merge_with_code_owner_in_subgroup_spec.rb qa/specs/features/ee/browser_ui/secure/project_security_dashboard_spec.rb
https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/763866255
https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/763866258
https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/763866264
https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/763866269
Stack trace
Various selector and expectation errors
Screenshot / HTML page
Various screenshots showing commits not appearing when they should, e.g.
Possible fixes
The problem seems to only occur when using the Commits API or UI to commit on an instance with a relative URL.
The workaround is to undo the change in omnibus-gitlab!4592 (merged), i.e., in /var/opt/gitlab/gitaly/config.toml
remove
url = 'http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket'
relative_url_root = 'relative'
And add:
url = 'http://127.0.0.1:8080/relative'