{"record":{"id":"a16fc68a4d7f06e7","repo":"langgenius/dify","slug":"e2e-teardown-errors-cleanuperrors-join-n","errorCode":null,"errorMessage":"E2E teardown errors:\n${cleanupErrors.join('\\n')}","messagePattern":"E2E teardown errors:\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"e2e/scripts/run-cucumber.ts","lineNumber":101,"sourceCode":"  let difyAgentProcess: ManagedProcess | undefined\n  let middlewareStarted = false\n  let shellctlProcess: ManagedProcess | undefined\n\n  let cleanupPromise: Promise<void> | undefined\n  const cleanup = async () => {\n    if (!cleanupPromise) {\n      cleanupPromise = (async () => {\n        const cleanupErrors = await runCleanupTasks([\n          { label: 'Stop web server', run: stopWebServer },\n          { label: 'Stop celery worker', run: () => stopManagedProcess(celeryProcess) },\n          { label: 'Stop API server', run: () => stopManagedProcess(apiProcess) },\n          { label: 'Stop agent backend', run: () => stopManagedProcess(difyAgentProcess) },\n          { label: 'Stop shellctl sandbox', run: () => stopManagedProcess(shellctlProcess) },\n          ...(middlewareStarted ? [{ label: 'Stop middleware', run: stopMiddleware }] : []),\n        ])\n\n        if (cleanupErrors.length > 0)\n          throw new Error(`E2E teardown errors:\\n${cleanupErrors.join('\\n')}`)\n      })()\n    }\n\n    await cleanupPromise\n  }\n\n  const onTerminate = () => {\n    void cleanup()\n      .catch((error) => {\n        console.error(error instanceof Error ? error.message : String(error))\n      })\n      .finally(() => {\n        process.exit(1)\n      })\n  }\n\n  process.once('SIGINT', onTerminate)\n  process.once('SIGTERM', onTerminate)","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/e2e/scripts/run-cucumber.ts#L83-L119","documentation":"Error \"E2E teardown errors:\n${cleanupErrors.join('\\n')}\" thrown in langgenius/dify.","triggerScenarios":"Thrown at e2e/scripts/run-cucumber.ts:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}