transloadit/uppy · error · Error

Not implemented

Error message

Not implemented

What it means

The refresh-token endpoint requires the stored provider session to contain a refreshToken. Some providers issue short-lived access tokens without refresh tokens, and Companion logs 'Tried to refresh token without having a token' and returns 401 instead of attempting a refresh.

Source

Thrown at packages/@uppy/aws-s3/src/s3-client/S3Client.ts:122

        if (xhr.status >= 400 && xhr.status < 500 && xhr.status !== 429) {
          return false
        }
        return true
      },
      onUploadProgress: (event) => {
        if (event.lengthComputable && onProgress) {
          onProgress(event.loaded, event.total)
        }
      },
    })
  }

  public async putObject(params: IT.PutObjectParams): Promise<{
    location: string
    key: string
    etag: string | undefined
  }> {
    throw new Error('Not implemented')
  }

  public async createMultipartUpload(
    params: IT.CreateMultipartUploadParams,
  ): Promise<{
    uploadId: string
    key: string
  }> {
    throw new Error('Not implemented')
  }

  public async uploadPart(params: IT.UploadPartParams): Promise<{
    etag: string
  }> {
    throw new Error('Not implemented')
  }

  public async listParts(params: IT.ListPartsParams): Promise<IT.UploadPart[]> {

View on GitHub (pinned to 5d4dedd02a)

Solutions

  1. For Google, add access_type: 'offline' and prompt: 'consent' to the provider's grant/dynamic config so a refresh token is issued
  2. Re-authenticate the user to obtain a session that includes a refresh token
  3. If the provider does not support refresh tokens, catch 401 and prompt re-authentication instead of retrying refresh

Example fix

// before
companion({ providerOptions: { drive: { key, secret } } })
// after
// ensure Google issues a refresh token on consent
new GoogleDrive(uppy, { companionUrl, companionCookiesRule: 'same-origin' })
// plus on server, grant config:
companion({
  providerOptions: { drive: { key, secret } },
  // grant dynamic: access_type=offline&prompt=consent handled via provider config
})
Defensive patterns

Strategy: fallback

Validate before calling

// client-side: only attempt refresh when the session was granted offline access
if (!sessionHasRefreshToken) return promptReauthentication()

Type guard

const canRefresh = (session: { refreshToken?: string }): session is { refreshToken: string } =>
  typeof session.refreshToken === 'string' && session.refreshToken.length > 0

Try / catch

try {
  await refreshAccessToken()
} catch (e) {
  if (e.status === 401) return promptReauthentication() // no refresh token available
  throw e
}

Prevention

When it happens

Trigger: Calling refresh-token when providerUserSession.refreshToken is undefined — e.g. the OAuth flow granted no offline access scope, or the session was created before refresh support, or the provider simply does not issue refresh tokens (Instagram-style flows).

Common situations: Google Drive without the access_type=offline / prompt=consent parameters in grant config; provider grant dynamic config missing; session data truncated so refreshToken was dropped; client automatically retrying refresh on expired access tokens for a provider that cannot refresh.

Related errors


AI-assisted analysis of transloadit/uppy@5d4dedd02a (2026-08-28). Data as JSON: /api/errors/aeca6e5741be6f8d. Report an issue: GitHub.