{"record":{"id":"dfd4216116f9470e","repo":"langgenius/dify","slug":"internal-server-error-dfd421","errorCode":null,"errorMessage":"Internal Server Error","messagePattern":"Internal Server Error","errorType":"http","errorClass":"InternalServerError","httpStatus":500,"severity":"critical","filePath":"api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py","lineNumber":299,"sourceCode":"        Run draft workflow iteration node\n        \"\"\"\n        args = req_data.model_dump(exclude_none=True)\n\n        try:\n            response = PipelineGenerateService.generate_single_iteration(\n                pipeline=pipeline, user=current_user, node_id=node_id, args=args, session=db.session(), streaming=True\n            )\n\n            return helper.compact_generate_response(response)\n        except services.errors.conversation.ConversationNotExistsError:\n            raise NotFound(\"Conversation Not Exists.\")\n        except services.errors.conversation.ConversationCompletedError:\n            raise ConversationCompletedError()\n        except ValueError as e:\n            raise e\n        except Exception:\n            logging.exception(\"internal server error.\")\n            raise InternalServerError()\n\n\n@console_ns.route(\"/rag/pipelines/<uuid:pipeline_id>/workflows/draft/loop/nodes/<string:node_id>/run\")\nclass RagPipelineDraftRunLoopNodeApi(Resource):\n    @console_ns.expect(console_ns.models[NodeRunPayload.__name__])\n    @console_ns.response(200, \"Success\", console_ns.models[RagPipelineOpaqueResponse.__name__])\n    @setup_required\n    @login_required\n    @account_initialization_required\n    @edit_permission_required\n    @rbac_permission_required(RBACResourceScope.DATASET, RBACPermission.DATASET_EDIT)\n    @with_current_user\n    @get_rag_pipeline\n    @model_validate(NodeRunPayload)\n    def post(self, req_data: NodeRunPayload, current_user: Account, pipeline: Pipeline, node_id: str):\n        \"\"\"\n        Run draft workflow loop node\n        \"\"\"","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/datasets/rag_pipeline/rag_pipeline_workflow.py#L281-L317","documentation":"Returned (HTTP 500, generic) by POST .../draft/iteration/nodes/<node_id>/run when any exception other than ConversationNotExistsError, ConversationCompletedError, or ValueError escapes `PipelineGenerateService.generate_single_iteration`. The controller logs the traceback (`logging.exception`) and re-raises as werkzeug InternalServerError — the original cause is not surfaced to the client.","triggerScenarios":"Database connectivity loss mid-run, serialization failures, unhandled KeyError in a node implementation, plugin/model-runtime crashes, infrastructure errors (redis, storage), or bugs in the iteration node's execution path.","commonSituations":"Misconfigured LLM provider credentials. Node plugin throws an unexpected exception. Transient infra outages. Schema drift between graph and node runtime.","solutions":["Inspect the Dify backend logs for the `internal server error.` traceback to find the root cause.","Reproduce with the same node_id and inputs after addressing the logged exception.","If the cause is a provider error, validate credentials and rate limits on the LLM model provider.","File a bug with the traceback, node_id, and inputs (redacted) if no actionable cause appears."],"exampleFix":"// not a client-side fix; server logs are required\n// 1) grep backend logs: `logging.exception(\"internal server error.\")`\n// 2) read the traceback, fix the underlying node/service\n// 3) retry the iteration run","handlingStrategy":"try-catch","validationCode":"// cannot fully prevent — server-side bug. Add precondition checks to reduce incidence:\nif (!nodeId) throw new Error('nodeId required')\nif (!pipelineId) throw new Error('pipelineId required')\n// then call; if 500, surface the server-side traceback to ops","typeGuard":null,"tryCatchPattern":"try {\n  await post(`${base}/draft/iteration/nodes/${nodeId}/run`, payload)\n} catch (e) {\n  if (e.status === 500) {\n    // surface 'internal error, please contact support'; do NOT blind-retry\n    // correlate with backend log line `internal server error.`\n  } else throw e\n}","preventionTips":["Do not blind-retry 500 responses — investigate logs first.","Capture node_id and inputs (redacted) for support tickets.","Keep the Dify backend and node plugins on compatible versions.","Validate provider credentials before driving iteration runs."],"tags":["rag-pipeline","iteration","internal-server-error","catch-all","api","rest"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}