400 Bad request when deploying a maven package
Summary
400 Bad request when deploying a maven package
Steps to reproduce
- Deploy a maven project to the maven package registry
- Attempt to deploy the same package in the package registry of another project
What is the current bug behavior?
400 Bad request
What is the expected correct behavior?
Deploy successful
Examples
Reproduced on GitLab.com: https://gitlab.com/maven-test/minimal-maven-2/-/jobs/262547440
Customer tickets (internal):
- https://gitlab.zendesk.com/agent/tickets/127929
- https://gitlab.zendesk.com/agent/tickets/127498
- https://gitlab.zendesk.com/agent/tickets/127679
- https://gitlab.zendesk.com/agent/tickets/127586
- https://gitlab.zendesk.com/agent/tickets/127046
Output of checks
This bug happens on GitLab.com, GitLab Enterprise Edition 12.2.0-pre 1802ffd1
Also affecting self-managed customers on 12.1
Possible fixes
We can disable the package_already_taken?
validation in https://gitlab.com/gitlab-org/gitlab-ee/blob/22e5853ee9a4599b9ff814a12a4af9a539a7822d/ee/app/models/packages/package.rb#L16 for Maven packages.
Possible Workaround
changing the package (artifact) ID should run without error
Edited by Cynthia "Arty" Ng