{"record":{"id":"6b16684d4f46929a","repo":"Significant-Gravitas/AutoGPT","slug":"failed-to-provision-ayrshare-profile","errorCode":null,"errorMessage":"Failed to provision Ayrshare profile","messagePattern":"Failed to provision Ayrshare profile","errorType":"http","errorClass":"HTTPException","httpStatus":502,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/integrations/router.py","lineNumber":1400,"sourceCode":"\n    try:\n        client = AyrshareClient()\n    except MissingConfigError:\n        raise HTTPException(\n            status_code=HTTP_500_INTERNAL_SERVER_ERROR,\n            detail=\"Ayrshare integration is not configured\",\n        )\n\n    # On-demand provisioning: AyrshareManagedProvider opts out of the\n    # credentials sweep (profile quota is per-user subscription-bound).  This\n    # endpoint is the only trigger that provisions a profile — one Ayrshare\n    # profile per user who actually opens the connect flow, not one per\n    # every authenticated user.\n    provisioned = await ensure_managed_credential(\n        user_id, creds_manager.store, AyrshareManagedProvider()\n    )\n    if not provisioned:\n        raise HTTPException(\n            status_code=HTTP_502_BAD_GATEWAY,\n            detail=\"Failed to provision Ayrshare profile\",\n        )\n\n    ayrshare_creds = [\n        c\n        for c in await creds_manager.store.get_creds_by_provider(user_id, \"ayrshare\")\n        if c.is_managed and isinstance(c, APIKeyCredentials)\n    ]\n    if not ayrshare_creds:\n        logger.error(\n            \"Ayrshare credential provisioning did not produce a credential for user %s\",\n            user_id,\n        )\n        raise HTTPException(\n            status_code=HTTP_502_BAD_GATEWAY,\n            detail=\"Failed to provision Ayrshare profile\",\n        )","sourceCodeStart":1382,"sourceCodeEnd":1418,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/integrations/router.py#L1382-L1418","documentation":"Error \"Failed to provision Ayrshare profile\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/integrations/router.py:1400 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the Ayrshare API key is valid and has profile-creation permissions.","Check Ayrshare service status and retry; inspect server logs for the upstream error."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}