ERROR: TypeError: Cannot read property 'kid' of undefined #19

Закрыто
открыт 2019-04-04 19:59:33 +00:00 пользователем Ghost · комментариев: 6
Ghost прокомментировал(а) 2019-04-04 19:59:33 +00:00

I have encountered the following error when running the script to get a new certificate:

ERROR: TypeError: Cannot read property 'kid' of undefined

After a little bit of debugging it seems the error is raised when indexing into the undefined account object in this line, which might be due to the breaking changes mentioned here.

I was able to overcome my issue by making the following monkey patch to the line

if (options.accountKid || options.account && options.account.kid) {

Looking to see if I should submit a pull request or if a maintainer wants to push this update or any advice on the issue is very much appreciated.

Thanks!

I have encountered the following error when running the script to get a new certificate: `ERROR: TypeError: Cannot read property 'kid' of undefined` After a little bit of debugging it seems the error is raised when indexing into the undefined account object in this [line](https://git.coolaj86.com/coolaj86/acme-v2.js/src/branch/master/node.js#L701), which might be due to the breaking changes mentioned [here](https://git.coolaj86.com/coolaj86/acme-v2.js/issues/8). I was able to overcome my issue by making the following monkey patch to the line `if (options.accountKid || options.account && options.account.kid) {` Looking to see if I should submit a pull request or if a maintainer wants to push this update or any advice on the issue is very much appreciated. Thanks!
coolaj86 прокомментировал(а) 2019-04-04 20:07:12 +00:00
Владелец

Thanks for the report. I'll fix that

You could tell me which plugins you're using and which versions? And what "script"?

For example:

  • greenlock@v2.7.6
  • le-challenge-dns@v3.0.2

That upcoming breaking change is unrelated to the current code (and won't break the code).

It shouldn't be possible for something to get to this module without an account in the first place... but I'll push that fix momentarily anyway. Again, thank you.

Thanks for the report. I'll fix that You could tell me which plugins you're using and which versions? And what "script"? For example: * greenlock@v2.7.6 * le-challenge-dns@v3.0.2 That upcoming breaking change is unrelated to the current code (and won't break the code). It _shouldn't_ be possible for something to get to this module without an account in the first place... but I'll push that fix momentarily anyway. Again, thank you.
coolaj86 упомянул эту задачу в коммите 2019-04-04 20:09:04 +00:00
coolaj86 прокомментировал(а) 2019-04-04 20:09:45 +00:00
Владелец

Published as v1.7.5. But please do let me know the conditions that were broke it so I can get that fixed as well.

Published as v1.7.5. But please do let me know the conditions that were broke it so I can get that fixed as well.
Ghost прокомментировал(а) 2019-04-04 20:14:02 +00:00
Автор

I am using greenlock@v2.7.6 and le-challenge-dns@v2.3.2

Not a problem at all, thank you for responding and maintaining this repository and let me know if I can provide anything else to help

I am using greenlock@v2.7.6 and le-challenge-dns@v2.3.2 Not a problem at all, thank you for responding and maintaining this repository and let me know if I can provide anything else to help
coolaj86 прокомментировал(а) 2019-04-04 21:30:34 +00:00
Владелец

Hmm... those two versions are a bit out of sync.

You'll need to have le-challenge-dns@v3.0.2, which should be in the package-lock.json for greenlock@2.7.6. But that's unrelated, I would think.

I definitely saw the code where, during account registration, the account object is creating if it doesn't exist. I'm curious as to how that error is happening.

Anyway, do an npm update; npm install and see if you still get the error.

Hmm... those two versions are a bit out of sync. You'll need to have `le-challenge-dns@v3.0.2`, which should be in the package-lock.json for greenlock@2.7.6. But that's unrelated, I would think. I definitely saw the code where, during account registration, the account object is creating if it doesn't exist. I'm curious as to how that error is happening. Anyway, do an `npm update; npm install` and see if you still get the error.
coolaj86 прокомментировал(а) 2019-04-04 21:31:09 +00:00
Владелец

If you have a package-lock.json in your project, maybe remove that first so it doesn't prevent updates (though it shouldn't block an explicit npm update).

If you have a `package-lock.json` in your project, maybe remove that first so it doesn't prevent updates (though it shouldn't block an explicit `npm update`).
Ghost прокомментировал(а) 2019-04-05 16:37:20 +00:00
Автор

I've done an update which included your patch fix and it seems to have solved my error 👍

thanks again for the help!

I've done an update which included your patch fix and it seems to have solved my error :+1: thanks again for the help!
Ghost закрыл(а) эту задачу 2019-04-05 16:37:35 +00:00
coolaj86 упомянул эту задачу в коммите 2019-10-21 20:56:25 +00:00
Войдите, чтобы присоединиться к обсуждению.
Нет меток
Нет этапа
Нет назначенных лиц
2 участников
Уведомления
Срок выполнения
Срок действия недействителен или находится за пределами допустимого диапазона. Пожалуйста, используйте формат 'гггг-мм-дд'.

Срок выполнения не установлен.

Зависимости

Зависимостей нет.

Ссылка: coolaj86/acme.js-ARCHIVED#19
Описание отсутствует.