Skip to content

Swift Package Manager Publishing using commandline throws error #33990

Closed
@wgr1984

Description

@wgr1984

Description

There seem some error using apples swift publish command on swift package manager registry

swift package-registry publish -v test.Test 1.1.13
info: archiving the source at '/Users/wolfgangreithmeier/spm_test_lib'
info: publishing test.Test archive at '/Users/wolfgangreithmeier/spm_test_lib/.build/registry/publish/test.Test-1.1.13.zip' to https://127.0.0.1:8080/
info: publishing test.Test 1.1.13 to https://127.0.0.1:8080/test/Test/1.1.13
Error: failed publishing: server error 409: upload failed, package exists:test.Test-1.1.13.zip

using curl works without problem

curl -k -v -X PUT --user ....:.... \
         -H "Accept: application/vnd.swift.registry.v1+json" \
         -F source-archive=@spm_test_lib.zip \
         https://127.0.0.1:3000/api/packages/swift-repo/swift/test/Test/1.2.1
*   Trying 127.0.0.1:3000...
* Connected to 127.0.0.1 (127.0.0.1) port 3000
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
*  subject: C=DE; ST=Some-State; L=Munich; O=Internet Widgits Pty Ltd
*  start date: Sep 29 16:43:04 2024 GMT
*  expire date: Sep 27 16:43:04 2034 GMT
*  issuer: C=DE; ST=Some-State; L=Munich; O=Internet Widgits Pty Ltd
*  SSL certificate verify ok.
* using HTTP/2
* Server auth using Basic with user 'admin'
* [HTTP/2] [1] OPENED stream for https://127.0.0.1:3000/api/packages/swift-repo/swift/test/Test/1.2.1
* [HTTP/2] [1] [:method: PUT]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: 127.0.0.1:3000]
* [HTTP/2] [1] [:path: /api/packages/swift-repo/swift/test/Test/1.2.1]
* [HTTP/2] [1] [authorization:  ......]
* [HTTP/2] [1] [user-agent: curl/8.6.0]
* [HTTP/2] [1] [accept: application/vnd.swift.registry.v1+json]
* [HTTP/2] [1] [content-length: 34891]
* [HTTP/2] [1] [content-type: multipart/form-data; boundary=------------------------V4sAMoUbKlnyqmUHIfSozi]
> PUT /api/packages/swift-repo/swift/test/Test/1.2.1 HTTP/2
> Host: 127.0.0.1:3000
> Authorization: Basic YWRtaW46YWRtaW5wYXNzd29yZDEyMw==
> User-Agent: curl/8.6.0
> Accept: application/vnd.swift.registry.v1+json
> Content-Length: 34891
> Content-Type: multipart/form-data; boundary=------------------------V4sAMoUbKlnyqmUHIfSozi
> 
* We are completely uploaded and fine
< HTTP/2 201 
< content-version: 1
< content-length: 0
< date: Sun, 23 Mar 2025 19:55:31 GMT
< 
* Connection #0 to host 127.0.0.1 left intact

Gitea Version

1.23.5

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/wgr1984/edb15ebabadad1c4f18cf4c0b0d2eb31

Screenshots

No response

Git Version

No response

Operating System

Docker: gitea/gitea:latest

How are you running Gitea?

Docker compose setup

version: '3'

networks:
  gitea:
    external: false

services:
  gitea:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - GITEA__database__DB_TYPE=mysql
      - GITEA__database__HOST=db:3306
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea_password
      # Server settings
      - GITEA__server__DOMAIN=localhost
      - GITEA__server__ROOT_URL=https://localhost:3000/
      - GITEA__server__SSH_DOMAIN=localhost
      - GITEA__server__SSH_PORT=222
      - GITEA__server__SSH_LISTEN_PORT=22
      - GITEA__server__APP_NAME=Gitea
      # HTTPS settings
      - GITEA__server__PROTOCOL=https
      - GITEA__server__CERT_FILE=/data/ssl/gitea.crt
      - GITEA__server__KEY_FILE=/data/ssl/gitea.key
      # Skip setup page
      - GITEA__security__INSTALL_LOCK=true
      # Language settings
      - GITEA__i18n__LANGS=en-US
      - GITEA__i18n__NAMES=English
      # Authentication settings
      - GITEA__service__REQUIRE_SIGNIN_VIEW=true
      - GITEA__service__REGISTER_EMAIL_CONFIRM=false
      - GITEA__openid__ENABLE_OPENID_SIGNIN=false
      - GITEA__openid__ENABLE_OPENID_SIGNUP=false
      - GITEA__oauth2_client__ENABLE_AUTO_REGISTRATION=false
      - GITEA__service__ENABLE_BASIC_AUTHENTICATION=true
      - GITEA__service__DISABLE_REGISTRATION=true
      # 2FA settings
      - GITEA__security__REQUIRE_SIGNIN_2FA=true
      - GITEA__security__DISABLE_2FA=false
      # Repository and package settings
      - GITEA__repository__DISABLE_REPOSITORIES=true
      - GITEA__repository__DISABLE_HTTP_GIT=true
      - GITEA__repository__DISABLE_SSH=true
      - GITEA__packages__ENABLED=true
      - GITEA__repository__DEFAULT_PRIVATE=true
      - GITEA__repository__DEFAULT_REPO_UNITS=packages
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      - ./ssl:/data/ssl:ro
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "222:22"
    depends_on:
      - db

  db:
    image: mysql:8.0
    container_name: gitea-db
    restart: always
    networks:
      - gitea
    environment:
      - MYSQL_ROOT_PASSWORD=gitea_root_password
      - MYSQL_DATABASE=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=gitea_password
    volumes:
      - ./mysql:/var/lib/mysql
    ports:
      - "3306:3306" 

Database

MSSQL

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions