transloadit/uppy · critical · Error

Facebook provider secret is not configured

Error message

Facebook provider secret is not configured

What it means

The Facebook provider needs the app's client secret to sign batch requests (appsecret_proof). list() fetches provider credentials and throws this error when secret is null/undefined — i.e. the Facebook app secret is not configured on this Companion instance.

Source

Thrown at packages/@uppy/companion/src/server/provider/facebook/index.ts:154

      const qs: Record<string, string> = {
        fields: 'name,cover_photo,created_time,type',
      }

      const cursor = query?.['cursor'] ?? null

      if (typeof cursor === 'string') {
        qs['after'] = cursor
      }

      let path = 'me/albums'
      if (directory) {
        path = `${directory}/photos`
        qs['fields'] = 'icon,images,name,width,height,created_time'
      }

      const { secret } = (await companion.getProviderCredentials?.())!
      if (secret == null) {
        throw new Error('Facebook provider secret is not configured')
      }

      const responses = await runRequestBatch({
        secret,
        token,
        requests: [
          {
            method: 'GET',
            relative_url: `me?${new URLSearchParams({ fields: 'email' }).toString()}`,
          },
          { method: 'GET', relative_url: `${path}?${new URLSearchParams(qs)}` },
        ],
      })
      const response1 = responses[0]
      const response2 = responses[1]
      if (!response1 || !response2) {
        throw new Error('Unexpected Facebook response: missing batch result')
      }

View on GitHub (pinned to 5d4dedd02a)

Solutions

  1. Set both Facebook credentials: FACEBOOK_KEY and FACEBOOK_SECRET env vars (or providerOptions.facebook.key and .secret)
  2. If using a credentialsUrl service, ensure its response includes both key and secret fields
  3. Restart Companion after adding the secret and verify it loads (check startup logs)
  4. Confirm the secret matches the app configured at developers.facebook.com

Example fix

# before
FACEBOOK_KEY=123456 uppy-companion

# after
FACEBOOK_KEY=123456
FACEBOOK_SECRET=abcdef1234567890 uppy-companion
Defensive patterns

Strategy: validation

Validate before calling

// At startup, verify Facebook credentials are complete
const { key, secret } = resolveFacebookCredentials(providerOptions)
if (!key || !secret) {
  throw new Error('Facebook provider requires both key and secret')
}

Type guard

function hasFacebookSecret(creds: { secret?: string | null } | undefined): creds is { secret: string } {
  return typeof creds?.secret === 'string' && creds.secret.length > 0
}

Prevention

When it happens

Trigger: Invoking the Facebook list/listWithPagination flow (browsing files in the Dashboard) while companionOptions.providerOptions.facebook.secret (or the corresponding env var FACEBOOK_SECRET / credentials service response) is unset or returns null.

Common situations: Facebook key is set but the secret env var was forgotten or misspelled, only one of key/secret is provided via a custom credentials service, or a multi-tenant setup where the credentials resolver omits secret.

Related errors


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