probot: JWT: 'Expiration time' claim ('exp') is too far in the future

Bug Report

Current Behavior This error began when I upgraded to v9 from v7

When running probot run index.js I get the following error:

ERROR probot: 'Expiration time' claim ('exp') is too far in the future

I am not creating any tokens manually, this just occurs when the bot tries to authenticate in order to make the first request.

Expected behavior/code Authentication with the GitHub API on probot@^9 should create valid API tokens

Environment

  • Probot version(s): 9.2.13
  • Node/npm version: Node v10.16.0
  • OS: OSX 10.14.5

Possible Solution

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Hmm sounds like a game of spot the difference is in order then @gr2m

It’s not quite the same though

Previous

 exp: Math.floor(Date.now() / 1000) + 60,  // JWT expiration time

Current

const now = Math.floor(Date.now() / 1000);
exp: now + 60 * 10, // JWT expiration time (10 minute maximum)

So previous one just added on 60 seconds from current issued time and the current one adds on 10 minutes from current time.

Issue-Label Bot is automatically applying the label bug 🐞 to this issue, with a confidence of 0.91. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

This problem is back! Was there any update at github? “message”: “‘Expiration time’ claim (‘exp’) is too far in the future”,

Last week ( beginning of juli ) it worked ok

I need to get off my phone for tonight. Will check in the morning how it’s going. Keep me posted 😄

@warrenbuckley I agree. I for one do not see that error with the WIP app, even when running it locally. Can you confirm that if we reduce the expiration time by 30 seconds you no longer see the error (but still do if we only reduce by one or 10 seconds)?

Can either of you provide a minimal test case? We use https://github.com/octokit/app.js internally, maybe a minimal test case to reproduce the problem could only use that?

<div> GitHub</div><div>octokit/app.js</div><div>GitHub Apps toolset for Node.js. Contribute to octokit/app.js development by creating an account on GitHub.</div>

Excuse me, yes I meant “minutes”. 60 * 10 -1 didn’t work, and neither did 60 * 10 - 20. 60 * 10 - 30 worked however.