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

GitHub Enterprise Server: context.github.graphql() fails with 406 #1386

Closed
gr2m opened this issue Oct 20, 2020 · 2 comments · Fixed by octokit/core.js#221
Closed

GitHub Enterprise Server: context.github.graphql() fails with 406 #1386

gr2m opened this issue Oct 20, 2020 · 2 comments · Fixed by octokit/core.js#221

Comments

@gr2m
Copy link
Contributor

gr2m commented Oct 20, 2020

Bug Report

Current Behavior

When sending a GraphQL Query before sending any other request in an event handler, Probot sends a request to [GHE_HOST]/api/app/installations/[installation id]/access_tokens instead of [GHE_HOST]/api/v3/app/installations/[installation id]/access_tokens. The GHES instance responds with a 406 error

module.exports = (app) => {
  app.on("push", ({ github }) => {
    await github.graphql(`query { 
      viewer { 
        login
      }
    }`)
  });
};

See ttps://probot-talk.slack.com/archives/C6S4FC8AF/p1603208624022600 /cc @pjbreaux

Environment

  • Probot version(s): 10.9.3
  • GitHub Enterprise Server
@gr2m
Copy link
Contributor Author

gr2m commented Oct 20, 2020

Here is a test case to reproduce the problem with the underlying @octokit libraries:
https://runkit.com/gr2m/probot-probot-1386

RunKit notebooks are interactive javascript playgrounds connected to a complete node environment right in your browser. Every npm module pre-installed.

@gr2m
Copy link
Contributor Author

gr2m commented Oct 20, 2020

You'll have to update your dependency tree in order to get the latest version of @octokit/core (3.1.3). When in doubt, try rm -rf package-lock.json node_modules && npm install

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