semantic-release / semantic-release/github

ReleaseAsset: already_exists

Open
#295 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
534
Forks
150
Avg merge
1m
Merged PRs (30d)
3

Description

I'm having issues when trying to publish on one of my projects. Error code below:

[10:32:03 PM] [semantic-release] » ×  An error occurred while running semantic-release: { HttpError: Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"}
    at response.text.then.message (C:\Users\appveyor\AppData\Roaming\npm\node_modules\semantic-release\node_modules\@octokit\request\dist-node\index.js:66:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HttpError',
  status: 422,
  headers:
   { 'cache-control': 'no-cache',
     connection: 'close',
     'content-length': '204',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Tue, 10 Nov 2020 22:32:03 GMT',
     'strict-transport-security': 'max-age=31557600',
     vary: 'Accept-Encoding, Accept, X-Requested-With',
     'x-accepted-oauth-scopes': 'repo',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'E37F:7F3E:DC8D:FF81:5FAB14E2',
     'x-oauth-scopes': 'public_repo',
     'x-xss-protection': '1; mode=block' },
  request:
   { method: 'POST',
     url:
      'https://uploads.github.com/repos/MidLevel/Ruffles/releases/33757811/assets?name=net35.zip&',
     headers:
      { accept: 'application/vnd.github.v3+json',
        'user-agent':
         'octokit-rest.js/17.11.2 octokit-core.js/2.5.4 Node.js/10.22.0 (Windows Server 2016; ia32)',
        'content-type': 'application/zip',
        'content-length': 52529,
        authorization: 'token [REDACTED]' },
     body:
      <Buffer 50 4b 03 04 14 00 00 00 08 00 d9 b3 6a 51 0c 85 bd d1 70 8d 00 00 00 94 01 00 0b 00 00 00 52 75 66 66 6c 65 73 2e 64 6c 6c d4 1d 09 78 54 c5 f9 ed db ... >,
     request: { agent: undefined, hook: [Function: bound bound register] } },
  request_id: 'E37F:7F3E:DC8D:FF81:5FAB14E2',
  documentation_url: 'https://docs.github.com/rest',
  errors:
   [ { resource: 'ReleaseAsset',
       code: 'already_exists',
       field: 'name' } ],
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
{ HttpError: Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"}
    at response.text.then.message (C:\Users\appveyor\AppData\Roaming\npm\node_modules\semantic-release\node_modules\@octokit\request\dist-node\index.js:66:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HttpError',
  status: 422,
  headers:
   { 'cache-control': 'no-cache',
     connection: 'close',
     'content-length': '204',
     'content-security-policy': 'default-src \'none\'',
     'content-type': 'application/json; charset=utf-8',
     date: 'Tue, 10 Nov 2020 22:32:03 GMT',
     'strict-transport-security': 'max-age=31557600',
     vary: 'Accept-Encoding, Accept, X-Requested-With',
     'x-accepted-oauth-scopes': 'repo',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-github-media-type': 'github.v3; format=json',
     'x-github-request-id': 'E37F:7F3E:DC8D:FF81:5FAB14E2',
     'x-oauth-scopes': 'public_repo',
     'x-xss-protection': '1; mode=block' },
  request:
   { method: 'POST',
     url:
      'https://uploads.github.com/repos/MidLevel/Ruffles/releases/33757811/assets?name=net35.zip&',
     headers:
      { accept: 'application/vnd.github.v3+json',
        'user-agent':
         'octokit-rest.js/17.11.2 octokit-core.js/2.5.4 Node.js/10.22.0 (Windows Server 2016; ia32)',
        'content-type': 'application/zip',
        'content-length': 52529,
        authorization: 'token [REDACTED]' },
     body:
      <Buffer 50 4b 03 04 14 00 00 00 08 00 d9 b3 6a 51 0c 85 bd d1 70 8d 00 00 00 94 01 00 0b 00 00 00 52 75 66 66 6c 65 73 2e 64 6c 6c d4 1d 09 78 54 c5 f9 ed db ... >,
     request: { agent: undefined, hook: [Function: bound bound register] } },
  request_id: 'E37F:7F3E:DC8D:FF81:5FAB14E2',
  documentation_url: 'https://docs.github.com/rest',
  errors:
   [ { resource: 'ReleaseAsset',
       code: 'already_exists',
       field: 'name' } ],
  attemptNumber: 4,
  retriesLeft: 0,
  pluginName: '@semantic-release/github' }
Command exited with code 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report points to @semantic-release/github uploading net35.zip through the GitHub release-assets endpoint; start by tracing that upload path and the repeated POST shown in the error. Reproduce a release where the asset name already exists, then verify the behavior when GitHub returns the ReleaseAsset/already_exists validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, javascript, node.js
Domain
api, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.