Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API Update Published Local Repo/Switch Published Snapshot (PUT) returns 200 OK, but does not actually switch the snapshot #1333

Open
abregar opened this issue Aug 23, 2024 · 1 comment
Assignees
Labels

Comments

@abregar
Copy link

abregar commented Aug 23, 2024

Detailed Description

Tried with latest aptly (version: 1.5.0+207+g372ce3c4) and using the REST api to switch the published snapshot (PUT /api/publish/:prefix/:distribution) with following body:

{
    "SourceKind": "snapshot",
    "Sources": [
        {
            "Component": "main",
            "Name": "focal-merged-20240823"
        }
    ],
    "Distribution": "focal",
    "Architectures": [
        "amd64"
    ],
    "Signing": {
        "Batch": true,
        "PassphraseFile": "passgpg"
    }
}

response is 200 OK, but it is telling that snapshot was not switched, as in i.e.

{
    "AcquireByHash": false,
    "Architectures": [
        "amd64"
    ],
    "ButAutomaticUpgrades": "",
    "Codename": "",
    "Distribution": "focal",
    "Label": "",
    "NotAutomatic": "",
    "Origin": "",
    "Path": "eventim/focal",
    "Prefix": "eventim",
    "SkipContents": false,
    "SourceKind": "snapshot",
    "Sources": [
        {
            "Component": "main",
            "Name": "focal-merged-20240822"
        }
    ],
    "Storage": "",
    "Suite": ""
}

Browsing through other tickets, I noticed some mentions of gpg sign failing silently as also this is seen in aptly log

Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
[GIN] 2024/08/23 - 10:43:29 | 200 |  3.844885601s |     10.10.10.10 | PUT      "/api/publish/example/focal"

but putting gpg-agent log to max debug, it is all good, actually signs and completes.

Also, when try to use DELETE and POST (meaning to drop and create the publish), REST api succeeds and publish is successfully created and signed.

Additionally, using aptly cmd, as in i.e.:

aptly publish -passphrase-file="passgpg" switch focal example focal-merged-20240823

says "Publish for snapshot .. has been successfully switched to new snapshot" and truly action is successfully done.

I would like to hear out whether someone can confirm the issue is present, then I can also dig a little bit into debugging.

Context

This is probably just a small bug and would be beneficial to fix due full publish lifecycle is then possible to maintain via REST api.

Your Environment

Ubuntu 22 linux

@neolynx neolynx added the bug label Sep 2, 2024
@neolynx
Copy link
Member

neolynx commented Oct 11, 2024

thanks for reporting, I will try to reproduce it...

Could you maybe paste the full log of the api call ?

@neolynx neolynx self-assigned this Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants