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.

Error: Validation Failed

See original GitHub issue

I’m getting a Validation Failed notification bubble every time I try to submit a pull request.

Here’s the output in the Output panel for the GitHub plugin:

GET https://api.github.com/repos/node-facebook/facebook-node-sdk 
GET https://api.github.com/repos/node-facebook/facebook-node-sdk/pulls?state=open 
Create pull request on branch 'type-errors' 
pull request body: {
 "sourceBranch": "type-errors",
 "targetBranch": "master",
 "title": "Throw a TypeError when passing bad arguments to FB.api",
 "body": "Instead of logging to the console and returning undefined."
}
git config --local --get remote.origin.url
GET https://api.github.com/repos/node-facebook/facebook-node-sdk 
POST https://api.github.com/repos/node-facebook/facebook-node-sdk/pulls 
422 Validation Failed 
Create pull request error: {
 "url": "https://api.github.com/repos/node-facebook/facebook-node-sdk/pulls",
 "status": 422,
 "statusText": "Unprocessable Entity",
 "headers": {
  "_headers": {
   "server": [
    "GitHub.com"
   ],
   "date": [
    "Mon, 02 Apr 2018 02:14:15 GMT"
   ],
   "content-type": [
    "application/json; charset=utf-8"
   ],
   "content-length": [
    "184"
   ],
   "connection": [
    "close"
   ],
   "status": [
    "422 Unprocessable Entity"
   ],
   "x-ratelimit-limit": [
    "5000"
   ],
   "x-ratelimit-remaining": [
    "4941"
   ],
   "x-ratelimit-reset": [
    "1522638253"
   ],
   "x-oauth-scopes": [
    "repo"
   ],
   "x-accepted-oauth-scopes": [
    ""
   ],
   "x-github-media-type": [
    "github.v3; format=json"
   ],
   "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"
   ],
   "access-control-allow-origin": [
    "*"
   ],
   "strict-transport-security": [
    "max-age=31536000; includeSubdomains; preload"
   ],
   "x-frame-options": [
    "deny"
   ],
   "x-content-type-options": [
    "nosniff"
   ],
   "x-xss-protection": [
    "1; mode=block"
   ],
   "referrer-policy": [
    "origin-when-cross-origin, strict-origin-when-cross-origin"
   ],
   "content-security-policy": [
    "default-src 'none'"
   ],
   "x-runtime-rack": [
    "0.123812"
   ],
   "x-github-request-id": [
    "FCB2:41C8:212F62B:447666E:5AC191F7"
   ]
  }
 },
 "ok": false,
 "body": {
  "_readableState": {
   "objectMode": false,
   "highWaterMark": 16384,
   "buffer": {
    "head": null,
    "tail": null,
    "length": 0
   },
   "length": 0,
   "pipes": null,
   "pipesCount": 0,
   "flowing": true,
   "ended": true,
   "endEmitted": true,
   "reading": false,
   "sync": false,
   "needReadable": false,
   "emittedReadable": false,
   "readableListening": false,
   "resumeScheduled": false,
   "defaultEncoding": "utf8",
   "ranOut": false,
   "awaitDrain": 0,
   "readingMore": false,
   "decoder": null,
   "encoding": null
  },
  "readable": false,
  "domain": null,
  "_events": {},
  "_eventsCount": 3,
  "_writableState": {
   "objectMode": false,
   "highWaterMark": 16384,
   "needDrain": false,
   "ending": true,
   "ended": true,
   "finished": true,
   "decodeStrings": true,
   "defaultEncoding": "utf8",
   "length": 0,
   "writing": false,
   "corked": 0,
   "sync": false,
   "bufferProcessing": false,
   "writecb": null,
   "writelen": 0,
   "bufferedRequest": null,
   "lastBufferedRequest": null,
   "pendingcb": 0,
   "prefinished": true,
   "errorEmitted": false,
   "bufferedRequestCount": 0,
   "corkedRequestsFree": {
    "next": null,
    "entry": null
   }
  },
  "writable": false,
  "allowHalfOpen": true,
  "_transformState": {
   "needTransform": false,
   "transforming": false,
   "writecb": null,
   "writechunk": null,
   "writeencoding": "buffer"
  }
 },
 "bodyUsed": true,
 "size": 0,
 "timeout": 0,
 "_raw": [
  {
   "type": "Buffer",
   "data": [
    123,
    34,
    109,
    101,
    115,
    115,
    97,
    103,
    101,
    34,
    58,
    34,
    86,
    97,
    108,
    105,
    100,
    97,
    116,
    105,
    111,
    110,
    32,
    70,
    97,
    105,
    108,
    101,
    100,
    34,
    44,
    34,
    101,
    114,
    114,
    111,
    114,
    115,
    34,
    58,
    91,
    123,
    34,
    114,
    101,
    115,
    111,
    117,
    114,
    99,
    101,
    34,
    58,
    34,
    80,
    117,
    108,
    108,
    82,
    101,
    113,
    117,
    101,
    115,
    116,
    34,
    44,
    34,
    102,
    105,
    101,
    108,
    100,
    34,
    58,
    34,
    104,
    101,
    97,
    100,
    34,
    44,
    34,
    99,
    111,
    100,
    101,
    34,
    58,
    34,
    105,
    110,
    118,
    97,
    108,
    105,
    100,
    34,
    125,
    93,
    44,
    34,
    100,
    111,
    99,
    117,
    109,
    101,
    110,
    116,
    97,
    116,
    105,
    111,
    110,
    95,
    117,
    114,
    108,
    34,
    58,
    34,
    104,
    116,
    116,
    112,
    115,
    58,
    47,
    47,
    100,
    101,
    118,
    101,
    108,
    111,
    112,
    101,
    114,
    46,
    103,
    105,
    116,
    104,
    117,
    98,
    46,
    99,
    111,
    109,
    47,
    118,
    51,
    47,
    112,
    117,
    108,
    108,
    115,
    47,
    35,
    99,
    114,
    101,
    97,
    116,
    101,
    45,
    97,
    45,
    112,
    117,
    108,
    108,
    45,
    114,
    101,
    113,
    117,
    101,
    115,
    116,
    34,
    125
   ]
  }
 ],
 "_abort": false,
 "_bytes": 184
}
Validation Failed
Error: Validation Failed
	at Object.<anonymous> (/Users/daniel/.vscode/extensions/KnisterPeter.vscode-github-0.27.1/out/src/provider/github/api.js:107:23)
	at Generator.next (<anonymous>)
	at fulfilled (/Users/daniel/.vscode/extensions/KnisterPeter.vscode-github-0.27.1/out/src/provider/github/api.js:13:58)
	at <anonymous>
	at process._tickDomainCallback (internal/process/next_tick.js:135:7)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dantmancommented, Apr 2, 2018

