question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publish step returns 406, but tag was pushed to repo

See original GitHub issue

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' }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
antongolubcommented, 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/

0reactions
klichukbcommented, 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting "(406) Not Acceptable" when trying to download a git ...
PS: I am able to download the zip file when I directly hit the $repo url in a browser. EDIT: Updated the Invoke-RestMethod...
Read more >
How to Fix a 406 Error and Find the Source of the Problem
Learn what to do when you see a 406 error. The 406 error not acceptable message has several options for troubleshooting and fixing...
Read more >
Repository tags | Bitbucket Cloud - Atlassian Support
Tags mark a specific commit at a point in your repository history. Learn how to ensure your commits in Bitbucket Cloud appear with...
Read more >
Removals by version - GitLab Documentation
Removals by version. In each release, GitLab removes features that were deprecated in an earlier release. Some features cause breaking changes when they...
Read more >
Engine API v1.24 - Docker Documentation
<image-name>[:<tag>] , <image id> or <image@digest> ); filter - only return images with the specified name. Build image from a Dockerfile. POST /build....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found