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.

Release fails when adding "release" labels. Error 422.

See original GitHub issue

Hello,

I’m not sure which version introduced this issue, but I know it happens as far back as 5.2.1 for me (It happened on 5.2.5 and 5.2.6).

I’m seeing the following only when PRs are merged:

[14:14:30] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #538: https://github.enterprise.com/ORG/plugin-cli/pull/538#issuecomment-518258
[14:14:33] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #539: https://github.enterprise.com/ORG/plugin-cli/pull/539#issuecomment-518259
[14:14:36] [semantic-release] [@semantic-release/github] › ℹ  Added comment to issue #541: https://github.enterprise.com/ORG/plugin-cli/pull/541#issuecomment-518260
[14:15:06] [semantic-release] [@semantic-release/github] › ✖  Failed to add a comment to the issue #538.
[14:15:09] [semantic-release] [@semantic-release/github] › ✖  Failed to add a comment to the issue #539.
[14:15:12] [semantic-release] [@semantic-release/github] › ✖  Failed to add a comment to the issue #541.
  semantic-release:github found semantic-release issues: [] +42s
[14:15:12] [semantic-release] › ✖  Failed step "success" of plugin "@semantic-release/github"
[14:15:12] [semantic-release] › ✖  An error occurred while running semantic-release: { HttpError: Invalid request.

For 'links/2/schema', {"labels"=>["released"]} is not an array.
    at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  name: 'HttpError',
  status: 422,
  headers: 
   { 'access-control-allow-origin': '*',
     'access-control-expose-headers': 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
     connection: 'close',
     'content-length': '209',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Fri, 14 Dec 2018 14:15:06 GMT',
     server: 'GitHub.com',
     status: '422 Unprocessable Entity',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'x-accepted-oauth-scopes': '',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-enterprise-version': '2.12.22',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'b067d086-6b6f-4824-92d1-c0791379a377',
     'x-oauth-scopes': 'admin:public_key, public_repo, repo:status',
     'x-runtime-rack': '0.023969',
     'x-xss-protection': '1; mode=block' },
  request: 
   { method: 'POST',
     url: 'https://github.enterprise.com/api/v3/repos/ORG/plugin-cli/issues/538/labels',
     headers: 
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.2.0 Node.js/8.14.0 (Linux 3.13; x64)',
        authorization: 'token [secure]',
        'content-type': 'application/json; charset=utf-8' },
     body: '{"labels":["released"]}',
     request: { validate: [Object] } },
  documentation_url: 'https://developer.github.com/enterprise/2.12/v3/issues/labels/#add-labels-to-an-issue',
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
[14:15:12] [semantic-release] › ✖  An error occurred while running semantic-release: { HttpError: Invalid request.

For 'links/2/schema', {"labels"=>["released"]} is not an array.
    at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  name: 'HttpError',
  status: 422,
  headers: 
   { 'access-control-allow-origin': '*',
     'access-control-expose-headers': 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
     connection: 'close',
     'content-length': '209',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Fri, 14 Dec 2018 14:15:09 GMT',
     server: 'GitHub.com',
     status: '422 Unprocessable Entity',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'x-accepted-oauth-scopes': '',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-enterprise-version': '2.12.22',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'c63d49e8-b108-43ce-9a88-b616e1fa3281',
     'x-oauth-scopes': 'admin:public_key, public_repo, repo:status',
     'x-runtime-rack': '0.029809',
     'x-xss-protection': '1; mode=block' },
  request: 
   { method: 'POST',
     url: 'https://github.enterprise.com/api/v3/repos/ORG/plugin-cli/issues/539/labels',
     headers: 
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.2.0 Node.js/8.14.0 (Linux 3.13; x64)',
        authorization: 'token [secure]',
        'content-type': 'application/json; charset=utf-8' },
     body: '{"labels":["released"]}',
     request: { validate: [Object] } },
  documentation_url: 'https://developer.github.com/enterprise/2.12/v3/issues/labels/#add-labels-to-an-issue',
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
[14:15:12] [semantic-release] › ✖  An error occurred while running semantic-release: { HttpError: Invalid request.

For 'links/2/schema', {"labels"=>["released"]} is not an array.
    at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  name: 'HttpError',
  status: 422,
  headers: 
   { 'access-control-allow-origin': '*',
     'access-control-expose-headers': 'ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
     connection: 'close',
     'content-length': '209',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Fri, 14 Dec 2018 14:15:12 GMT',
     server: 'GitHub.com',
     status: '422 Unprocessable Entity',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'x-accepted-oauth-scopes': '',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-enterprise-version': '2.12.22',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'bfcc035e-b3a3-4bbb-8ea7-c5207ade3b3d',
     'x-oauth-scopes': 'admin:public_key, public_repo, repo:status',
     'x-runtime-rack': '0.024596',
     'x-xss-protection': '1; mode=block' },
  request: 
   { method: 'POST',
     url: 'https://github.enterprise.com/api/v3/repos/ORG/plugin-cli/issues/541/labels',
     headers: 
      { accept: 'application/vnd.github.v3+json',
        'user-agent': 'octokit.js/16.2.0 Node.js/8.14.0 (Linux 3.13; x64)',
        authorization: 'token [secure]',
        'content-type': 'application/json; charset=utf-8' },
     body: '{"labels":["released"]}',
     request: { validate: [Object] } },
  documentation_url: 'https://developer.github.com/enterprise/2.12/v3/issues/labels/#add-labels-to-an-issue',
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
{ AggregateError: 
    HttpError: Invalid request.
    For 'links/2/schema', {"labels"=>["released"]} is not an array.
        at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
        at <anonymous>
    HttpError: Invalid request.
    For 'links/2/schema', {"labels"=>["released"]} is not an array.
        at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
        at <anonymous>
    HttpError: Invalid request.
    For 'links/2/schema', {"labels"=>["released"]} is not an array.
        at response.text.then.message (/home/circleci/project/node_modules/@octokit/request/lib/request.js:55:27)
        at <anonymous>
    at /home/circleci/project/node_modules/semantic-release/lib/plugins/pipeline.js:53:11
    at <anonymous> name: 'AggregateError' }error Command failed with exit code 1.
    at <anonymous> name: 'AggregateError' }error Command failed with exit code 1.

