Getting 500 response when requesting a single commit with `src=extension` search parameter

Description

Occasionally we’re getting 500 responses when requesting a single commit with src=extension search parameter included.

When we fetch a recent commit without src=extension search parameter we get 200 with commit details. But when we try to fetch the same commit with src=extension search parameter included we get 500 response with the following content: “{“meta”: {“status”: 500}, “error”: {“reason”: “Unknown”, “context”: null}}”.

It seems that it happens mostly on the recent commits. The older ones (e.g. an hour old) seem to work fine.

More details and some screenshots can be found in this comment.

Expected Results

When requesting a single commit with src=extension search parameter we expect getting 200 response if commit data available or 404 when it’s not, I believe.

Actual Results

We’re getting 500 responses from time to time when requesting a single commit with src=extension search parameter included.

Additional Information

Any additional information, configuration, or data that might be necessary to reproduce the issue.

1 Like

@taras-yemets are you able to provide a full URL that hits the 500? At a glance, are you using the API unauthenticated?

Hey @tom :wave:

Thank you for looking into this :slightly_smiling_face:

The URL we use includes the access_token search param, I’ve just removed it from screenshots.

At the moment I’ve been creating this issue https://codecov.io/api/gh/sourcegraph/sourcegraph/commits/c9ee6c86df37ea8a9100448f7d7916be937ac1f2?src=extension&access_token={MY_ACCESS_TOKEN} returned 500. I tried it with and without access_token search parameter and it had no effect. Requesting this URL without src=extension in search parameters resulted in 200 response (see this comment).

Hey team!
Is there anything else I can provide to help you debug this issue?

@taras-yemets sorry for taking a long time to get back to you. I think this should be fixed on our side, I’m able to go to that URL with my access token. Can you see if you’re still running into the issue?

@tom,
yes, the mentioned URL was working for me too when I was creating this issue.

The pattern I identified with this kind of error is the following.

  1. We request a recently pushed single commit without src=extension search parameter and get a 200 response.
  2. We request the same commit with src=extension search parameter and get a 500 error.
  3. After some time (let’s say 10-20min) we repeat the step #2 and it returns a 200 response.
    More on it this comment.

I will post a few examples of failing requests with a time stamp once I get 500 errors.

@tom,
I’ve just reproduced the issue a couple of times:

  1. https://codecov.io/api/gh/sourcegraph/sourcegraph/commits/fcab6d5b5aa34b818aced1d4989d6303e0ae7407?src=extension&access_token={MY_ACCESS_TOKEN}
  1. https://codecov.io/api/gh/sourcegraph/sourcegraph/commits/d50f61dd6bb7b5f8cdc8757f39fc118fd0fa6123?src=extension&access_token={MY_ACCESS_TOKEN}

Then both returned 200 responses at 18:20 UTC+3.