Skip to content

fix(create): fail with actionable error when template download is not a zip #1272

Merged
l2ysho merged 5 commits into
masterfrom
1271-apify-create-fails-with-adm-zip-invalid-or-unsupported-zip-format-on-blockedintercepted-networks
Jul 9, 2026
Merged

fix(create): fail with actionable error when template download is not a zip #1272
l2ysho merged 5 commits into
masterfrom
1271-apify-create-fails-with-adm-zip-invalid-or-unsupported-zip-format-on-blockedintercepted-networks

Conversation

@l2ysho

@l2ysho l2ysho commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

closes #1271

@l2ysho l2ysho self-assigned this Jul 9, 2026
@l2ysho l2ysho added adhoc Ad-hoc unplanned task added during the sprint. t-builders Issues owned by the Builders team. labels Jul 9, 2026
@l2ysho l2ysho marked this pull request as ready for review July 9, 2026 11:45
@l2ysho l2ysho requested a review from DaveHanns as a code owner July 9, 2026 11:45
Comment thread src/lib/create-utils.ts
Comment on lines +57 to +59
const response = await axios.get<string>(manifest.localReadmeSuffixUrl!, { responseType: 'text' });

await appendFile(readmePath, `\n\n${response.data}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: why? Seems unrelated 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to keep it the same as before -> readmeStream.write('\n\n');

@vladfrangu vladfrangu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, let's maybe put in a special user agent when downloading a zip archive so its clear Apify cli is downloading

Comment thread src/lib/utils.ts Outdated
Comment on lines +701 to +705
export const downloadZip = async (url: string) => {
const response = await axios.get(url, { responseType: 'arraybuffer', validateStatus: () => true });

if (response.status < 200 || response.status >= 300) {
throw new Error(`Failed to download the archive from ${url} (HTTP ${response.status}).`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: we might want to print the error message as well, possibly 🤔

Suggested change
export const downloadZip = async (url: string) => {
const response = await axios.get(url, { responseType: 'arraybuffer', validateStatus: () => true });
if (response.status < 200 || response.status >= 300) {
throw new Error(`Failed to download the archive from ${url} (HTTP ${response.status}).`);
export const downloadZip = async (url: string) => {
const response = await axios.get(url, { responseType: 'arraybuffer', validateStatus: () => true });
if (response.status < 200 || response.status >= 300) {
const body = Buffer.from(response.data).toString('utf8').trim().slice(0, 500);
throw new Error(`Failed to download the archive from ${url} (HTTP ${response.status}).`);

@DaveHanns DaveHanns left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 Some comments, nits, ...

@l2ysho l2ysho enabled auto-merge (squash) July 9, 2026 12:24
@l2ysho l2ysho merged commit ea3223e into master Jul 9, 2026
24 checks passed
@l2ysho l2ysho deleted the 1271-apify-create-fails-with-adm-zip-invalid-or-unsupported-zip-format-on-blockedintercepted-networks branch July 9, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-builders Issues owned by the Builders team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apify create fails with "ADM-ZIP: Invalid or unsupported zip format" on blocked/intercepted networks

4 participants