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

Getting a 400 error when using the Github deploy action #52

Open
ckruse opened this issue Mar 21, 2022 · 5 comments
Open

Getting a 400 error when using the Github deploy action #52

ckruse opened this issue Mar 21, 2022 · 5 comments

Comments

@ckruse
Copy link

ckruse commented Mar 21, 2022

Hey there,

I set up a flatpak repo, but I just get a 400 error when trying to deploy via a github action using the actions at https://github.com/bilelmoussaoui/flatpak-github-actions

Api call to redacted/api/v1/build failed with status 400, details: {'status': 400, 'error-type': 'no-error', 'message': 'No json error details from server'}
Error: Failed to publish the build: Error: The process '/usr/bin/flat-manager-client' failed with exit code 1
Mar 21 11:35:43 flatpak flat-manager[172593]: [2022-03-21T10:35:43Z INFO  actix_server::builder] Starting 1 workers
Mar 21 11:35:43 flatpak flat-manager[172593]: [2022-03-21T10:35:43Z INFO  actix_server::builder] Starting server on 0.0.0.0:8080
Mar 21 11:35:43 flatpak flat-manager[172593]: [2022-03-21T10:35:43Z INFO  flatmanager::app] Started http server: 0.0.0.0:8080
Mar 21 11:45:15 flatpak flat-manager[172593]: [2022-03-21T10:45:15Z INFO  flatmanager::logger] 52.190.196.115 "POST /api/v1/build HTTP/1.1" github 400 24 Python/3.10 aiohttp/3.7.4 0.004536

Attaching via strace didn't reveal more information. What am I doing wrong? This is the relevant action code:

      - uses: actions/checkout@v2
      - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
        name: "Build"
        with:
          bundle: recordwatcher.flatpak
          manifest-path: de.termitel.recordwatcher.json
          cache-key: flatpak-builder-tt-record-watcher-${{ github.sha }}

      - uses: bilelmoussaoui/flatpak-github-actions/flat-manager@v3
        name: "Deploy"
        with:
          repository: termitel
          flat-manager-url: redacted
          token: ${{ secrets.FLATPAK_KEY }}

This is the config.json:

{
  "repos": {
    "stable": {
      "path": "repo",
      "collection-id": "de.termitel.Stable",
      "suggested-repo-name": "Termitel",
      "runtime-repo-url": "redacted/repo/flathub.flatpakrepo",
      "gpg-key": null,
      "base-url": null,
      "subsets": {
        "all": {
          "collection-id": "de.termitel.Stable",
          "base-url": null
        }
      }
    }
  },
  "host": "0.0.0.0",
  "port": 8080,
  "delay-update-secs": 10,
  "database-url": "postgres://%2Fvar%2Frun%2Fpostgresql/repo",
  "build-repo-base": "/home/flatpak/build-repo",
  "build-gpg-key": null,
  "gpg-homedir": null,
  "secret": "redacted"
}

I compiled flat-manager from HEAD on a Ubuntu box. Deploying manually via flat-manager-client works:

$ ./flat-manager-client push --commit $(./flat-manager-client create redacted stable) RecordWatcher/termitel
Uploading refs to redacted/api/v1/build/9: ['app/de.termitel.recordwatcher/aarch64/master', 'runtime/de.termitel.recordwatcher.Debug/aarch64/master']
Refs contain 33 metadata objects
Remote missing 33 of those
Has 16 file objects for those
Remote missing 16 of those
Uploading file objects
Uploading 1 files (214 bytes)
Uploading 1 files (39982483 bytes)
Uploading 3 files (1731 bytes)
Uploading 1 files (4946843 bytes)
Uploading 10 files (11266 bytes)
Uploading metadata objects
Uploading 33 files (4885 bytes)
Uploading deltas
Creating ref app/de.termitel.recordwatcher/aarch64/master with commit b308577a76134cf0d826ded174982d8e04b03569ef7a95b99b865da57a26ffb5
Creating ref runtime/de.termitel.recordwatcher.Debug/aarch64/master with commit ac2dfde8e35f9233eb0e29786cca79aae4be61e597bed000372964c7fb6be8c6
Committing build redacted/api/v1/build/9

What am I doing wrong?

Best regards,
CK

@lewisgoddard
Copy link

lewisgoddard commented Nov 3, 2022

I believe I am now having the same problem, I don't suppose you managed to fix this?

Workflow file: https://github.com/elementary/flatpak-platform/actions/runs/3382649846/workflow#L98
Similar issue: https://gitlab.gnome.org/GNOME/gnome-build-meta/-/issues/335
Relevant source ? https://github.com/flatpak/flat-manager/blob/master/flat-manager-client#L465

@ckruse
Copy link
Author

ckruse commented Nov 3, 2022

Nope. I just gave up and solved it in a different way.

@meisenzahl
Copy link

@ckruse thank you for your quick reply. We would be very grateful if you could give us a hint about how you solved this in a different way.

@ckruse
Copy link
Author

ckruse commented Nov 3, 2022

@meisenzahl I rolled out a script which checks if there is a new version for the software and, if there is, installed it. I start it periodically via a systemd timer.

I know, this is not a very elegant solution, but it works.

@meisenzahl
Copy link

@ckruse thank you for taking the time to reply. Unfortunately, this cannot be applied to our use case.

Sometimes the most elegant solution is not the best one. The most important thing is that it works reliably 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants