Skip to content

Failed to fetch all projects visible in https://xxxx.com. Query timeout was reached #162

Closed

Description

@j14ncn

The gitlab version has been upgraded to 16.3.9, and sourcebot can't work.

[backend] | 2025-01-15T05:51:09.740Z error: [GitLab] Failed to fetch all projects visible in https://git.xxx.com. Query timeout was reached
[backend] | GitbeakerTimeoutError: Query timeout was reached
[backend] |     at file:///app/node_modules/@gitbeaker/rest/dist/index.mjs:68:15
[backend] |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[backend] |     at async defaultRequestHandler (file:///app/node_modules/@gitbeaker/rest/dist/index.mjs:66:22)
[backend] |     at async getManyMore (file:///app/node_modules/@gitbeaker/core/dist/index.mjs:70:26)
[backend] |     at async measure (file:///app/packages/backend/dist/utils.js:5:18)
[backend] |     at async getGitLabReposFromConfig (file:///app/packages/backend/dist/gitlab.js:24:57)
[backend] |     at async syncConfig (file:///app/packages/backend/dist/main.js:193:37)
[backend] |     at async measure (file:///app/packages/backend/dist/utils.js:5:18)
[backend] |     at async _syncConfig (file:///app/packages/backend/dist/main.js:285:36)
[backend] |     at async main (file:///app/packages/backend/dist/main.js:319:5)

Activity

  1. added
    bug
    on Jan 15, 2025
  2. brendan-kellam commented on Jan 15, 2025

    @brendan-kellam
    Contributor

    Looks like you hit a timeout - Are you also using a token? If not, try using a token since the allowed number of requests will be larger

  3. j14ncn commented on Jan 15, 2025

    @j14ncn
    Author

    yes ,We using token. Use the curl command can get the correct data.

  4. brendan-kellam commented on Jan 15, 2025

    @brendan-kellam
    Contributor

    How many repositories are in your GitLab install? I was mistaken, it's not rate limiting it's a query timeout

  5. j14ncn commented on Jan 15, 2025

    @j14ncn
    Author

    About 6,300 repos. Can we modify the query timeout?

  6. j14ncn commented on Jan 15, 2025

    @j14ncn
    Author
    [backend] |     at async _syncConfig (file:///app/packages/backend/dist/main.js:285:36)
    [backend] |     at async main (file:///app/packages/backend/dist/main.js:319:5)
    [backend] | 2025-01-15T06:06:53.936Z info: [main] Discovered 0 unique repositories from config.
    [backend] | 2025-01-15T06:06:53.937Z info: [main] Synced configuration file /data/config.json in 300.051s
    
  7. brendan-kellam commented on Jan 15, 2025

    @brendan-kellam
    Contributor

    Looking at the gitbeaker docs, it defaults to 5 minutes, but can be modified via the queryTimeout param in the Gitlab client.

    I think we can bump this to something like 30 minutes, which should be sufficient for use cases like yours with a ton of repos.

    I can add that tomorrow, or feel free to open up a PR in the meantime 🤠

  8. j14ncn commented on Jan 15, 2025

    @j14ncn
    Author

    Maybe it's not a query timeout issue, I have another gitlab instance with only 10 repos and it still has a query timeout error.

  9. brendan-kellam commented on Jan 15, 2025

    @brendan-kellam
    Contributor

    Are you hitting the query timeout error with curl?

  10. j14ncn commented on Jan 15, 2025

    @j14ncn
    Author

    time curl -X GET "https://xxx.cn/api/v4/projects?per_page=1000" \ -H "Private-Token: tokens"|jq

    0.08s user 0.03s system 1% cpu 6.210 total

  11. j14ncn commented on Jan 15, 2025

    @j14ncn
    Author

    We modify packages/backend/src/gitlab.ts:21 queryTimeout: 600000 and it seems to be working fine.

  12. huaying commented on Jul 20, 2025

    @huaying

    We had the same issue. Is it possible to allow user to customize the config?

  13. brendan-kellam commented on Jul 20, 2025

    @brendan-kellam
    Contributor

    @j14ncn @huaying - I've added an environment variable in #390 , lmk if this solves your use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions