{"record":{"id":"9f579483e057303a","repo":"apify/crawlee","slug":"colors-red-label-all-retries-attemp","errorCode":null,"errorMessage":"${colors.red(`[${label}]`)}: All ${retries} attempts failed, and will not be retried\n\n${lastError.stack || lastError}","messagePattern":"(.+?)\\]`\\)\\}: All (.+?) attempts failed, and will not be retried\n\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/CreateProjectCommand.ts","lineNumber":62,"sourceCode":"        try {\n            return (await func()) as Awaited<ReturnType<F>>;\n        } catch (error: any) {\n            attempt++;\n            lastError = error;\n\n            if (attempt < retries) {\n                console.warn(\n                    `${colors.yellow(`[${label}]`)}: Attempt ${attempt + 1} of ${retries} failed, and will be retried`,\n                    error.message || error,\n                );\n            }\n\n            // Wait 2500ms + (2500 * retries) before giving up to give it some time between retries\n            await setTimeout(2500 + 2500 * attempt);\n        }\n    }\n\n    throw new Error(\n        `${colors.red(`[${label}]`)}: All ${retries} attempts failed, and will not be retried\\n\\n${\n            lastError.stack || lastError\n        }`,\n    );\n}\n\nasync function downloadTemplateFilesToDisk(template: Template, destinationDirectory: string) {\n    const promises: Promise<void>[] = [];\n\n    for (const file of template.files) {\n        const promise = async () =>\n            downloadFile(file.url).then(async (buffer) => {\n                // Make sure the folder for the file exists\n                const fileDirName = dirname(file.path);\n                const fileFolder = resolve(destinationDirectory, fileDirName);\n                await mkdir(fileFolder, { recursive: true });\n\n                // Write the actual file","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/cli/src/commands/CreateProjectCommand.ts#L44-L80","documentation":"When downloading template files during `crawlee create`, the CLI retries failed network operations a fixed number of times. If every attempt fails it aggregates the last error's stack into this wrapped Error, prefixed with the operation label, and gives up.","triggerScenarios":"Fetching a project template or its manifest from the template repository fails on all retry attempts — network outage, DNS failure, 403/404 on the template URL, proxy blocking, or GitHub rate limiting.","commonSituations":"Corporate proxies/firewalls blocking registry or GitHub access; offline CI runners; requesting a nonexistent template name; transient network flaps lasting longer than the retry backoff (2500ms + 2500ms per attempt).","solutions":["Read the inner `lastError.stack` in the message to find the root cause (DNS, HTTP status, etc.).","Fix network/proxy access (set HTTPS_PROXY, allow the template host) and retry the command.","Verify the template name exists (`npx crawlee create --list-templates` or docs).","Retry later if it's rate limiting or a transient outage."],"exampleFix":"# before (fails behind proxy)\nnpx crawlee create my-app\n# after\nexport HTTPS_PROXY=http://proxy.corp:8080\nnpx crawlee create my-app","handlingStrategy":"retry","validationCode":"await fetch(templateManifestUrl, { method: 'HEAD' }).catch((e) => { console.error('Template host unreachable:', e.message); process.exit(1); });","typeGuard":null,"tryCatchPattern":"try { await createProject({ projectName: 'my-app', template: 'ts' }); } catch (err) { console.error(err.message); /* includes lastError.stack with root cause */ process.exitCode = 1; }","preventionTips":["Verify network/proxy access to the template host before scaffolding","Double-check template names against the official list","In CI, add a connectivity check or cached template step"],"tags":["cli","network","retries-exhausted","template-download"],"backgroundTag":"retries-exhausted","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}