bubenshchykov / ngrok

Expose your localhost to the web. Node wrapper for ngrok.
https://ngrok.com
2.33k stars 317 forks source link

ngrok gives 503 error and it does not gets started #242

Closed pranav-pkasthana closed 3 years ago

pranav-pkasthana commented 3 years ago

ngrok does not gets started immediately and gives following error "a successful ngrok tunnel session has not yet been established"

the module checks for error 500 and 502 but no action is taken for 503

adding below code works const notReady503 = err.statusCode === 503 && body.details && body.details.err === 'a successful ngrok tunnel session has not yet been established';

function isRetriable (err) { if (!err.response) return false; const body = err.response.body; const notReady500 = err.statusCode === 500 && /panic/.test(body) const notReady502 = err.statusCode === 502 && body.details && body.details.err === 'tunnel session not ready yet'; const notReady503 = err.statusCode === 503 && body.details && body.details.err === 'a successful ngrok tunnel session has not yet been established'; return notReady500 || notReady502 || notReady503; }

pranav-pkasthana commented 3 years ago

fixed in version 3.4.1 onwards