This also appears to be trying to create pull requests for an old version of the API. v3 uses different parameters.

For my use I think the correct pattern would be:

  • Offer options to create a pull request for the current branch or for another branch
  • If you don’t already have the proper ref name for the current branch refs/heads/type-errors use git symbolic-ref -q HEAD head to get it
  • Use git for-each-ref --format='%(upstream)' 'refs/heads/type-errors' to get the upstream for this ref refs/remotes/dantman/type-errors
  • This tells you that the correct remote name for the source of the PR is dantman
  • Use git config --local --get remote.dantman.url to get the repo for the dantman remote, instead of for origin
  • This will tell you that the head for creating a pull request is dantman:type-errors (the username from the remote url + the branch name from the upstream ref)
  • For the explicit option ask me what remote/branch the branch should be pulled in to and use that as the GitHub repo URL and base
  • For the (quick) “same repo” command use the dantman remote that the upstream is targeting and use the branch named as default_branch in the GitHub API as the base
  • For a new (quick) “parent repo” command use parent of the dantman remote that the upstream belongs to, which in this case is node-facebook as the target repo To find the presumed branch to merge into I believe this algorithim will work
    • Figure out which of the remote urls points to the origin, in this case origin
    • Use git for-each-ref --format "%(refname)" refs/remotes/origin to find a list of branches on that remote, in this case (refs/remotes/origin/1.1.x, refs/remotes/origin/HEAD, refs/remotes/origin/azure, refs/remotes/origin/master, refs/remotes/origin/samples)
    • For each branch, excluding the HEAD (in this case refs/remotes/origin/HEAD) use git show --no-patch --format=format:%cI $(git show-branch --merge-base "$REF") to get the date of the latest common commit between that branch and the current one in ISO format
    • Use the remote branch with the most recent date as the target branch, in this case the base will be master
0reactions
KnisterPetercommented, Jun 26, 2018

The part which is not resolved now is this:

  • For a new (quick) “parent repo” command use parent of the dantman remote that the upstream belongs to, which in this case is node-facebook as the target repo To find the presumed branch to merge into I believe this algorithim will work
    • Figure out which of the remote urls points to the origin, in this case origin
    • Use git for-each-ref --format "%(refname)" refs/remotes/origin to find a list of branches on that remote, in this case (refs/remotes/origin/1.1.x, refs/remotes/origin/HEAD, refs/remotes/origin/azure, refs/remotes/origin/master, refs/remotes/origin/samples)
    • For each branch, excluding the HEAD (in this case refs/remotes/origin/HEAD) use git show --no-patch --format=format:%cI $(git show-branch --merge-base "$REF") to get the date of the latest common commit between that branch and the current one in ISO format
    • Use the remote branch with the most recent date as the target branch, in this case the base will be master

Right now there is no “quick parent repo” command. So I guess this should be moved to its own issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[error]Validation Failed Why does this error happen? · Issue #41
This my workflow yaml. I think there is no error. But it always fails. Someone can help me ? Thanks. # on: #...
Read more >
Data validation failure - IBM
Data validation fails can fail if a customer provides invalid input. In such a scenario, Sterling Configurator enables a customer to identify it...
Read more >
Unable to create github releases: Error: Validation Failed
I can see all my Repositories in the GitHubRelease@0 Task GUI (screenshot attached). But, it fails if I don't select "repositoryName: ...
Read more >
Error: Validation failed When Create SQL Database
An error occurred when I am trying to create SQL database in Azure. "code": "InvalidDeploymentParameterValue", "message": "The value of ...
Read more >
User receive only "Validation Failed" error message on the ...
Oracle Web Applications Desktop Integrator - Version 12.2 to 12.2.9 [Release 12.2]: User receive only "Validation Failed" error message on ...
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