Skip to content

lean data download polls indefinitely when web Data Licensing Agreement signing flow is broken #654

@AlexCatarino

Description

@AlexCatarino

Summary

lean data download polls indefinitely for organization.data.current to become true when the web-platform Data Licensing Agreement signing flow is broken. Because neither signing entry point currently works (see below), the CLI hangs with no actionable error message and no timeout.

Background

Before the CLI can download any dataset (free or paid), it calls /api/v2/data/read and waits for organization.data.current to flip to true, which is set server-side when the user signs the Data Licensing Agreement through the web platform.

Two agreement-signing entry points exist on the platform, and both are currently broken for at least one affected organization (0df6a843584d05733660a1805491f279):

  1. /terms/data/?organization=<org_id> — the URL the Lean CLI itself emits as the sign-here destination — renders the Research Pipeline Builder UI instead of the agreement document.
  2. "License Now" buttons on Dataset detail pages (confirmed on "US Congress Trading by Quiver Quantitative") navigate to about:blank; the JS bundle fails to load and no backend call fires.

These are web platform bugs, not CLI bugs. However, the CLI's current behaviour when stuck in this state makes the situation significantly worse for users.

Current CLI behaviour (problem)

lean data download polls /api/v2/data/read indefinitely, outputting nothing useful until the user manually interrupts. There is no timeout, no poll count, and no message telling the user why they are waiting or where to go to sign the agreement.

Proposed improvement

After a reasonable number of failed polls (e.g. 10–20 attempts, ~2–3 minutes), lean data download should:

  1. Print a clear message, e.g.:
    Waiting for your Data Licensing Agreement to be signed. Visit:
      https://www.quantconnect.com/datasets
    and click "License Now" on the relevant dataset, or visit your organization's data terms page.
    Retrying... (attempt 5 of 20)
    
  2. After the maximum attempts are reached, exit with a non-zero status and a message pointing to the web UI or to support@quantconnect.com.

This would make the hung-state visible and actionable rather than an infinite silent loop.

Steps to reproduce (broken agreement flow — platform side)

  1. Create or use an organization that has not yet signed the Data Licensing Agreement.
  2. Run lean data download --dataset "US Interest Rate by FRED" (free dataset, same symptom).
  3. Observe: CLI polls indefinitely, /api/v2/data/read returns agreement error each time.
  4. Attempt to sign: navigate to https://www.quantconnect.com/terms/data/?organization=<org_id> — shows Research Pipeline Builder instead of agreement.
  5. Attempt to sign via dataset page: click "License Now" on any dataset — navigates to about:blank.

Affected users

  • Any user whose organization has not yet signed the Data Licensing Agreement AND who is affected by the web-platform signing-flow regression.

Environment

  • Lean CLI (version unspecified — bug is in the polling logic, not version-specific)
  • Platform: web (Data Licensing Agreement UI is broken independently of CLI version)

Intercom conversation reference

Internal: conversation 215474776853935

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions