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

Publish step returns 406, but tag was pushed to repo #161

Closed
brooksjbr opened this issue Feb 12, 2019 · 5 comments
Closed

Publish step returns 406, but tag was pushed to repo #161

brooksjbr opened this issue Feb 12, 2019 · 5 comments

Comments

@brooksjbr
Copy link

I'm seeing an unexpected behavior during the publish step. I'm running a Jenkins job against Enterprise github. semantic-release is calculating the correct version based on the commit message and pushes a tag. GH responds with 406, the build fails, but the tag is successfully pushed to the repo.

What I understand 406 "Not Acceptable" to be is response given in place of a more cryptic one.
I can successfully generate and push a tag via the Jenkins job with git commands. Any ideas what the issue might be?

Config
"repository": {
  "type": "git",
  "url": "git@[enterprise.company.com]:[path]/[repo-name].git"
},
"keywords": ["fix", "feat", "chore"],
"release": {
  "analyzeCommits": "@semantic-release/commit-analyzer",
  "verifyConditions": "@semantic-release/npm",
  "generateNotes": "@semantic-release/release-notes-generator",
  "prepare": "@semantic-release/npm",
  "publish": "@semantic-release/github",
  "success": false,
  "fail": false,
  "branch": "origin/dev",
  "npmPublish": false
}
Job log
[14:24:31] [semantic-release] Created tag v0.15.1
[14:24:31] [semantic-release] Start step "publish" of plugin "@semantic-release/github"
[14:24:31] [semantic-release] [@semantic-release/github] Verify GitHub authentication (https://[enterprise.company.com])
[14:24:40] [semantic-release] » ×  Failed step "publish" of plugin "@semantic-release/github"

[14:24:40] [semantic-release]  An error occurred while running semantic-release: { HttpError
    at response.text.then.message (C:\Jenkins\jobs\semver-pipeline\workspace\node_modules\@octokit\request\lib\request.js:55:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  name: 'HttpError',
  status: 406,
  headers: 
   { 'cache-control': 'no-cache, no-store',
     connection: 'close',
     'content-security-policy': 'default-src \'none\'; base-uri \'self\'; block-all-mixed-content; connect-src \'self\' [enterprise.company.com] status.github.com wss://[enterprise.company.com]; font-src 
\'self\'; form-action \'self\' [enterprise.company.com]; frame-ancestors \'none\'; frame-src \'self\'; img-src * data:; manifest-src \'self\'; media-src \'none\'; script-src \'self\'; style-src 
\'unsafe-inline\' \'self\'',
     'content-type': 'text/html; charset=utf-8',
     date: 'Mon, 11 Feb 2019 19:24:41 GMT',
     'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
     server: 'GitHub.com',
     'set-cookie': 'has_recent_activity=1; path=/; expires=Mon, 11 Feb 2019 20:24:41 -0000, _fi_sess=MDEyOEZ5NXFTQ0tkK1dsZmMybk5Sa2FuL0RldldCY2RDbXZ3aVJYR0h3VzhmUDJxeUNDUVJTblFpNWRwcWNuMGtycXB
FcjV3Q1NVM1NwOFJTWldIRExnVTNTM2hNVG8xRDhUL1AyaitXUWZPNTdEeTJicEMyNE5vaXhUaFhtaklBQXFKNHE0RWN4OVdwbU01VEVJQzh3VjY1MGZDN01ubGpwMmlsbGJhNVM5QlRUK2pUaXNiamNtdCt5UzNTdVcyMmczOEFERE9XNCtHRmo5TzdSOWd
xeGVrTEVUOE5pcGpkTzZBcXhIc3FkQjlrbVE4OGVGeFhyaUpuQlYrMnFnK0hEVHk3dXI0YUx5eFVta0p5OXJNa3VuREhneXZsUUEzQlZiaVdjczNVNjQ4S1puQlMxSVAwalhQUzlMMDVPUkQtLXluNE1wQmh5eG9nY0hQbEVuQkQrcnc9PQ%3D%3D--c1b2e
f457aca21057a2f756d139bdf1db40dfd3d; path=/; secure; HttpOnly',
     status: '406 Not Acceptable',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'transfer-encoding': 'chunked',
     vary: 'X-PJAX',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-request-id': '6c023ef4-b4e1-4891-9ff2-7e0d4522e23d',
     'x-request-id': '1f966a6e-d362-4d1d-a253-80c5882a5a5d',
     'x-runtime': '0.008736',
     'x-runtime-rack': '0.013532',
     'x-xss-protection': '1; mode=block' },
  request: 
   { method: 'GET',
     url: 'https://[enterprise.company.com]/repos/[path]/[repo-name]',
     headers: 
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.13.3 Node.js/8.11.3 (Windows Server 2012; x64)',
        authorization: 'token [secure]' },
     request: { agent: undefined, validate: [Object] } },
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
@gr2m
Copy link
Member

gr2m commented Feb 12, 2019

What GHE version is it? I’m not 100%, but a 406 response suggest a problem with the accept header I think? The request that cause the 406 is

GET https://[enterprise.company.com]/repos/[path]/[repo-name]
Accept: application/vnd.github.v3+json
User-Agent: octokit.js/16.13.3 Node.js/8.11.3 (Windows Server 2012; x64)
Authorization: token [secure]

Could you check with support@github.com if they have an idea? Send the the request above along with the GHE version

@brooksjbr
Copy link
Author

@gr2m Thanks for the response. Will check with GH support and share what I find here.

@pvdlg
Copy link
Member

pvdlg commented Feb 27, 2019

Closing as no feedback was provided. Please re-open if the issue persist and provide the info requested.

@pvdlg pvdlg closed this as completed Feb 27, 2019
@antongolub
Copy link

antongolub commented Apr 6, 2020

I've also faced with this issue. In my case it was related to header handling and fixed by adding proper context path to GH_URL.
https://company.github.comhttps://company.github.com/api/v3/

@klichukb
Copy link

klichukb commented May 7, 2020

Has anyone contacted support about this?
https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/
Why do they have a warning and a "preview" header requirement above the "/login/oauth/access_token" endpoint?

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

5 participants