Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-existent firmware will be upload, need to check it it exists before trying to flash #488

Closed
mineshaftgap opened this issue Mar 22, 2024 · 1 comment

Comments

@mineshaftgap
Copy link

In manifest.json if there is a typo, self-hosted ESP Web Tools will try and upload a non-existent firmware resulting in a boot loop of:

invalid header: 0x434c4557

More details can be found in a previously related ticket. I suggest that checking for the existence of the file before trying to upload or in that is not possible to do a file size check.

@balloob
Copy link
Member

balloob commented Apr 1, 2024

We check if the status code is correct:

esp-web-tools/src/flash.ts

Lines 119 to 124 in ec35b6a

const resp = await fetch(url);
if (!resp.ok) {
throw new Error(
`Downlading firmware ${part.path} failed: ${resp.status}`,
);
}

Web servers should return a 404 status code if the file is not found. If that is not the case, your web server is misconfigured.

@balloob balloob closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants