plandex-ai/plandex · error

Error creating org:

Error message

Error creating org: 

What it means

CreateOrgHandler: the db.WithTx transaction (org insert + hooks) returned a non-ApiError error after any apiErr was handled, so a generic 500 is written. DB or hook failure during org creation; the tx rolled back.

Source

Thrown at app/server/handlers/orgs.go:138

			Auth: auth,
			Tx:   tx,

			CreateOrgHookRequestParams: &hooks.CreateOrgHookRequestParams{
				Org: org,
			},
		})

		return nil
	})

	if apiErr != nil {
		writeApiError(w, *apiErr)
		return
	}

	if err != nil {
		log.Printf("Error creating org: %v\n", err)
		http.Error(w, "Error creating org: "+err.Error(), http.StatusInternalServerError)
		return
	}

	resp := shared.CreateOrgResponse{
		Id: org.Id,
	}

	bytes, err := json.Marshal(resp)

	if err != nil {
		log.Printf("Error marshalling response: %v\n", err)
		http.Error(w, "Error marshalling response: "+err.Error(), http.StatusInternalServerError)
		return
	}

	err = SetAuthCookieIfBrowser(w, r, auth.User, "", org.Id)
	if err != nil {
		log.Printf("Error setting auth cookie: %v\n", err)

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check server logs for the wrapped tx error
  2. Review CreateOrg hook failures (billing/provisioning)
  3. Retry creation; the rollback leaves no partial org
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at app/server/handlers/orgs.go:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/46898ad68751f171. Report an issue: GitHub.