mastra-ai/mastra · error

App creation returned incomplete data

Error message

App creation returned incomplete data

What it means

If Slack responds ok:true to app creation but omits app_id, credentials, or oauth_authorize_url, the returned object would be incomplete and unusable for completing OAuth installation, so the client throws before returning.

Source

Thrown at channels/slack/src/client.ts:152

        signing_secret: string;
      };
      oauth_authorize_url?: string;
    };

    if (!data.ok) {
      // Slack may include detailed error info
      let errorDetails = data.error ?? 'unknown_error';
      if (data.errors?.length) {
        errorDetails += ': ' + data.errors.map(e => `${e.pointer}: ${e.message}`).join(', ');
      }
      if (data.response_metadata?.messages?.length) {
        errorDetails += ' - ' + data.response_metadata.messages.join(', ');
      }
      throw new Error(`App creation failed: ${errorDetails}`);
    }

    if (!data.app_id || !data.credentials || !data.oauth_authorize_url) {
      throw new Error('App creation returned incomplete data');
    }

    return {
      appId: data.app_id,
      clientId: data.credentials.client_id,
      clientSecret: data.credentials.client_secret,
      signingSecret: data.credentials.signing_secret,
      oauthAuthorizeUrl: data.oauth_authorize_url,
    };
  }

  /**
   * Delete a Slack app.
   */
  async deleteApp(appId: string): Promise<void> {
    await this.rotateToken();

    const response = await fetch(`${SLACK_API_BASE}/apps.manifest.delete`, {

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Log the raw createApp response to identify the missing field, then retry
  2. Update the package to the latest version in case the Slack API contract changed
  3. Check for proxies/interceptors that could strip fields from the JSON response
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const app = await client.createApp(manifest);
} catch (e) {
  if ((e as Error).message === 'App creation returned incomplete data') {
    // transient/contract issue — retry once, then inspect raw response via logging
  } else throw e;
}

Prevention

When it happens

Trigger: createApp() receives { ok: true } with a body missing app_id, credentials (client_id/client_secret), or oauth_authorize_url.

Common situations: Slack API response-shape changes; partial responses from an unstable API; middleware/proxies truncating response bodies.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/305fa7972809b63b. Report an issue: GitHub.