Skip to content

JobQueue::clear() aborts all in-flight sync jobs (uploads & downloads) when OAuth .well-known is rate-limited #948

Closed

Description

@agent00bob

When syncing — in either direction — a transient rate-limit response ({"error":"Too many requests"}) from the auth server's .well-known/openid-configuration endpoint causes JobQueue::clear() to fire, aborting all pending jobs regardless of type: GETFileJob (downloads), SimpleNetworkJob / POST (uploads), and TUS transfers. Running jobs are critically deleted. The sync engine declares the run complete, so aborted files are never retried and the client shows no error. Quitting and restarting repeatedly eventually works through the backlog, but it takes many cycles.

Reproduced on two different Macs (MBP M1 Max and Mac Mini M4), both running client 3.0.3.2073 against OpenCloud 7.1.0. On the MBP, four consecutive log segments (spanning ~3 minutes of restarts) each show the identical failure: upload jobs aborted by the same rate-limit cascade. The Mini captured the download-side failure cleanly.

Steps to Reproduce

  1. Create a space with several hundred files across nested directories
  2. Connect a macOS desktop client (3.0.3.2073) to sync that space, HTTP logging enabled
  3. Observe discovery + reconciliation complete normally, jobs queued
  4. A .well-known/openid-configuration fetch returns {"error":"Too many requests"}
  5. JobQueue::clear() aborts all pending jobs — POST (uploads), GET (downloads), and running jobs
  6. Client shows no error; directories exist but files are missing; subsequent syncs skip already-"synced" items

MBP Upload Failures (4 consecutive restarts, each aborted)

11:53:51  JobQueue::clear → Abort SimpleNetworkJob ×21 (POST uploads) + 12 critical deletions
11:54:33  JobQueue::clear → Abort SimpleNetworkJob ×21 (POST uploads) + 10 critical deletions
11:55:05  JobQueue::clear → Abort SimpleNetworkJob ×22 (POST uploads)
11:55:32  JobQueue::clear → Abort SimpleNetworkJob ×21 (POST uploads) + 3 critical deletions

Mini Download Failure (initial sync)

11:59:08  .well-known → {"error":"Too many requests"} → JobQueue::clear
          Abort GETFileJob ×20 + Deleting running job ×5
          Result: 88/100s of files synced, directories empty

Environment

  • macOS 26.4.1 (Mac Mini) / 25.5.0 (MBP), client 3.0.3.2073
  • OpenCloud 7.1.0 behind Caddy, HTTP/2 enabled
  • Pocket ID (OIDC) auth at separate auth server

Workaround

Quitting and restarting the client repeatedly eventually works through the sync backlog, as each cycle gets a few more files through before hitting the rate limit again.

Related

