gatsbyjs/gatsby · error

We had trouble connecting to Gatsby Cloud to create a login

Error message

We had trouble connecting to Gatsby Cloud to create a login session.
Please try again later, and if it continues to have trouble connecting file an issue.

What it means

Thrown by `createTicket` in the Gatsby Cloud login flow when the `POST https://auth.gatsbyjs.com/auth/tickets/create` request fails (network error, non-2xx response, or JSON parse failure). The login flow needs a ticket id to start the browser-based session, so without it the CLI aborts via `reporter.panic`.

Source

Thrown at packages/gatsby-cli/src/login.ts:24

interface ITicket {
  verified: boolean
  token?: string | null
  expiration?: string | null
}

const createTicket = async (): Promise<string> => {
  let ticketId
  try {
    const ticketResponse = await fetch(
      `https://auth.gatsbyjs.com/auth/tickets/create`,
      {
        method: `post`,
      }
    )
    const ticketJson = await ticketResponse.json()
    ticketId = ticketJson.ticketId
  } catch (e) {
    reporter.panic(
      `We had trouble connecting to Gatsby Cloud to create a login session.
Please try again later, and if it continues to have trouble connecting file an issue.`
    )
  }

  return ticketId
}

const getTicket = async (ticketId: string): Promise<ITicket> => {
  let ticket: ITicket = {
    verified: false,
  }
  try {
    const ticketResponse = await fetch(
      `https://auth.gatsbyjs.com/auth/tickets/${ticketId}`
    )
    const ticketJson = await ticketResponse.json()
    ticket = ticketJson

View on GitHub (pinned to 8b06340921)

Solutions

  1. Check connectivity to `https://auth.gatsbyjs.com` (curl/browser).
  2. Configure/whitelist the proxy: set `HTTPS_PROXY` and ensure the host is allowed.
  3. Retry later if the auth service is experiencing an outage.
  4. If the issue persists, file the issue referenced in the message.
Defensive patterns

Strategy: retry

Validate before calling

async function canReachAuth(): Promise<boolean> {
  try { const r = await fetch('https://auth.gatsbyjs.com', { method: 'HEAD' }); return r.ok || r.status < 500 } catch { return false }
}

Try / catch

let ticketId
for (let attempt = 1; attempt <= 3; attempt++) {
  try { ticketId = await createTicket(); break } catch (e) { if (attempt === 3) throw e; await new Promise(r => setTimeout(r, 1000 * attempt)) }
}

Prevention

When it happens

Trigger: `gatsby login` invokes `createTicket`, which `fetch`-es the auth endpoint. If DNS/routing fails, the request times out, a proxy blocks it, the auth service is down, or the response body is not valid JSON containing `ticketId`, the catch block panics.

Common situations: No internet or restricted corporate proxy/firewall blocking `auth.gatsbyjs.com`; auth service outage; misconfigured `HTTPS_PROXY`/`HTTP_PROXY`; running in an environment without outbound network (CI sandbox).

Related errors


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/15594c68f21d16f5. Report an issue: GitHub.