Bors crashing, "Resource not accessible by integration"

bors log

At 4/12/2021, 5:13:04 AM (bors time), we had a successful merge.

At 4/12/2021, 1:13:50 PM (bors time), we have a crash with the report

{{:badmatch,
  {:error, :merge_branch, 403,
   "{\"message\":\"Resource not accessible by integration\",\"documentation_url\":\"https://docs.github.com/rest/reference/repos#merge-a-branch\"}"}},
 [
   {BorsNG.GitHub, :merge_branch!, 2,
    [file: 'lib/github/github.ex', line: 185]},
   {Enum, :"-reduce/3-lists^foldl/2-0-", 3,
    [file: 'lib/enum.ex', line: 2181]},
   {BorsNG.Worker.Batcher, :start_waiting_batch, 1,
    [file: 'lib/worker/batcher.ex', line: 436]},
   {BorsNG.Worker.Batcher, :poll_, 1,
    [file: 'lib/worker/batcher.ex', line: 299]},
   {BorsNG.Worker.Batcher, :handle_info, 2,
    [file: 'lib/worker/batcher.ex', line: 239]},
   {:gen_server, :try_dispatch, 4,
    [file: 'gen_server.erl', line: 689]},
   {:gen_server, :handle_msg, 6,
    [file: 'gen_server.erl', line: 765]},
   {:proc_lib, :init_p_do_apply, 3,
    [file: 'proc_lib.erl', line: 226]}
 ]}

It crashed again when retrying.

Nothing should have changed between the two merges except for the branch being merged.

Unsuccessful merge is Make pest no_std compatible. by 01mf02 · Pull Request #498 · pest-parser/pest (github.com).

I'm going to send a support request to GitHub, to see if they can answer this.

1 Like

I'm seeing a similar crash from bors try on PR: add support of vcpkg with msvc toolchain by lapoigne · Pull Request #79 · georust/proj · GitHub

bors output
{{:badmatch,
  {:error, :merge_branch, 403,
   "{\"message\":\"Resource not accessible by integration\",\"documentation_url\":\"https://docs.github.com/rest/reference/repos#merge-a-branch\"}",
   "CE0E:3BCA:819901:14BD3AD:6079FD80"}},
 [
   {BorsNG.GitHub, :merge_branch!, 2,
    [file: 'lib/github/github.ex', line: 185]},
   {BorsNG.Worker.Attemptor, :start_attempt, 2,
    [file: 'lib/worker/attemptor.ex', line: 204]},
   {BorsNG.Worker.Attemptor, :handle_cast, 2,
    [file: 'lib/worker/attemptor.ex', line: 61]},
   {:gen_server, :try_dispatch, 4,
    [file: 'gen_server.erl', line: 689]},
   {:gen_server, :handle_msg, 6,
    [file: 'gen_server.erl', line: 765]},
   {:proc_lib, :init_p_do_apply, 3,
    [file: 'proc_lib.erl', line: 226]}
 ]}

Is there a better place to report this than here?

In doing some research on similar errors, it seems that PR's with edits to the workflow file are a common source of errors.

In my case, indeed the PR in question has edits to the workflow file.

Yes, I know about that issue. The limitation with GitHub workflows is not going to be fixed. Sorry.

The pull request that @CAD97 was trying to merge did not change any workflow files. That’s what confused me, and prompted a Support request.

A new PR crashed Add Vector to projects using Pest by lucperkins · Pull Request #487 · pest-parser/pest · GitHub and its tiny, but adding new project using pest in readme by mitnk · Pull Request #511 · pest-parser/pest · GitHub which is nearly identical in content merged fine....

more crashes... Sign in to GitHub · GitHub

Hi guys, we suddenly started seeing this 403 error starting October 01. Some PRs fail with 403, some don't, and PRs that don't change workflow files also fail. Even though we've never seen this before (bors always worked for us including in PRs that change GitHub workflow files), we can't figure out why it has suddenly started throwing this error.
I tried generating an installation token manually using bors's private key and JWT and invoking the /merges API manually and I see the same 403 error too for different branches (some of them throw this error, but some don't).
We are running bors on our private repos using Heroku. Could you please advise us how to resolve this? @CAD97 looks like you've experienced the same problem. Did you happen to find the cause or a workaround or any resolution for it at all. Would appreciate any feedback!

It seems like we've managed to solve this by enabling the Workflow read/write permissions on repos.
For anyone who may stumble with this issue, here is what you need to turn on in the Github App's permissions: