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

GitHubError: Validation Failed (422) #50

Open
picosam opened this issue Nov 20, 2017 · 12 comments
Open

GitHubError: Validation Failed (422) #50

picosam opened this issue Nov 20, 2017 · 12 comments
Assignees
Labels
type::support Issues that do not require modifications to a project, such as questions, guidance, etc.

Comments

@picosam
Copy link

picosam commented Nov 20, 2017

Hello, I'm getting the following error when running conventional-github-releaser -p angular

GitHubError: Validation Failed (422)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-project-starter@1.2.0 github-release: `conventional-github-releaser -p angular`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-project-starter@1.2.0 github-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Sammy/.npm/_logs/2017-11-20T16_07_15_550Z-debug.log

Here's the log file in question:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.7.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'github-release' ]
2 info using npm@5.5.1
3 info using node@v8.7.0
4 verbose run-script [ 'pregithub-release', 'github-release', 'postgithub-release' ]
5 info lifecycle angular-project-starter@1.2.0~pregithub-release: angular-project-starter@1.2.0
6 info lifecycle angular-project-starter@1.2.0~github-release: angular-project-starter@1.2.0
7 verbose lifecycle angular-project-starter@1.2.0~github-release: unsafe-perm in lifecycle true
8 verbose lifecycle angular-project-starter@1.2.0~github-release: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Sammy/Projects/angular-project-starter/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle angular-project-starter@1.2.0~github-release: CWD: /Users/Sammy/Projects/angular-project-starter
10 silly lifecycle angular-project-starter@1.2.0~github-release: Args: [ '-c', 'conventional-github-releaser -p angular' ]
11 silly lifecycle angular-project-starter@1.2.0~github-release: Returned: code: 1  signal: null
12 info lifecycle angular-project-starter@1.2.0~github-release: Failed to exec github-release script
13 verbose stack Error: angular-project-starter@1.2.0 github-release: `conventional-github-releaser -p angular`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid angular-project-starter@1.2.0
15 verbose cwd /Users/Sammy/Projects/angular-project-starter
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/Cellar/node/8.7.0/bin/node" "/usr/local/bin/npm" "run" "github-release"
18 verbose node v8.7.0
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error angular-project-starter@1.2.0 github-release: `conventional-github-releaser -p angular`
22 error Exit status 1
23 error Failed at the angular-project-starter@1.2.0 github-release script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
@picosam
Copy link
Author

picosam commented Nov 21, 2017

By the way, when I run echo $CONVENTIONAL_GITHUB_RELEASER_TOKEN from my command line I get my GitHub token correctly!

@hutson hutson added the support label Jan 24, 2018
@hutson
Copy link
Contributor

hutson commented Jan 24, 2018

@picosam can you please provide us a set of steps to reproduce the error? (Some way for us to set up a similar project and environment)

@iamnewton
Copy link

I'm getting this as well. Installed this locally rather than globally. Ran the command as follows:

names have been changed to protect the innocent

CONVENTIONAL_GITHUB_RELEASER_TOKEN=<valid access token> CONVENTIONAL_GITHUB_URL=https://<base URL for GHE>/api/v3/ ./node_modules/.bin/conventional-github-releaser -p angular -r 0

@phun-ky
Copy link

phun-ky commented Jul 31, 2018

Experiencing the same issue. the token is set, checked with echo $CONVENTIONAL_GITHUB_RELEASER_TOKEN

@CanRau
Copy link

CanRau commented Sep 29, 2018

same here, token provided by -t flag

@hutson hutson removed the support label Oct 29, 2018
@dortzur
Copy link

dortzur commented Dec 17, 2018

any updates?

@dortzur
Copy link

dortzur commented Dec 17, 2018

I believe this happens when you already have a release available for that semver version. Updating the semver version in package.json worked for me.

@hutson hutson self-assigned this Dec 20, 2018
@hutson hutson added the type::support Issues that do not require modifications to a project, such as questions, guidance, etc. label Dec 20, 2018
@hutson
Copy link
Contributor

hutson commented Dec 20, 2018

I think @dortzur is correct, but GitHub errors have, in my experience, been cryptic.

We have a debug option now - https://github.com/conventional-changelog/releaser-tools/tree/master/packages/conventional-github-releaser#debugging

@picosam @iamnewton @CanRau can one of y'all please provide us the results of the debug output? (With any sensitive URL information removed)

@francoisromain
Copy link

I tried to regenerate all realeases on this repo: https://github.com/MTES-MCT/camino-flux/releases and I have the same error

the debug info:

± |master → origin ✓| → DEBUG=conventional-github-releaser conventional-github-releaser -p angular -r 0
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n\n', draft: false, name: 'v0.7.3', prerelease: false, tag_name: 'v0.7.3', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +0ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n\n', draft: false, name: 'v0.7.1', prerelease: false, tag_name: 'v0.7.1', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +17ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n### Features\n\n* **api:** ajoute le champs entreprise.etablissements dans le schema graphQL ([d861028](https://github.com/MTES-MCT/camino-ui/commit/d861028))\n\n\n\n', draft: false, name: 'v0.7.0', prerelease: false, tag_name: 'v0.7.0', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +35ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n\n', draft: false, name: 'v0.6.2', prerelease: false, tag_name: 'v0.6.2', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +7ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n### Bug Fixes\n\n* **api:** corrige la structure de la requête GraphQl ([55f2d04](https://github.com/MTES-MCT/camino-ui/commit/55f2d04))\n\n\n\n', draft: false, name: 'v0.6.1', prerelease: false, tag_name: 'v0.6.1', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +16ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n### Features\n\n* supprime le https ([81ee360](https://github.com/MTES-MCT/camino-ui/commit/81ee360))\n\n\n### Reverts\n\n* **https:** remet le hhtps ([b442167](https://github.com/MTES-MCT/camino-ui/commit/b442167))\n\n\n\n', draft: false, name: 'v0.6.0', prerelease: false, tag_name: 'v0.6.0', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +33ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n### Bug Fixes\n\n* typo ([b7eb11b](https://github.com/MTES-MCT/camino-ui/commit/b7eb11b))\n\n\n### Features\n\n* **docker:** ne force pas la redirection vers https ([b7ca060](https://github.com/MTES-MCT/camino-ui/commit/b7ca060))\n* **readme:** ajoute les coordonnées du support technique ([1026506](https://github.com/MTES-MCT/camino-ui/commit/1026506))\n\n\n\n', draft: false, name: 'v0.5.0', prerelease: false, tag_name: 'v0.5.0', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +16ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n### Features\n\n* supprime la liste des flux du readme ([972262e](https://github.com/MTES-MCT/camino-ui/commit/972262e))\n\n\n\n', draft: false, name: 'v0.4.0', prerelease: false, tag_name: 'v0.4.0', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +28ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: '\n\n### Features\n\n* ajoute le contenu du fichier readme.txt ([94844ef](https://github.com/MTES-MCT/camino-ui/commit/94844ef))\n\n\n\n', draft: false, name: 'v0.3.0', prerelease: false, tag_name: 'v0.3.0', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +13ms
  conventional-github-releaser posting { endpoint: 'https://api.github.com/', body: { body: "\n\n### Bug Fixes\n\n* ajoute geometry dans la requête ([3107991](https://github.com/MTES-MCT/camino-ui/commit/3107991))\n* ajoute le dossier public dans git ([6bac399](https://github.com/MTES-MCT/camino-ui/commit/6bac399))\n* change le nom des fichiers exportés ([a80d391](https://github.com/MTES-MCT/camino-ui/commit/a80d391))\n* config docker du serveur de test ([563512b](https://github.com/MTES-MCT/camino-ui/commit/563512b))\n* corrige la structure des coordonnées ([0b823fe](https://github.com/MTES-MCT/camino-ui/commit/0b823fe))\n* décommente les flux des titres dont le statut est échu ([ff6fbe6](https://github.com/MTES-MCT/camino-ui/commit/ff6fbe6))\n* déploiement ([9f7555e](https://github.com/MTES-MCT/camino-ui/commit/9f7555e))\n* déploiement ([2dc106f](https://github.com/MTES-MCT/camino-ui/commit/2dc106f))\n* déploiement ([dda6385](https://github.com/MTES-MCT/camino-ui/commit/dda6385))\n* déploiement ([63ce5e5](https://github.com/MTES-MCT/camino-ui/commit/63ce5e5))\n* déploiement ([fc6ddc1](https://github.com/MTES-MCT/camino-ui/commit/fc6ddc1))\n* geometry ([bf68cf1](https://github.com/MTES-MCT/camino-ui/commit/bf68cf1))\n* insère le tableau dans une propriété FeatureCollection ([c2687c8](https://github.com/MTES-MCT/camino-ui/commit/c2687c8))\n* mise à jour de l'API ([943711d](https://github.com/MTES-MCT/camino-ui/commit/943711d))\n* requête graphql ([c88a2f1](https://github.com/MTES-MCT/camino-ui/commit/c88a2f1))\n* structure du geojson ([0b5d25d](https://github.com/MTES-MCT/camino-ui/commit/0b5d25d))\n\n\n### Features\n\n* affiche les phases ([662b8ea](https://github.com/MTES-MCT/camino-ui/commit/662b8ea))\n* ajout de la surface et du volume ([72e7c7f](https://github.com/MTES-MCT/camino-ui/commit/72e7c7f))\n* ajout des couleurs ([cad1cb8](https://github.com/MTES-MCT/camino-ui/commit/cad1cb8))\n* calcul des dates de début, fin et demande ([387ba5f](https://github.com/MTES-MCT/camino-ui/commit/387ba5f))\n* connection à la nouvelle API ([5bac415](https://github.com/MTES-MCT/camino-ui/commit/5bac415))\n* crée les flux à partir d'un fichier externe ([e3294d2](https://github.com/MTES-MCT/camino-ui/commit/e3294d2))\n* déploiement sur ovh ([8e7e824](https://github.com/MTES-MCT/camino-ui/commit/8e7e824))\n* déploiement sur ovh ([1d9a0d9](https://github.com/MTES-MCT/camino-ui/commit/1d9a0d9))\n* génère des propriétés de geojson à plat (clé, valeur) ([8c139a9](https://github.com/MTES-MCT/camino-ui/commit/8c139a9))\n* génère les fichiers geojson ([2e8e574](https://github.com/MTES-MCT/camino-ui/commit/2e8e574))\n* liste les nouveaux flux ([dea3447](https://github.com/MTES-MCT/camino-ui/commit/dea3447))\n* mise à jour de l'api ([303979d](https://github.com/MTES-MCT/camino-ui/commit/303979d))\n* mise à jour de l'API (arguments au pluriel) ([ad7d8e9](https://github.com/MTES-MCT/camino-ui/commit/ad7d8e9))\n* n'affiche pas les titres échus ([29585de](https://github.com/MTES-MCT/camino-ui/commit/29585de))\n\n\n\n", draft: false, name: 'v0.2.0', prerelease: false, tag_name: 'v0.2.0', target_commitish: undefined } } to the following URL - repos/MTES-MCT/camino-ui/releases +73ms
GitHubError: Validation Failed (422)

@francoisromain
Copy link

it works for me now. I am not sure about what solved the problem, but two things chnaged:

  • standard-version was updated from v 5.0.2 to 6.0.1
  • I fixed the url of the repo in package.json which was pointing to a wrong place

@Kikobeats
Copy link

This is happening mainly if you try to create a release that already exists:

curl -X POST https://api.github.com/repos/kikobeats/automate-release/releases -H "Authorization: token GH_TOKEN" \
    -d '{ "tag_name": "v2.0.8", "generate_release_notes: true }'
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}

In that case, the library could fall back into update the release. There is an endpoint for doing that:
https://docs.github.com/en/rest/reference/repos#update-a-release

@thebug404
Copy link

Hello, I'm getting the following error when running conventional-github-releaser -p angular

GitHubError: Validation Failed (422)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-project-starter@1.2.0 github-release: `conventional-github-releaser -p angular`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-project-starter@1.2.0 github-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Sammy/.npm/_logs/2017-11-20T16_07_15_550Z-debug.log

Here's the log file in question:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.7.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'github-release' ]
2 info using npm@5.5.1
3 info using node@v8.7.0
4 verbose run-script [ 'pregithub-release', 'github-release', 'postgithub-release' ]
5 info lifecycle angular-project-starter@1.2.0~pregithub-release: angular-project-starter@1.2.0
6 info lifecycle angular-project-starter@1.2.0~github-release: angular-project-starter@1.2.0
7 verbose lifecycle angular-project-starter@1.2.0~github-release: unsafe-perm in lifecycle true
8 verbose lifecycle angular-project-starter@1.2.0~github-release: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Sammy/Projects/angular-project-starter/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle angular-project-starter@1.2.0~github-release: CWD: /Users/Sammy/Projects/angular-project-starter
10 silly lifecycle angular-project-starter@1.2.0~github-release: Args: [ '-c', 'conventional-github-releaser -p angular' ]
11 silly lifecycle angular-project-starter@1.2.0~github-release: Returned: code: 1  signal: null
12 info lifecycle angular-project-starter@1.2.0~github-release: Failed to exec github-release script
13 verbose stack Error: angular-project-starter@1.2.0 github-release: `conventional-github-releaser -p angular`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid angular-project-starter@1.2.0
15 verbose cwd /Users/Sammy/Projects/angular-project-starter
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/Cellar/node/8.7.0/bin/node" "/usr/local/bin/npm" "run" "github-release"
18 verbose node v8.7.0
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error angular-project-starter@1.2.0 github-release: `conventional-github-releaser -p angular`
22 error Exit status 1
23 error Failed at the angular-project-starter@1.2.0 github-release script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Suggestion

In my particular case, I experienced this problem because when executing the command conventional-github-releaser -p angular -r 0, no message appeared providing information on whether the release was completed successfully or not. Due to this, I re-executed the command and an error appeared.

It would be great if the developers added feedback on the operations. It would be very helpful. 🫶

Solution

The error "GitHubError: Validation Failed (422)" occurs when the release version already exists on GitHub or when the repository URL is invalid in the package.json.

To solve this error, you can try the following:

  1. Verify that the release version does not exist on GitHub.
  2. Verify that the repository URL is valid in the package.json .
  3. Create a new token and select the public_repo scope (or repo to access private repositories). Run the following command to set the token as an environment variable: export CONVENTIONAL_GITHUB_RELEASER_TOKEN=<MY_TOKEN>
  4. Run the command conventional-github-releaser -p angular -r 0

By following these steps, you should resolve your problem. I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::support Issues that do not require modifications to a project, such as questions, guidance, etc.
Development

No branches or pull requests

9 participants