GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Do not attempt to revoke token if it already expired · Issue #72 · actions/create-github-app-token

Do not attempt to revoke token if it already expired #72

New issue
Copy link
New issue
Copy link
Closed
#95
Closed
Do not attempt to revoke token if it already expired#72
#95
Copy link
Labels
bugSomething isn't workinggood first issueGood for newcomersreleased

Description

@mithunpandey
mithunpandey
opened on Nov 3, 2023
Issue body actions

When the steps after creating the app token take more than one hour, revoking the token in the post step of the job fails with 401 Bad credentials

logs
2023-11-03T08:17:49.8021984Z ##[group]Run actions/create-github-app-token@v1
2023-11-03T08:17:49.8022321Z with:
2023-11-03T08:17:49.8022568Z   app-id: ***
2023-11-03T08:17:49.8029074Z   private-key: ***
**2023-11-03T08:17:49**.8029317Z   owner: 

**Other jobs running for around 3 hrs**
Error in post job cleanup 

**2023-11-03T11:28:30**.0046013Z Post job cleanup.
2023-11-03T11:28:30.0195545Z Post job cleanup.
2023-11-03T11:28:30.3211228Z RequestError [HttpError]: Bad credentials
2023-11-03T11:28:30.3233502Z ##[error]Bad credentials
2023-11-03T11:28:30.3234665Z     at C:\actions-runner\_work\_actions\actions\create-github-app-token\v1\dist\post.cjs:2890:25
2023-11-03T11:28:30.3235686Z     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-11-03T11:28:30.3237018Z     at async post (C:\actions-runner\_work\_actions\actions\create-github-app-token\v1\dist\post.cjs:2996:3) {
2023-11-03T11:28:30.3237833Z   status: 401,
2023-11-03T11:28:30.3238145Z   response: {
2023-11-03T11:28:30.3238651Z     url: 'https://api.github.com/installation/token',
2023-11-03T11:28:30.3239157Z     status: 401,
2023-11-03T11:28:30.3239481Z     headers: {
2023-11-03T11:28:30.3239914Z       'access-control-allow-origin': '*',
2023-11-03T11:28:30.3242327Z       'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
2023-11-03T11:28:30.3244679Z       'content-length': '80',
2023-11-03T11:28:30.3245298Z       'content-security-policy': "default-src 'none'",
2023-11-03T11:28:30.3245984Z       'content-type': 'application/json; charset=utf-8',
2023-11-03T11:28:30.3246616Z       date: 'Fri, 03 Nov 2023 11:28:30 GMT',
2023-11-03T11:28:30.3247427Z       'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
2023-11-03T11:28:30.3248174Z       server: 'GitHub.com',
2023-11-03T11:28:30.3248880Z       'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
2023-11-03T11:28:30.3249999Z       vary: 'Accept-Encoding, Accept, X-Requested-With',
2023-11-03T11:28:30.3250499Z       'x-content-type-options': 'nosniff',
2023-11-03T11:28:30.3250879Z       'x-frame-options': 'deny',
2023-11-03T11:28:30.3251281Z       'x-github-media-type': 'github.v3; format=json',
2023-11-03T11:28:30.3251806Z       'x-github-request-id': 'XXXXXXXXXXXXXXXXXXXXXXX
2023-11-03T11:28:30.3252248Z       'x-ratelimit-limit': '60',
2023-11-03T11:28:30.3252595Z       'x-ratelimit-remaining': '60',
2023-11-03T11:28:30.3253035Z       'x-ratelimit-reset': '1699014510',
2023-11-03T11:28:30.3253398Z       'x-ratelimit-resource': 'core',
2023-11-03T11:28:30.3253751Z       'x-ratelimit-used': '0',
2023-11-03T11:28:30.3254131Z       'x-xss-protection': '0'
2023-11-03T11:28:30.3254397Z     },
2023-11-03T11:28:30.3254601Z     data: {
2023-11-03T11:28:30.3259781Z       message: 'Bad credentials',
2023-11-03T11:28:30.3260135Z       documentation_url: 'https://docs.github.com/rest'
2023-11-03T11:28:30.3260442Z     }
2023-11-03T11:28:30.3260614Z   },
2023-11-03T11:28:30.3260784Z   request: {
2023-11-03T11:28:30.3261004Z     method: 'DELETE',
2023-11-03T11:28:30.3261311Z     url: 'https://api.github.com/installation/token',
2023-11-03T11:28:30.3261614Z     headers: {
2023-11-03T11:28:30.3261884Z       accept: 'application/vnd.github.v3+json',
2023-11-03T11:28:30.3262256Z       'user-agent': 'actions/create-github-app-token',
2023-11-03T11:28:30.3262703Z       authorization: 'token [REDACTED]'
2023-11-03T11:28:30.3262956Z     }
2023-11-03T11:28:30.3263119Z   }
2023-11-03T11:28:30.3263277Z }
Reacted by Anton Danielsson, Marius Filipowski, Markus Blaschke, Caroline Chao, Tomas Ptacek and Jo Huang

