mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: improve AI feature install error handling and resource limits
Handle OOM kills (exit code 137) with actionable memory guidance, filter ANSI/progress noise from error output, add --no-cache-dir to pip installs, reduce download concurrency to 2, and bump default container memory from 4g to 6g.
This commit is contained in:
@@ -225,13 +225,24 @@ export async function registerFeatureRoutes(app: FastifyInstance): Promise<void>
|
||||
}
|
||||
}
|
||||
if (!errorMsg) {
|
||||
const meaningful = lastStderrLines.filter(
|
||||
(l) => !l.startsWith("{") && !l.includes("pthread_setaffinity_np"),
|
||||
);
|
||||
errorMsg =
|
||||
meaningful.join("\n") ||
|
||||
stdoutBuffer.trim() ||
|
||||
`Install failed with exit code ${code}`;
|
||||
if (code === 137) {
|
||||
errorMsg =
|
||||
"Installation was killed due to insufficient memory. " +
|
||||
"Try increasing the container's memory limit (e.g. mem_limit: 6g in docker-compose.yml) and retry.";
|
||||
} else {
|
||||
const meaningful = lastStderrLines.filter(
|
||||
(l) =>
|
||||
!l.startsWith("{") &&
|
||||
!l.includes("pthread_setaffinity_np") &&
|
||||
!l.includes("\x1b[") &&
|
||||
!l.includes("━") &&
|
||||
!/^\s*\d+%\|/.test(l),
|
||||
);
|
||||
errorMsg =
|
||||
meaningful.join("\n") ||
|
||||
stdoutBuffer.trim() ||
|
||||
`Install failed with exit code ${code}`;
|
||||
}
|
||||
}
|
||||
setInstallProgress(bundleId, null, errorMsg);
|
||||
updateSingleFileProgress({ jobId, phase: "failed", percent: 0, error: errorMsg });
|
||||
|
||||
Reference in New Issue
Block a user