From bd7f0741b2165f524e4808e04b1bfc52a3de058e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Wed, 19 Apr 2023 14:51:18 +0200 Subject: [PATCH] upload/koji: always upload in the overwriting mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We sometimes see the following error in the logs: Fault(1000): upload path exists: /mnt/koji/work/osbuild-cg/osbuild-composer-koji-082e1c88/Fedora-IoT-38.raw.xz. I think this happens when we retry the upload call of the first chunk due to random network issues. The solution is to always upload in the overwriting mode, which ignores the already existing file. See https://pagure.io/koji/blob/175ecb5e8f3d45a1d244b227eb889321e5dd0a29/f/kojihub/kojihub.py#_15522 This is safe because: 1) We use UUIDs in the filename, which means that there should never be a real conflict. 2) The overwriting mode is actually the default mode in koji, see https://pagure.io/koji/blob/175ecb5e8f3d45a1d244b227eb889321e5dd0a29/f/koji/__init__.py#_3342 Signed-off-by: Ondřej Budai --- internal/upload/koji/koji.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/upload/koji/koji.go b/internal/upload/koji/koji.go index 78141394a..e1832a893 100644 --- a/internal/upload/koji/koji.go +++ b/internal/upload/koji/koji.go @@ -326,6 +326,7 @@ func (k *Koji) uploadChunk(chunk []byte, filepath, filename string, offset uint6 q.Add("filename", filename) q.Add("offset", fmt.Sprintf("%v", offset)) q.Add("fileverify", "adler32") + q.Add("overwrite", "true") u.RawQuery = q.Encode() client := createCustomRetryableClient()