{"record":{"id":"18fdb29162f7002f","repo":"mastra-ai/mastra","slug":"app-creation-failed-errordetails","errorCode":null,"errorMessage":"App creation failed: ${errorDetails}","messagePattern":"App creation failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/slack/src/client.ts","lineNumber":148,"sourceCode":"      app_id?: string;\n      credentials?: {\n        client_id: string;\n        client_secret: string;\n        signing_secret: string;\n      };\n      oauth_authorize_url?: string;\n    };\n\n    if (!data.ok) {\n      // Slack may include detailed error info\n      let errorDetails = data.error ?? 'unknown_error';\n      if (data.errors?.length) {\n        errorDetails += ': ' + data.errors.map(e => `${e.pointer}: ${e.message}`).join(', ');\n      }\n      if (data.response_metadata?.messages?.length) {\n        errorDetails += ' - ' + data.response_metadata.messages.join(', ');\n      }\n      throw new Error(`App creation failed: ${errorDetails}`);\n    }\n\n    if (!data.app_id || !data.credentials || !data.oauth_authorize_url) {\n      throw new Error('App creation returned incomplete data');\n    }\n\n    return {\n      appId: data.app_id,\n      clientId: data.credentials.client_id,\n      clientSecret: data.credentials.client_secret,\n      signingSecret: data.credentials.signing_secret,\n      oauthAuthorizeUrl: data.oauth_authorize_url,\n    };\n  }\n\n  /**\n   * Delete a Slack app.\n   */","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/channels/slack/src/client.ts#L130-L166","documentation":"createApp calls Slack's app-creation endpoint and expects ok:true. When ok is false the client builds an errorDetails string from data.error, plus per-field validation errors (data.errors with pointer/message) and response_metadata.messages, and throws with them.","triggerScenarios":"createApp() receives { ok: false } from Slack — e.g. invalid manifest, validation errors on specific manifest fields, or an auth/permission failure on the app-creation API.","commonSituations":"Manifest failing Slack validation (invalid icons, bad settings, missing required fields); using app config tokens without the right scopes; typo'd manifest after editing; Slack rejecting unsupported manifest features.","solutions":["Read errorDetails in the message — it names the failing manifest fields (pointer) and Slack's messages; fix those fields in your SlackAppManifest","Verify your app configuration token is valid and has permission to create apps","Validate the manifest against Slack's manifest schema/docs before calling createApp"],"exampleFix":"// before\nmanifest.oauth_config = { redirect_urls: ['http://localhost/callback'] }; // http not allowed\n// after\nmanifest.oauth_config = { redirect_urls: ['https://myapp.example.com/callback'] };","handlingStrategy":"validation","validationCode":"function validateManifest(m: SlackAppManifest): string[] {\n  const errs: string[] = [];\n  if (!m.display_information?.name) errs.push('display_information.name required');\n  if (!m.oauth_config?.redirect_urls?.every(u => u.startsWith('https://'))) errs.push('redirect_urls must be https');\n  if (!m.settings?.org_deploy_enabled && !m.settings) errs.push('settings required');\n  return errs;\n}\nconst errs = validateManifest(manifest); if (errs.length) throw new Error(errs.join(', '));","typeGuard":null,"tryCatchPattern":"try {\n  await client.createApp(manifest);\n} catch (e) {\n  const msg = (e as Error).message;\n  if (msg.startsWith('App creation failed:')) {\n    // msg contains pointer/message details — fix those manifest fields and retry\n  } else throw e;\n}","preventionTips":["Validate the manifest against Slack's manifest schema before createApp","Use https redirect URLs and valid icon references","Ensure app configuration tokens have creation permissions","Change manifest fields incrementally to isolate validation failures"],"tags":["slack","api","manifest","validation"],"backgroundTag":"slack-app-creation-failed","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}