1
0
Derivar 0

Missing error handling #1

fechada(s)
2019-01-14 20:27:44 +00:00 aberta(s) por Ghost · 2 comentários

There is one code path where getCertificatesAsync is executed without any error handler: https://git.coolaj86.com/coolaj86/le-sni-auto.js/src/branch/master/index.js#L141

If the promise is rejected for any reason the node process crashes due to UnhandledRejectionError: Unhandled rejection.

There is one code path where getCertificatesAsync is executed without any error handler: https://git.coolaj86.com/coolaj86/le-sni-auto.js/src/branch/master/index.js#L141 If the promise is rejected for any reason the node process crashes due to `UnhandledRejectionError: Unhandled rejection`.
Autor(a)

This is causing a bit of headache of mine as the error crashes the server once I changed the renewalBy value

Error: [ERROR] Certificate issued at '2018-11-20T02:13:58.000Z' and expires at '2019-02-18T02:13:58.000Z'. Ignoring renewal attempt until '2019-02-04T02:13:58.000Z'. Set { duplicate: true } to force. (Most recent call first)
at Object.renewAsync (/opt/node-v10.15/lib/node_modules/michaelhost/node_modules/greenlock/lib/core.js line 341 col 17)
338        log(args.debug, "(Renew) Renewable At", new Date(renewableAt).toISOString());
339
340        if (!args.duplicate && Date.now() < renewableAt) {
341          err = new Error(
342              "[ERROR] Certificate issued at '"
343            + new Date(certs.issuedAt).toISOString() + "' and expires at '"
344            + new Date(certs.expiresAt).toISOString() + "'. Ignoring renewal attempt until '"
at <unknown> (/opt/node-v10.15/lib/node_modules/michaelhost/node_modules/greenlock/index.js line 451 col 43)
448
449            if (results.certs) {
450              log(gl.debug, 'gl renewing');
451              return gl.core.certificates.renewAsync(results.options, results.certs).then(
452                function (certs) {
453                  // Workaround for https://github.com/nodejs/node/issues/22389
454                  gl._updateServernames(certs);
at Promise.resolve.then.then.result (/opt/node-v10.15/lib/node_modules/michaelhost/lib/initGreenlock.js line 24 col 25)
21
22          return { options, certs };
23        })
24        .then(result => cb(null, result), error => cb(error)),
25  });
26
27  return greenlock;
This is causing a bit of headache of mine as the error crashes the server once I changed the renewalBy value ``` Error: [ERROR] Certificate issued at '2018-11-20T02:13:58.000Z' and expires at '2019-02-18T02:13:58.000Z'. Ignoring renewal attempt until '2019-02-04T02:13:58.000Z'. Set { duplicate: true } to force. (Most recent call first) at Object.renewAsync (/opt/node-v10.15/lib/node_modules/michaelhost/node_modules/greenlock/lib/core.js line 341 col 17) 338 log(args.debug, "(Renew) Renewable At", new Date(renewableAt).toISOString()); 339 340 if (!args.duplicate && Date.now() < renewableAt) { 341 err = new Error( 342 "[ERROR] Certificate issued at '" 343 + new Date(certs.issuedAt).toISOString() + "' and expires at '" 344 + new Date(certs.expiresAt).toISOString() + "'. Ignoring renewal attempt until '" at <unknown> (/opt/node-v10.15/lib/node_modules/michaelhost/node_modules/greenlock/index.js line 451 col 43) 448 449 if (results.certs) { 450 log(gl.debug, 'gl renewing'); 451 return gl.core.certificates.renewAsync(results.options, results.certs).then( 452 function (certs) { 453 // Workaround for https://github.com/nodejs/node/issues/22389 454 gl._updateServernames(certs); at Promise.resolve.then.then.result (/opt/node-v10.15/lib/node_modules/michaelhost/lib/initGreenlock.js line 24 col 25) 21 22 return { options, certs }; 23 }) 24 .then(result => cb(null, result), error => cb(error)), 25 }); 26 27 return greenlock; ```
Proprietário(a)

Published le-sni-auto@2.1.9

Many thanks to @layerssss for the fix. Sorry for the long delay.

Published le-sni-auto@2.1.9 Many thanks to @layerssss for the fix. Sorry for the long delay.
coolaj86 encerrou esta questão 2019-04-15 17:39:25 +00:00
Inicie a sessão para participar neste diálogo.
Sem rótulo
Sem etapa
Sem encarregados
2 Participantes
Notificações
Data de vencimento
A data de vencimento é inválida ou está fora do intervalo permitido. Por favor, use o formato 'aaaa-mm-dd'.

Sem data de vencimento definida.

Dependências

Não estão definidas dependências.

Referência: coolaj86/le-sni-auto.js#1
Nenhuma descrição fornecida.