-
Notifications
You must be signed in to change notification settings - Fork 3
Troubleshooting
Both CLIs accept --verbose / -v on any command. It surfaces per-step operational details — each REST call, the response status, raw git output during clone, metadata writes, collaborator updates — and is the first thing to try when something doesn't behave as expected.
gh student submit -v
gh teacher download -v <org> <classroom> <assignment>For raw REST request/response logging (headers + bodies), set GH_DEBUG=api in the environment. This is honored by the underlying go-gh library and is the most detailed view of what's hitting the GitHub API.
GH_DEBUG=api gh teacher invite <org> <username>Commands that emit informational summaries also accept --quiet / -q to suppress them (and to forward --quiet to git where applicable) — useful for scripting.
Org-level invitations require the admin:org OAuth scope, which gh auth login doesn't grant by default. Run:
gh teacher loginThis re-authenticates with admin:org appended. The CLI also detects this missing scope and runs the login flow for you automatically if you skip it.
gh teacher init commits the config repo's .github/workflows/ files via the Git Data API, which GitHub gates behind the workflow OAuth scope. A token without it is rejected with a misleading 404 Not Found (POST .../git/trees: HTTP 404), leaving the classroom50 repo with only a README. Re-authenticate so the token carries workflow:
gh teacher logingh teacher login requests workflow automatically. To add it to your existing token in place instead:
gh auth refresh -s admin:org,workflowWhether a plain gh auth login already granted workflow depends on unrelated choices in its prompts (gh adds it only when you set it up as your HTTPS git credential helper), which is why this surfaces on some machines and not others. init now detects the missing scope and fails fast with this remediation instead of the bare 404.
Your authenticated user has to be an org owner (or have a role that includes member-invitation permission) for POST /orgs/{org}/invitations to succeed. Verify your role under https://github.com/orgs/<org>/people — your name should show Owner. If you're an admin via a team, GitHub's invitation API still requires owner-level permission.
These aren't errors — they mean the desired state already exists. The CLI translates them into clear messages and exits 0 so you can re-run invite commands as part of a script without manual case-handling.
You've already accepted this assignment; the repo exists at <org>/<classroom>-<assignment>-<username>. The CLI short-circuits to avoid touching your existing repo (and your work in it). Clone it with the URL from gh repo view <org>/<repo> if you don't have it locally.
Three things to check, in order:
- The template repo must be public under most plans, because GitHub's "No permission" org base setting blocks org members from reading private repos they aren't explicit collaborators on. (GitHub Enterprise Cloud has an "internal" visibility that all enterprise members can read; on that plan, internal templates work.)
-
The repo must be flagged as a template in
Settings → General → Template repository. -
The
<assignment>argument must match the slug your instructor registered withgh teacher assignment addinassignments.json— case is normalized, but spelling has to be exact. It does not have to match the template repo's name.
gh student submit reads template metadata from .classroom50.yaml at the repo root. If it's missing, you're likely running submit from outside the cloned assignment repo, or from a clone that wasn't created by gh student accept (which is what writes that file). cd into the directory the git clone command created and try again.
The assignment's assignments.json references an autograder workflow whose YAML isn't on the Pages site. Two common causes:
-
The file doesn't exist. This error only fires for non-default
--autograder <name>values. Thedefaultautograder is embedded ingh-studentitself and never needs a config-repo file. For other names (e.g.--autograder c-makefile), the corresponding<classroom>/autograders/<name>.yamlmust be hand-created in the config repo before the assignment is registered. Ask your instructor to confirm the file is there. -
publish-pages.yamlhasn't run yet. Even when the file exists in the config repo, the Pages site needs the publish workflow to deploy. A fresh classroom dir requires one Pages deployment to surface the autograders; ask your instructor to wait a minute and try again.
The instructor's autograder workflow has a YAML syntax error. gh student validates the fetched YAML before writing it into your repo, so a broken file never lands. Ask the instructor to check <classroom>/autograders/<name>.yaml in the config repo and re-run after they fix it.
gh student submit pushes to the assignment repo's main branch (hardcoded for now). If your template uses master or develop, the first submit creates a new main branch alongside it. Make sure the assignment repo's default branch on GitHub is the one you (and the teacher's download flow) expect.
By default, gh teacher download is roster-driven: it reads <classroom>/students.csv and <classroom>/assignments.json from your config repo, then probes GET /repos/<org>/<classroom>-<assignment>-<username> for each roster row. If you get zero clones:
- Confirm
<org>/classroom50exists and<classroom>/students.csvis populated (gh teacher roster addorgh teacher roster import). - Confirm
<assignment>is registered in<classroom>/assignments.json(gh teacher assignment list <org> <classroom>). - Verify a few student repos exist under
https://github.com/orgs/<org>/repositories?q=<classroom>-<assignment>. - Re-run with
-vto see which roster rows were probed and which repos were missing.
If the config repo isn't bootstrapped yet, or you want every matching repo regardless of the roster, pass --by-pattern — that mode pages through GET /orgs/{org}/repos and clones every repo whose name starts with <classroom>-<assignment>-.
The nightly collect-scores workflow logs a ::warning:: when a non-empty roster x assignment set yields zero readable submissions. Because a fine-grained PAT returns 404 for repos outside its scope -- indistinguishable from "no release yet" -- this almost always means the CLASSROOM50_COLLECT_TOKEN can't read the student repos, not that the whole class submitted nothing. (An early-term run before anyone has submitted will also trip it; the warning is hedged with "if you expected submissions.")
- Confirm the collect token has
Contents: readon all org repos (not "Only select repositories" -- student repos are created on demand bygh student accept, so a pre-chosen list misses them). See the collect-token note. - Re-scope and rotate it with
gh teacher rotate-collect-token <org>. - A
401/403instead fails the run loudly (bad or expired token); the0 submissionswarning is specifically the silent-404 case.
gh extension install . only registers the binary the first time. After pulling new commits in this repo, re-run go build . inside the extension folder:
(cd cli/gh-teacher && go build .)
(cd cli/gh-student && go build .)If go build itself fails, run go mod tidy first to catch any new dependencies.
If none of the above explain what you're seeing, open an issue at https://github.com/foundation50/classroom50/issues. Useful to include:
- The exact command you ran (with arguments).
- The full output, ideally with
-vand/orGH_DEBUG=apiset. - Your
gh --versionand Go version (go version). - OS and shell.