Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Repo-updater floods GHE with API requests #60942

Open
@mike-r-mclaughlin

Description

@mike-r-mclaughlin

Details

See also: https://github.com/sourcegraph/sourcegraph/issues/60941
Discussion in Slack Thread, recorded troubleshooting session.

repo-updater seems to be continuously sending requests like this:

{"SeverityText":"ERROR","Timestamp":1709120061200289151,"InstrumentationScope":"repo-updater.UpdateScheduler.RunUpdateLoop","Caller":"repos/scheduler.go:191","Function":"github.com/sourcegraph/sourcegraph/internal/repos.(*UpdateScheduler).runUpdateLoop.func1","Body":"error updating repo","Resource":{"service.name":"repo-updater","service.version":"5.2.1","service.instance.id":"fd2b0393e88e"},"Attributes":{"err":"repo git.exmple.com/org1/repo1:: failed to fetch repo \"git.examle.com/org1/repo1\": exit status 128 - output: \"remote: Repository not found.\\nfatal: repository 'https://git.example.com/org1/repo1/' not found\\n\"","uri":"git.example.com/org1/repo1"}}

and

{"SeverityText":"WARN","Timestamp":1709120061632231040,"InstrumentationScope":"repo-updater.PermsSyncer.syncRepoPerms","Caller":"authz/perms_syncer.go:140","Function":"github.com/sourcegraph/sourcegraph/cmd/repo-updater/internal/authz.(*PermsSyncer).syncRepoPerms","Body":"ignoreUnauthorizedAPIError","Resource":{"service.name":"repo-updater","service.version":"5.2.1","service.instance.id":"fd2b0393e88e"},"Attributes":{"repo":{"ID":285579,"name":"git.example.com/org2/repo2","private":true},"error":"list users for repo: request to https://git.example.com/api/v3/repos/org2/repo2/collaborators?page=1&per_page=100 returned status 404: Not Found","suggestion":"GitHub access token user may only have read access to the repository, but needs write for permissions"}}

(among others) to GHE.

In https://github.com/sourcegraph/accounts/issues/6716, we are seeing ~50k requests every 15 minutes (as measured on GHE). When we shut down the repo-updater container, the requests settle to almost 0. Bringing the container back up causes the requests to spike.

All repos we checked were deleted or had permissions changed longer than 3 months ago.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customerImportant issues reported or desired by a customer.team/sourceTickets under the purview of Source - the one Source to graph it all

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions