Skip to content

Use the local project id when the cloud project is unavailable - #664

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:bug-local-project-id-for-deleted-cloud-project
Aug 26, 2026
Merged

Use the local project id when the cloud project is unavailable#664
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:bug-local-project-id-for-deleted-cloud-project

Conversation

@AlexCatarino

@AlexCatarino AlexCatarino commented Aug 25, 2026

Copy link
Copy Markdown
Member

Problem

A local run sends the project's cloud-id as its project id even when that cloud project can no longer be read. It surfaced through the Auth0 authorize URL of lean live deploy, which pointed at a project that was no longer there:

https://www.quantconnect.com/api/v2/live/auth0/authorize?brokerage=alpaca&projectId=35623870

Fix

Look the project up before using its cloud-id, and fall back to the negative local id when it cannot be reached, as a project that was never pushed already does.

project state projects/read resolved id
exists 200 positive cloud-id
purged, or not reachable by this user RequestFailedError -local_id

A project sitting in the Recycle Bin still reads back normally, so it keeps its cloud-id. That is deliberate: it can be moved back out, and the id stays valid.

Notes

  • This adds one projects/read call to every local run of a pushed project: backtest, research, optimize, local live deploy and private_cloud start. data download is unaffected, it has no project directory and returns -1 before reaching the lookup.
  • Offline, a pushed project resolves to -local_id instead of failing, since the fallback covers connection errors along with everything else. The reason is logged at debug level.
  • Nothing is cached, so the id follows the project's current state on every run.

Testing

  • tests/components/config: 101 passing, with new cases for a project that exists, one that cannot be read, and one that was never pushed.
  • Verified against the live API: an unreachable id raised Project not found and fell back to the local id.

🤖 Generated with Claude Code

A project that no longer exists in the cloud, or that the current user
cannot reach, no longer identifies anything, so its cloud-id must not be
used as the id of the project that runs locally. Look the project up
before using its cloud-id and fall back to the negative local id.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@AlexCatarino
AlexCatarino force-pushed the bug-local-project-id-for-deleted-cloud-project branch from 21fc41d to 9b0e720 Compare August 26, 2026 14:18
@Martin-Molinero
Martin-Molinero merged commit 0eed87f into QuantConnect:master Aug 26, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants