dagger/dagger · error
org %q not found
Error message
org %q not found
What it means
OrgDetails queries Dagger Cloud's GraphQL GetOrgDetails operation and returns this error when the server responds successfully but the `org` field is null — i.e. no organization exists under the given name (or the caller lacks access to it). The client treats a null org as a not-found condition rather than a transport failure.
Source
Thrown at internal/cloud/org_sources.go:272
status
trialStart
trialEnd
}
}
}
`
func (c *Client) OrgDetails(ctx context.Context, orgName string) (*OrgDetails, error) {
var data struct {
Org *OrgDetails `json:"org"`
}
if err := c.doGraphQL(ctx, "GetOrgDetails", getOrgDetailsOperation, map[string]any{
"org": orgName,
}, &data); err != nil {
return nil, err
}
if data.Org == nil {
return nil, fmt.Errorf("org %q not found", orgName)
}
return data.Org, nil
}
func (c *Client) Plans(ctx context.Context) (*PlansResponse, error) {
req, err := http.NewRequestWithContext(ctx, http.MethodGet, c.u.JoinPath("/plans").String(), nil)
if err != nil {
return nil, err
}
resp, err := c.h.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return nil, fmt.Errorf("list plans: %s", resp.Status)
}
var plans PlansResponseView on GitHub (pinned to 82ba2681db)
Solutions
- Verify the org slug exists (check dagger.cloud or run the command with the correct --organization flag)
- Check that the token in DAGGER_CLOUD_TOKEN belongs to that org and has access
- Re-derive the org name from `dagger config` / cloud UI instead of hardcoding it
- If the org was renamed, update scripts/env vars to the new slug
Example fix
// before
org, err := client.OrgDetails(ctx, os.Getenv("DAGGER_CLOUD_ORG"))
// after
orgName := os.Getenv("DAGGER_CLOUD_ORG")
if orgName == "" {
return fmt.Errorf("DAGGER_CLOUD_ORG is not set")
}
org, err := client.OrgDetails(ctx, orgName)
if err != nil {
return fmt.Errorf("check your --organization flag / DAGGER_CLOUD_ORG (%q): %w", orgName, err)
} Defensive patterns
Strategy: validation
Validate before calling
if orgName == "" {
return fmt.Errorf("organization name is empty; set DAGGER_CLOUD_ORG or pass --organization")
}
// optionally pre-check the slug format
if strings.ContainsAny(orgName, " /\\") {
return fmt.Errorf("org slug %q looks invalid", orgName)
} Try / catch
org, err := client.OrgDetails(ctx, orgName)
if err != nil {
if strings.Contains(err.Error(), "not found") {
// fall back to listing orgs or prompting the user
}
return err
} Prevention
- Derive the org name from `dagger` CLI config or the Cloud UI rather than hardcoding
- Validate the org slug after any org rename
- Keep DAGGER_CLOUD_TOKEN scoped to the org you reference
- Print the org name being resolved in error paths to spot typos fast
When it happens
Trigger: Calling Client.OrgDetails(ctx, orgName) with an org name that does not exist in Dagger Cloud, a mistyped/renamed org slug, or an org the authenticated token cannot see (server returns org: null instead of a GraphQL error).
Common situations: DAGGER_CLOUD_ORG env var set to a stale org name after a rename; typo in `dagger --organization`; token scoped to a different org; org deleted while a cached name was used.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- %s: %s: %s
- org %q not found
- failed to provision a remote Engine: %s
- %s: %s
- merge module types into schema: %w
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/29c79f7a74a5cbca.
Report an issue: GitHub.