Skip to content

Maven package creation race condition (400 error)

Summary

We receive intermittent 400 errors with the message Name has already been taken for maven packages: https://log.gprd.gitlab.net/goto/3d852400-d631-11ec-a125-c377a8daf518

Looking at any specific package upload, the failed upload is always the 2nd uploaded file, pointing to a race condition where the 2nd file reaches the creation code before the 1st file finishes.

It is likely this package finder is starting for the 2nd file upload before the 1st one reaches this line. That causes the 2nd file to also reach the package creation line, at which point we encounter the error.

This might be a similar race condition to #362665 (closed) but this looks more like a standard race condition than one due to database replication lag.

Steps to reproduce

Example Project

What is the current bug behavior?

Maven package uploads fail with a 400: Name has already been taken error

What is the expected correct behavior?

Maven package uploads should be successful

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

Possible fixes

Workarounds

Retrying the package upload until it succeeds.

Edited by Steve Abrams