Skip to content

mocactl login: turn device_flow_disabled and a mistyped client id (GitHub's 'Not Found') into the operator's fix #405

Closed

Description

@pdettori

Found preparing the VM demo B runbook (#367, PR #403, fix-list item 4).

Problem

When the operator's GitHub OAuth app has the device flow off (GitHub's default), mocactl login prints GitHub's error code verbatim:

login failed: github device code failed: device_flow_disabled

The chain: packages/control-plane/src/identity.ts:99-102 throws CpError('unauthorized', …), writeError puts the text in message, and packages/mocactl/src/api/errors.ts classify shows it as-is. A mistyped SH_GITHUB_CLIENT_ID surfaces the same way, as GitHub's HTTP 404 {"error":"Not Found"} from /login/device/code (login failed: github device code failed: Not Found), which says nothing about the client id. (An earlier draft of this issue and of the docs said incorrect_client_credentials; that was wrong, as the #403 review caught and a live POST with a nonexistent client id confirmed.) Both are operator-side fixes the user can't make, and neither message says so.

Proposal

  • Map the two codes to one sentence each, e.g. "the control plane's GitHub OAuth app has the device flow off — ask the operator to tick Enable Device Flow (deploy/vm/README.md, "The GitHub OAuth app")".
  • Preferably with a distinct control-plane error code (e.g. identity_provider_misconfigured), so mocactl isn't string-matching GitHub's text.
  • Add a test for each code.

Not on the critical path

The runbook (docs/demos/vm-two-user-acceptance.md, step 1a) and packages/mocactl/QUICKSTART.md both explain these codes. This is a first-run UX fix.

Activity

  1. changed the title [-]mocactl login: turn device_flow_disabled / incorrect_client_credentials into the fix[/-] [+]mocactl login: turn device_flow_disabled and a mistyped client id (GitHub's 'Not Found') into the operator's fix[/+] on Oct 1, 2026
  2. added 2 commits that reference this issue on Oct 1, 2026
    41cc197
    a2a5254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions