Significant-Gravitas/AutoGPT · error · HTTPException

str(e)

Error message

str(e)

What it means

HTTP 500 from the admin execution-analytics generation endpoint. An unexpected exception escaped the generation loop (per-execution failures are counted as failed_count, so this indicates something systemic — DB fetch of executions, request assembly, or the final response build) and str(e) is returned as the detail. The full traceback is in the server log via logger.exception.

Source

Thrown at autogpt_platform/backend/backend/api/features/admin/execution_analytics_routes.py:345

        response = ExecutionAnalyticsResponse(
            total_executions=len(executions),
            processed_executions=len(executions_to_process),
            successful_analytics=successful_count,
            failed_analytics=failed_count,
            skipped_executions=len(executions) - len(executions_to_process),
            results=results,
        )

        logger.info(
            f"Analytics generation completed: {successful_count} successful, {failed_count} failed, "
            f"{response.skipped_executions} skipped"
        )

        return response

    except Exception as e:
        logger.exception(f"Error during execution analytics generation: {e}")
        raise HTTPException(status_code=500, detail=str(e))


async def _process_batch(
    executions, request: ExecutionAnalyticsRequest, db_client
) -> list[ExecutionAnalyticsResult]:
    """Process a batch of executions concurrently."""

    if not settings.secrets.openai_internal_api_key:
        raise HTTPException(status_code=500, detail="OpenAI API key not configured")

    async def process_single_execution(execution) -> ExecutionAnalyticsResult:
        try:
            # Generate activity status and score using the specified model
            # Convert stats to GraphExecutionStats if needed
            if execution.stats:
                if isinstance(execution.stats, GraphExecutionMeta.Stats):
                    stats_for_generation = execution.stats.to_db()
                else:

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Read the server traceback (the response detail is only str(e)) to identify the throwing frame.
  2. If legacy stats are involved, exclude old executions via the request's date/id filters and retry.
  3. Fix or migrate the malformed data the traceback points to.
  4. Re-run the request on a narrower execution set to isolate the offending record.
Defensive patterns

Strategy: try-catch

Try / catch

try { const r = await generateExecutionAnalytics(req); } catch (e) { if (e.status === 500) { logServerError(e.detail); await retryWithNarrowerScope(req); /* fewer executions per batch */ } }

Prevention

When it happens

Trigger: POST /admin/execution-analytics where a non-per-execution step throws: e.g. get_graph_executions failing on malformed stats JSON, a Pydantic validation error building ExecutionAnalyticsResponse, or serialization of unanticipated stats shapes.

Common situations: First analytics run against legacy executions whose stats predate the current schema; a model rename breaking GraphExecutionMeta.Stats conversion; DB connectivity blips mid-generation.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/ebcb269744338dcf. Report an issue: GitHub.