Activity

  1. agent00bob commented on Jun 15, 2026

    @agent00bob
    Author

    Sanitized log excerpt from the Mac Mini reproducing the download-side failure:

    Sanitized OpenCloud Desktop Client log excerpt — June 15, 2026
    Domain replaced with cloud.example.com / auth.example.com
    Paths replaced with /Users/testuser/
    
    === FIRST OAuth WELL-KNOWN CHECK (SUCCEEDS) ===
    26-06-15 11:59:07:668 [ debug sync.credentials.oauth ]	OCC::AccountBasedOAuth::fetchWellKnown — starting CheckServerJob
    26-06-15 11:59:07:686 [ debug sync.credentials.oauth ]	CheckServerJob succeeded, fetching "/.well-known/openid-configuration"
    26-06-15 11:59:07:709 [ info sync.httplogger ]	RESPONSE ... well-known reply successful
    26-06-15 11:59:07:709 [ debug sync.credentials.oauth ]	parsing .well-known reply successful
    
    === SYNC RUN opencloud-eu/internal#36: bobiverse space (no changes, 32ms) ===
    26-06-15 11:59:07:847 [ info sync.engine ]	#### Discovery start ####
    26-06-15 11:59:07:878 [ info sync.engine ]	#### Discovery end #### duration(31ms)
    26-06-15 11:59:07:878 [ info sync.engine ]	#### Reconcile (aboutToPropagate) ####
    26-06-15 11:59:07:878 [ info sync.engine ]	#### Reconcile (aboutToPropagate OK) ####
    26-06-15 11:59:07:878 [ info sync.engine ]	#### Post-Reconcile end ####
    26-06-15 11:59:07:879 [ info sync.engine ]	Sync run for "/Users/testuser/bobiverse/" took 32ms
    
    === SYNC RUN opencloud-eu/desktop#2: OpenCloud_Test_Space (HUNDREDS of new files discovered, 147ms) ===
    26-06-15 11:59:07:881 [ info sync.engine ]	#### Discovery start ####
    26-06-15 11:59:08:029 [ info sync.engine ]	#### Discovery end #### duration(147ms)
    26-06-15 11:59:08:029 [ info sync.engine ]	#### Reconcile (aboutToPropagate) ####
    26-06-15 11:59:08:030 [ info sync.engine ]	#### Reconcile (aboutToPropagate OK) ####
    26-06-15 11:59:08:030 [ info sync.engine ]	#### Post-Reconcile end ####
    
    === SECOND OAuth WELL-KNOWN CHECK (FAILS — RATE LIMITED) ===
    26-06-15 11:59:08:151 [ debug sync.credentials.oauth ]	fetchWellKnown — starting CheckServerJob
    26-06-15 11:59:08:171 [ debug sync.credentials.oauth ]	CheckServerJob succeeded, fetching "/.well-known/openid-configuration"
    26-06-15 11:59:08:171 [ info sync.httplogger ]	REQUEST ... /.well-known/openid-configuration
    26-06-15 11:59:08:176 [ info sync.httplogger ]	RESPONSE {"error":"Too many requests"}  (length: 29)
    26-06-15 11:59:08:176 [ debug sync.credentials.oauth ]	failed to fetch .well-known reply, error: QNetworkReply::UnknownContentError
    
    === JOB QUEUE CLEARED — ALL PENDING DOWNLOADS ABORTED ===
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../content-ingestion/searxng.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../content-ingestion/seleniumbase.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/age.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/concept-credential-management.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/agent-vault-infisical.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/black-vault.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/credential-migration-decision.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/gap-analysis.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/control-layer.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/1password-connect.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/bitwarden-secrets-manager.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/botiverse-agent-vault.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/hermes-vault.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/infisical.md
    26-06-15 11:59:08:176 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/hashicorp-vault.md
    26-06-15 11:59:08:177 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/litellm.md
    26-06-15 11:59:08:177 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/macos-keychain.md
    26-06-15 11:59:08:177 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/one-api.md
    26-06-15 11:59:08:177 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/overview.md
    26-06-15 11:59:08:177 [ debug sync.networkjob.jobqueue ]	JobQueue::clear — Abort GETFileJob: .../credential-management/phantom-secrets.md
    
    === CRITICAL: RUNNING JOBS DELETED ===
    26-06-15 11:59:08:177 [ critical sync.networkjob ]	Deleting running job: .../credential-management/litellm.md
    26-06-15 11:59:08:177 [ critical sync.networkjob ]	Deleting running job: .../credential-management/macos-keychain.md
    26-06-15 11:59:08:177 [ critical sync.networkjob ]	Deleting running job: .../credential-management/one-api.md
    26-06-15 11:59:08:177 [ critical sync.networkjob ]	Deleting running job: .../credential-management/overview.md
    26-06-15 11:59:08:177 [ critical sync.networkjob ]	Deleting running job: .../credential-management/phantom-secrets.md
    
    === THIRD OAuth WELL-KNOWN CHECK (SUCCEEDS — TOO LATE) ===
    26-06-15 11:59:38:308 [ debug sync.credentials.oauth ]	fetchWellKnown — starting CheckServerJob
    26-06-15 11:59:38:335 [ debug sync.credentials.oauth ]	CheckServerJob succeeded
    26-06-15 11:59:38:344 [ debug sync.credentials.oauth ]	parsing .well-known reply successful
    
    === RESULT ===
    - Discovery found hundreds of new files across multiple directories
    - Reconciliation completed (148ms) and propagation began
    - 20 GETFileJobs were queued for download
    - An unrelated OAuth well-known check was rate-limited by the auth server
    - JobQueue::clear() was called, aborting ALL pending downloads
    - 5 actively running download jobs were critically deleted
    - Sync engine had already declared the run "complete" (Post-Reconcile end)
    - Subsequent well-known checks succeeded, but the aborted files were never retried
    - Only 88 files made it to disk out of hundreds discovered
    - Several directories were created but all their file contents were missing
    
    
  2. agent00bob commented on Jun 15, 2026

    @agent00bob
    Author

    Sanitized log excerpts from the MBP showing the upload-side failure across 4 consecutive restart cycles:

  3. guruz commented on Jun 15, 2026

    @guruz
    Contributor
    • An unrelated OAuth well-known check was rate-limited by the auth server

    Are the several checks by the same desktop client?

    Or is that a global error message that happened because different clients at same time triggered the error?

    A .well-known/openid-configuration fetch returns {"error":"Too many requests"}

    Which HTTP code? (server side log?)

    (You can also get more client side logs if desired with QT_LOGGING_RULES="qt.network.http2.*=true;qt.network.access.*=true;qt.network.ssl.*=true" )

  4. agent00bob commented on Jun 15, 2026

    @agent00bob
    Author

    Update: root cause identified and confirmed.

    We reproduced and confirmed the root cause with debug logging on both the OpenCloud server and our OIDC provider (Pocket ID v2.8.0, SQLite backend, running on the same Docker host behind Caddy).

    Environment: Pocket ID as OIDC provider, single desktop client (MBP, macOS 25.5.0, client 3.0.3.2073), Mac Mini client shut down during upload sync from the MBP.

    HTTP status code: The OpenCloud proxy receives 429 Too Many Requests from Pocket ID's userinfo endpoint:

    ERR failed to authenticate the request error="failed to get userinfo: 429 Too Many Requests: {"error":"Too many requests"}"
    

    Root cause: OpenCloud's proxy appears to call /api/oidc/userinfo on every request to validate the access token — no caching(?). During a sync with several hundred files, this produces 30+ userinfo calls per second. Pocket ID's built-in rate limiter triggers, returns 429 for all subsequent requests in that window, and the cascade begins.

    From the Pocket ID server logs at the moment of failure — all within the same second:

    22:20:49 INF status=200 path=/api/oidc/userinfo latency=6.180559ms  (last successful)
    22:20:49 WRN Error opencloud-eu/internal#36: Too many requests
    22:20:49 WRN Error opencloud-eu/internal#36: Too many requests
    [... 19 rate-limit rejections total]
    

    Immediately before the rate limiter fired, SQL query latencies were climbing from sub-millisecond to 5-12ms under the load, but all responses were still 200. The rate limiter, not SQLite contention, terminated the requests.

    Fix confirmed: Setting DISABLE_RATE_LIMITING=true on Pocket ID resolved the issue and both desktop clients (MBP and Mac Mini) now sync the full space without interruption. In our setup, Pocket ID is an internal service behind Caddy with CrowdSec handling external rate limiting, so the built-in rate limiter was only seeing internal traffic from OpenCloud's proxy.

    Two issues remain:

    1. OpenCloud proxy — no userinfo caching. The proxy validates the access token by calling the OIDC provider's userinfo endpoint on every request. Since the token doesn't change between refreshes, caching the validation result for the token's lifetime would reduce load on the auth server from 30+/second to effectively zero between refreshes. Any OIDC provider with rate limiting enabled (which is a reasonable default) will eventually reject this volume.

    2. Desktop client — JobQueue::clear() on transient auth errors. Even with the rate limiter as the trigger, aborting all in-flight uploads and downloads on a 429 is disproportionate. The rate limit is brief and self-resolving — retry with backoff would survive it. Additionally, with the rate limiting in place, Pause Sync / Resume Sync within the app does not restart the sync after an abort; the only recovery is quitting and relaunching the client.

    I'll leave DISABLE_RATE_LIMITING in place for now, but it's not the state I prefer to operate in. Thank you for your quick initial reply to the issue!

  5. guruz commented on Jun 16, 2026

    @guruz
    Contributor

    Thank you for the interesting info...
    Good that you found a workaround for now.

    Root cause: OpenCloud's proxy appears to call /api/oidc/userinfo on every request to validate the access token — no caching(?). During a sync with several hundred files, this produces 30+ userinfo calls per second.

    CC @rhafer
    Also @fpusan as I think this is same as in opencloud-eu/opencloud#3225

    Desktop client — JobQueue::clear() on transient auth errors. Even with the rate limiter as the trigger, aborting all in-flight uploads and downloads on a 429 is disproportionate.

    I agree, but the 429 is sent to the server and not to the client. Something for server team to discuss about... @rhafer etc..

  6. github-actions commented on Jul 17, 2026

    @github-actions

    This issue was marked stale because it has been open for 30 days with no activity. Remove the stale label or comment or this will be closed in 7 days.

  7. fpusan commented on Jul 17, 2026

    @fpusan

    Not stale?

  8. TheOneRing commented on Jul 20, 2026

    @TheOneRing
    Contributor

    Fixed in #955

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions