Software

Electron auto-update stuck at 'Checking for updates' when update server returns HTTP 204 No Content

Environment

Environment

Electron 21 app packaged with electron-updater using Squirrel and update server implemented as simple static release endpoint on GitHub Pages/NGINX; clients log 'Checking for updates' indefinitely in production; developer portal shows update package published; curl to URL returns 204 No Content under certain client user-agent conditions.

Symptoms

Symptoms

App UI shows 'Checking for updates' spinner forever and never calls downloaded update handlers. DevTools console shows no errors; debugger reveals request to update-metadata endpoint returned 204 and electron-updater didn't proceed or emit events.

Observations

Observations

When testing with curl and the Electron user-agent, endpoint returns 204; when requesting same URL with a different user-agent, server returns 200 and JSON metadata. NGINX config had conditional handling for Accept or User-Agent leading to no body on HEAD/conditional requests past a size threshold. Older electron-updater expects either 200 with JSON manifest or a 404/200 indicating no update; a 204 is not handled gracefully by this client version.

Already attempted

Already attempted

Verified update JSON valid, toggled Content-Type and forced 200 on server, and saw clients start update check successfully. Tried upgrading electron-updater but deferred due to packaging constraints; added server-side rewrite to return 200 with '{}' and clients recovered.

Question

Question

Why do Electron clients hang forever when update endpoint returns 204, and what's the safest fix that doesn't require immediate client update rollout?

COMMUNITY RESPONSES

Verified community troubleshooting

0 replies

No answers yet..

Showing 0 of 0 community responses
AI DIAGNOSTICS

Incident analysis

Updated 4w ago• Trouble ID

Most likely causes

Update server responds 204 No Content for Electron's user-agent or conditional HEAD requests, and electron-updater doesn't handle 204 95%
NGINX/hosting conditional rules strip response body for certain request headers or content-negotiation leading to 204 60%
Bug in older electron-updater version where non-200 responses aren't emitted as events causing silent hang 30%

Summary

electron-updater implementation expects a JSON manifest or a 404/200 response; a 204 No Content response is not handled by the client, causing it to wait without emitting events. The root cause is the server returning 204 based on user-agent or conditional handling (e.g., nginx location rules). Since changing client requires release, the server should be patched to return an explicit 200 with empty JSON or proper manifest. Alternatively, upgrade client library to a version that understands 204. The server fix is reversible and safe.

Suggested Fixes

Diagnostic step 1
Change the update endpoint to always return 200 with the expected JSON manifest; if no update is available, return 200 with an explicit body (e.g., {"version":null} or {}) that the client can parse.
Diagnostic step 2
Add a small NGINX rule to override user-agent-based behavior and force a body for electron-updater requests (match electron UA string), or remove the conditional that produces 204 responses.
Diagnostic step 3
Plan a client upgrade to a newer electron-updater that tolerates 204 responses, but deploy the server fix first so current clients resume receiving updates immediately.

Continue troubleshooting

Matched from the title, description and tags