Skip to content

GitHub: Stale user token prevent builds from running #2488

@pat-s

Description

@pat-s

Discussed in #2482

Originally posted by pat-s September 20, 2023
When using WP with GH, everything works fine for a short period of time (some hours) after being logged in freshly.

However, it seems that after some time the user token expires and builds are not triggered anymore

 {"level":"error","error":"Error #01: GET https://api.github.com/repos/<repo-slug>branches?page=1&per_page=50: 401 Bad credentials []\n","ip":"159.100.253.188","latency":265.980774,"method":"GET" │
│ ,"path":"/api/repos/2/branches","status":500,"time":"2023-09-20T07:56:03Z","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 │
│ ","time":"2023-09-20T07:56:03Z"}  

This is especially problematic for CRON builds as these are never triggered then. Also the UI reflects this by showing the following banner

image

A logout and fresh login solves the issue. I wonder: is this something that must be solved on the user side? Which token is actually used here which could expire? The GH auth runs via a self-hosted GH app which is using a client ID and secret.

How is this being handled for the WP instance running in the woodpecker repo here?

According to #2482 (reply in thread) from @qwerty287 this might be a bug in WP.

Happy to help with any logs or additional information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingforge/githubgithub forge relatedserver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions