homebridge/homebridge-config-ui-x

Homebridge fails to start up after Updating to homebridge-config-ui-x 4.54.0, or 4.54.1

ne0nex opened this issue · 5 comments

Homebridge fails to start due to dependency issue in 4.54.0 and 4.54.1

I was prompted in the UI to update to 4.54.1 (idk what version I was on but it wasn't 4.54.0) and after updating via the UI, the homebridge stayed stalled at the "Homebridge is starting up" purple screen.

I ssh'd in and checked the logs and saw the log message I posted below about missing passport as an NPM dependency. Weird that the dependency wasn't caught on install.

I attempted to rollback to 4.54.0 (I assumed I was on that prior) so that I could at least get the UI back, and was met with this nice little warning:

pi@pihomebridge:/var/lib/homebridge $ hb-service add homebridge-config-ui-x@4.54.0
ℹ CMD: pnpm -C "/var/lib/homebridge" add homebridge-config-ui-x@4.54.0
Packages: +8 -8
++++++++--------
Downloading registry.npmjs.org/homebridge-config-ui-x/4.54.0: 16.4 MB/16.4 MB, done
Progress: resolved 744, reused 742, downloaded 1, added 8, done

dependencies:
- homebridge-config-ui-x 4.54.1
+ homebridge-config-ui-x 4.54.0 (4.54.1 is available)

 WARN  Issues with peer dependencies found
.
└─┬ homebridge-config-ui-x
  └─┬ @nestjs/passport
    └── ✕ missing peer passport@"^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0"
Peer dependencies that should be installed:
  passport@"^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0"  

so it's obvious that the passport npm module dependency isn't being installed. I went ahead and installed it with:

pnpm -C "/var/lib/homebridge" add passport

and that resolved my issue but I wanted to bring this up here for others because after searching for 'passport' in this repo I didn't find reports of this same thing happening.

Logs

[09/12/2023, 09:46:18] [HB Supervisor] UI Path: /var/lib/homebridge/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[09/12/2023, 09:46:19] [HB Supervisor] ERROR: The user interface threw an unhandled error
Error: Cannot find module 'passport'
Require stack:

  • /var/lib/homebridge/node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.2.10/node_modules/@nestjs/passport/dist/auth.guard.js
  • /var/lib/homebridge/node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.2.10/node_modules/@nestjs/passport/dist/index.js
  • /var/lib/homebridge/node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.2.10/node_modules/@nestjs/passport/index.js
  • /var/lib/homebridge/node_modules/.pnpm/homebridge-config-ui-x@4.54.0/node_modules/homebridge-config-ui-x/dist/main.js
  • /var/lib/homebridge/node_modules/.pnpm/homebridge-config-ui-x@4.54.0/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module.load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object. (/var/lib/homebridge/node_modules/.pnpm/@nestjs+passport@10.0.3
    @nestjs+common@10.2.10/node_modules/@nestjs/passport/dist/auth.guard.js:17:18)
    at Module.compile (node:internal/modules/cjs/loader:1256:14)
    at Module.extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module.load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/var/lib/homebridge/node_modules/.pnpm/@nestjs+passport@10.0.3
    @nestjs+common@10.2.10/node_modules/@nestjs/passport/dist/auth.guard.js',
    '/var/lib/homebridge/node_modules/.pnpm/@nestjs+passport@10.0.3
    @nestjs+common@10.2.10/node_modules/@nestjs/passport/dist/index.js',
    '/var/lib/homebridge/node_modules/.pnpm/@nestjs+passport@10.0.3
    @nestjs+common@10.2.10/node_modules/@nestjs/passport/index.js',
    '/var/lib/homebridge/node_modules/.pnpm/homebridge-config-ui-x@4.54.0/node_modules/homebridge-config-ui-x/dist/main.js',
    '/var/lib/homebridge/node_modules/.pnpm/homebridge-config-ui-x@4.54.0/node_modules/homebridge-config-ui-x/dist/bin/hb-service.js'
    ]
    }

Config

No response

Homebridge UI Version

4.54.0

Homebridge Version

1.7.0

Node.js Version

18.18.0

Operating System

Official Homebridge Raspberry Pi Image

Environment Info

  • Using Docker?
  • Using Hyper-V?
  • Using hb-service?

Raspberry Pi Model

Raspberry Pi 4 B

Hi @ne0nex

Are you happy to try a beta version to see if this has been resolved? 4.54.2-beta.4

https://github.com/homebridge/homebridge-config-ui-x/wiki/How-To-Test-Upcoming-Changes

Hi @ne0nex

Are you happy to try a beta version to see if this has been resolved? 4.54.2-beta.4

https://github.com/homebridge/homebridge-config-ui-x/wiki/How-To-Test-Upcoming-Changes

Yep, no problems checking for issue resolution on a beta, however for my daily-run I'll run release. I did some testing this weekend with beta. Because I did after all fix the issue on my system by installing passport, I had to revert those fixes. Here's what I did and the result.

  1. Mirrored the filesystem onto test storage media and booted my pi using that instead of the production environment.

  2. Reverted homebridge-config-ui-x to 4.53.0 (based on my backups and logs):
    hb-service add homebridge-config-ui-x@4.53.0
    Revert confirmed. Offered updates again

  3. Uninstalled npm passport package to revert my system to close to how it was before
    pnpm -C "/var/lib/homebridge" remove passport
    Passport packaged removed, confirmed via pnpm -C "/var/lib/homebridge" list

  4. Installed 4.54.0 to ensure the issue returns.
    -ui, clicked upgrade selected 4.54.0
    Confirmed, issue is back, UI is dead due to missing module "passport"

  5. Reverted back to 4.53.0
    hb-service add homebridge-config-ui-x@4.53.0
    4.53.0 works without passport, back in pre-issue state: passport not installed 4.53.0 config-ui-x installed. System is up. Offering updates

  6. Installed beta to ensure issue does not return.
    Ui does not offer 4.54.2-beta.4 but instead offers 4.54.2-beta.16 so I did command line to install beta.4:
    hb-service add homebridge-config-ui-x@4.54.2-beta.4
    Command result: installed with no hit on passport dependency missing like 4.54.0 and 4.54.1, and the service and UI came up like expected normally. No complaints of missing passport module.

  7. Supplemental: updated to UI offered beta.16 and the fix remains, also ensured that passport is still not installed on the system:
    pnpm -C "/var/lib/homebridge" list

Passport is not installed, but system is operational on beta.16

Confirmed the fix is in place for beta.4 and beta.16

@bwp91 I'll keep this testing SD card around until this issue is marked as closed.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been closed as no further activity has occurred.