My config looks like:

➜ node release.config.js
config : {"prepare":["@semantic-release/npm","@semantic-release/git"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/npm",["@semantic-release/github",{"releasedLabels":false}]]}

Any help or direction on how to fix this would be wonderful. I’m not sure when it started, but it is making it hard to release continuously.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pvdlgcommented, Dec 20, 2018

I just added 5.2.7 to @latest

1reaction
Aghassicommented, Dec 14, 2018

For now, what I have gone and done is the following in package.json and updated my yarn.lock

  "resolutions": {
    "semantic-release/@semantic-release/github": "5.2.1"
  },

Not a perfect solution, but it unblocks us until this stuff is figured out. It is interesting because even though I specified that version as a devDependency, semantic-release brings it’s own in which is a ^ semver and grabs the latest, which is breaking. Also interesting is that it doesn’t use the one I provide, it uses the one it brings in. So even though I thought that I had a pinned version, I really didn’t.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 422 The change you requested was rejected on login
422 The change you requested was rejected. Make sure you have access to the thing you tried to change. Please contact your GitLab...
Read more >
How To Fix the HTTP 422 Error - Kinsta
Error 422 is an HTTP code that tells you that the server can't process your request, although it understands it. The full name...
Read more >
HTTP Error 422 - Anaplan Community
The 422 error means Anaplan received the request and the request was in the right format, but it couldn't process the request. In...
Read more >
422 Error when making POST Request to Favorite Courses API
I am working some custom Javascript that needs to be able to add and remove favorite courses for users through the Canvas API....
Read more >
Content Management API Docs | Contentstack
The API version (in our case, 'v3') can be found in the URL, ... Contentstack returns the 422 HTTP status code for an...
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