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

createComment() results in github 500 response code #921

Closed
chrishiestand opened this issue Apr 25, 2019 · 3 comments

Comments

@chrishiestand
Copy link
Contributor

commented Apr 25, 2019

Bug Report

Current Behavior
When creating an issue comment with probot, the probot http client gets a 500 from github. Strangely, the comment is actually created on the GH issue despite the 500. As a result, probot will automatically retry and the comment ends up being posted four times total.

I'm including a deprecation message, and I'm not sure if that's related.

  const issueComment = context.issue({body: "text here"});
  try {
    await context.github.issues.createComment(issueComment);
  } catch (err) {
    console.error(err);
  }

The HTTP header x-github-request-id is included below if that helps to diagnose what's going on.

{ Deprecation: [@octokit/rest] "number" parameter is deprecated for ".issues.createComment()". Use "issue_number" instead
at Object.keys.forEach.key (/app/node_modules/probot/node_modules/@octokit/rest/plugins/register-endpoints/register-endpoints.js:73:26)
at Array.forEach ()
at Object.patchedMethod [as createComment] (/app/node_modules/probot/node_modules/@octokit/rest/plugins/register-endpoints/register-endpoints.js:69:26)
at commentUpdate (/app/src/probot-app.js:164:50) name: 'Deprecation' }
{ HttpError
at response.text.then.message (/app/node_modules/@octokit/request/lib/request.js:56:27)
at process._tickCallback (internal/process/next_tick.js:68:7)
name: 'HttpError',
status: 500,
headers:
{ 'access-control-allow-origin': '*',
'access-control-expose-headers':
'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type',
connection: 'close',
'content-length': '0',
'content-security-policy': 'default-src 'none'',
'content-type': 'application/json; charset=utf-8',
date: 'Thu, 25 Apr 2019 19:43:25 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
status: '500 Internal Server Error',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': '57D0:3C50:3525F6:40A92A:5CC20DDC',
'x-ratelimit-limit': '5000',
'x-ratelimit-remaining': '4996',
'x-ratelimit-reset': '1556224987',
'x-xss-protection': '1; mode=block' },
request:
{ method: 'POST',
url:
'https://api.github.com/repos/chrishiestand/my-private-repo/issues/1/comments',
headers:
{ accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit.js/16.25.0 Node.js/10.15.3 (Linux 4.15; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8' },
body:
'{"body":"text here"}',
request:
{ validate: [Object], retries: 3, retryAfter: 16, retryCount: 4 } } }

Expected behavior/code
I expect the http response to be 2xx and the comment to only be created once. Or I expect a 500 response with no comment created at all.

Environment

  • Probot version(s):v9.2.8
  • Node/npm version: node 10.15.3
  • OS: Linux 4.15 (via docker)

Additional context/Screenshots
I unfortunately do not have a ready to share reproduction case since I'm deep in prototype land. I'm using probot in programmatic start mode (probot/friction#8), just in case that might make a difference.

@issue-label-bot issue-label-bot bot added the bug 🐞 label Apr 25, 2019

@issue-label-bot

This comment has been minimized.

Copy link

commented Apr 25, 2019

Issue-Label Bot is automatically applying the label bug 🐞 to this issue, with a confidence of 0.91. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@chrishiestand chrishiestand changed the title createComment() results in github 500 code createComment() results in github 500 response code Apr 25, 2019

@stale

This comment has been minimized.

Copy link

commented Jun 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 25, 2019

@chrishiestand

This comment has been minimized.

Copy link
Contributor Author

commented Jun 25, 2019

I'm no longer using this codepath, so I'm not sure if the issue still exists or not. Closing for now. If anyone has the same issue, feel free to re-open or open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.