Activity

  1. gr2m commented on Nov 3, 2023

    @gr2m
    gr2m
    on Nov 3, 2023
    Contributor
    More actions

    Other jobs running for around 3 hrs

    An installation access token is only valid for 1 hour, there is no way to extend that. Cleaning up the token failed because it expired.

    I think what we can do is to pass the time of the creation as state to the post job, that way we can check the time that passed since the creation.

    Would you be interested in working on a pull request to implement this change?

  2. gr2m
    changed the title [-]Error in post Job cleanup for create-github-app-token action V1[/-] [+]Do not attempt to revoke token if it already expired[/+] on Nov 3, 2023
  3. gr2m
    added
    bugSomething isn't working
    good first issueGood for newcomers
    on Nov 3, 2023
  4. anton-danielsson commented on Nov 6, 2023

    @anton-danielsson
    anton-danielsson
    on Nov 6, 2023
    More actions

    We have the same issue using this action on some jobs that run long.

    Reacted by Peter Toft, Caroline Chao and Jo Huang
  5. mblaschke-daimlertruck commented on Nov 30, 2023

    @mblaschke-daimlertruck
    mblaschke-daimlertruck
    on Nov 30, 2023
    More actions

    or just ignore revocation and don't mark the post action as failed in that case

    Reacted by Marius Filipowski, Caroline Chao and Tomas Ptacek
  6. peter-toft-greve commented on Dec 6, 2023

    @peter-toft-greve
    peter-toft-greve
    on Dec 6, 2023
    More actions

    Would it be viable to extend the functionality and allow the user to allow a longer expiration time?

  7. gr2m commented on Dec 6, 2023

    @gr2m
    gr2m
    on Dec 6, 2023
    Contributor
    More actions

    allow the user to allow a longer expiration time

    expiration time for installation access token is 1 hour. It's not extendable.

  8. grossag commented on Jan 17, 2024

    @grossag
    grossag
    on Jan 17, 2024
    More actions

    I am also running into this issue for long builds. The biggest problem is that it is failing builds when the revocation fails because the token is expired. I don't mind if it still tries to revoke the token and just fails silently, but failing in this case is really disruptive for our builds. Here is an example failure log: failure-info.txt

  9. joshmgross commented on Jan 18, 2024

    @joshmgross
    joshmgross
    on Jan 18, 2024
    Contributor
    More actions

    👋 I have a fix for this issue in #95. I'm still working on figuring out the testing library and snapshots, I'll work on that tomorrow.

    Reacted by Alexandre Croteau
    Reacted by Gregor Martynus
  10. gr2m
    closed this as completedin #95on Jan 19, 2024
  11. gr2m
    added a commit that references this issue on Jan 19, 2024

    fix(revocation): avoid revoking expired tokens and fail gracefully (#95)

    This issue will close once commit 0c01407 is merged into the 'main' branch.
    0c01407
  12. create-app-token-action-releaser
    added a commit that references this issue on Jan 19, 2024

    build(release): 1.6.4 [skip ci]

    c4fa18d
  13. create-app-token-action-releaser commented on Jan 19, 2024

    @create-app-token-action-releaser
    create-app-token-action-releaserBot
    on Jan 19, 2024
    Contributor
    More actions

    🎉 This issue has been resolved in version 1.6.4 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  14. create-app-token-action-releaser
    added
    released
    on Jan 19, 2024
  15. lepadatu
    added 3 commits that reference this issue on Sep 2, 2024

    build(release): 1.0.0 [skip ci]

    086d980

    build(release): 1.0.0 [skip ci]

    4f59f2b

    Dev (#7)

    4df4884
  16. test-app-suchithrzp
    added a commit that references this issue on Nov 4, 2024

    build(release): 1.0.0 [skip ci]

    ad3294a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.