Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.8.0 leads to error when starting homebridge in development environment #3603

Closed
maxileith opened this issue Apr 24, 2024 · 7 comments · Fixed by #3604
Closed

v1.8.0 leads to error when starting homebridge in development environment #3603

maxileith opened this issue Apr 24, 2024 · 7 comments · Fixed by #3604
Labels

Comments

@maxileith
Copy link

Analysis

I just wanted to start my development environment with the new homebridge version v1.8.0. However, it seems like there are some changes that change the behaviour unexpectedly. I have setup my development environment like in the plugin template with some modifications (see here). The most important part is probably the nodemon.json config which I have added to the additional context of this issue template. I have no issues with this setup and homebridge version v1.7.0.

Expected Behavior

I would expect to that homebridge starts like with version v1.7.0 as there is not change to the cli interface documented.

Steps To Reproduce

  1. Setup the development environment like in the plugin template (or just checkout mine ^^)
  2. Start the development environment with npm run watch

Logs

[nodemon] 3.1.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/* user_storage/config.json
[nodemon] watching extensions: ts
[nodemon] starting `tsc && homebridge --insecure --debug --user-storage-path ./user_storage`
[4/25/2024, 1:27:42 AM] Loaded config.json with 0 accessories and 2 platforms.
[4/25/2024, 1:27:42 AM] Loaded 0 cached accessories from cachedAccessories.
[4/25/2024, 1:27:42 AM] ---
[4/25/2024, 1:27:42 AM] Loaded plugin: homebridge-config-ui-x@4.56.1
[4/25/2024, 1:27:42 AM] Registering platform 'homebridge-config-ui-x.config'
[4/25/2024, 1:27:42 AM] ---
[4/25/2024, 1:27:42 AM] Loaded plugin: homebridge-appletv-enhanced@1.3.1
[4/25/2024, 1:27:42 AM] Registering platform 'homebridge-appletv-enhanced.AppleTVEnhanced'
[4/25/2024, 1:27:42 AM] ---
[4/25/2024, 1:27:42 AM] Loading 2 platforms...
[4/25/2024, 1:27:42 AM] [Config] Initializing config platform...
[4/25/2024, 1:27:42 AM] Error: Cannot add option '-P, --plugin-path [path]' to command 'homebridge' due to conflicting flag '--plugin-path'
-  already used by option '-P, --plugin-path [path]'
    at Command._registerOption (/home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/commander/lib/command.js:579:13)
    at Command.addOption (/home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/commander/lib/command.js:616:10)
    at Command._optionEx (/home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/commander/lib/command.js:701:17)
    at Command.option (/home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/commander/lib/command.js:727:17)
    at new HomebridgeConfigUi (/home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/homebridge-config-ui-x/src/index.ts:24:8)
    at /home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/homebridge/src/server.ts:462:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/homebridge/src/server.ts:389:27)
    at Server.start (/home/maxileith/Downloads/homebridge-appletv-enhanced/node_modules/homebridge/src/server.ts:164:29)

Configuration

{}

Environment

  • OS: Linux Maxi-Manjaro 6.8.5-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Apr 10 20:15:45 UTC 2024 x86_64 GNU/Linux
  • Homebridge: 1.8.0
  • Node: v20.12.2
  • npm: 10.5.0

Process Supervisor

hb-service

Additional Context

This is my nodemon.json

{
    "watch": ["src", "user_storage/config.json"],
    "ext": "ts",
    "ignore": [],
    "exec": "tsc && homebridge --insecure --debug --user-storage-path ./user_storage",
    "signal": "SIGTERM",
    "env": {
        "NODE_OPTIONS": "--trace-warnings"
    }
}
@maxileith maxileith added the bug label Apr 24, 2024
@NorthernMan54
Copy link
Contributor

I was able to recreate this in my test environment, stay tuned

@jochenpa
Copy link

jochenpa commented Apr 25, 2024

Hi.

I have the same error message after update to 1.8.0, but I thought it was because I still don't use Service-Modus.
I knew this is deprecated and at some time I have to change my system ...

I also got another error message, but that might be related ...
Here my whole log:

Started homebridge.service - Node.js HomeKit Server.
[22.4.2024, 10:49:27] Loaded config.json with 0 accessories and 2 platforms.
[22.4.2024, 10:49:27] Loaded 0 cached accessories from cachedAccessories.
[22.4.2024, 10:49:27] ---
[22.4.2024, 10:49:28] Loaded plugin: homebridge-config-ui-x@4.56.1
[22.4.2024, 10:49:28] Registering platform 'homebridge-config-ui-x.config'
[22.4.2024, 10:49:28] ---
[22.4.2024, 10:49:28] Loaded plugin: homebridge-fhem@0.5.38
homebridge API version: 2.7
this is homebridge-fhem 0.5.38
[22.4.2024, 10:49:29] Registering platform 'homebridge-fhem.FHEM'
[22.4.2024, 10:49:29] ---
[22.4.2024, 10:49:29] Loading 2 platforms...
[22.4.2024, 10:49:29] [Config] Initializing config platform...
[22.4.2024, 10:49:29] Error: Cannot add option '-P, --plugin-path [path]' to command 'homebridge' due to conflicting flag '--plugin-path'
-  already used by option '-P, --plugin-path [path]'
    at Command._registerOption (/home/homebridge/node_modules/commander/lib/command.js:579:13)
    at Command.addOption (/home/homebridge/node_modules/commander/lib/command.js:616:10)
    at Command._optionEx (/home/homebridge/node_modules/commander/lib/command.js:701:17)
    at Command.option (/home/homebridge/node_modules/commander/lib/command.js:727:17)
    at new HomebridgeConfigUi (/home/homebridge/node_modules/homebridge-config-ui-x/src/index.ts:24:8)
    at /home/homebridge/node_modules/homebridge/src/server.ts:462:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/home/homebridge/node_modules/homebridge/src/server.ts:389:27)
    at Server.start (/home/homebridge/node_modules/homebridge/src/server.ts:164:29)
Server listening on: http://<ip>:8282
[22.4.2024, 10:49:29] Got SIGTERM, shutting down Homebridge...
[22.4.2024, 10:49:29] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet!
    at Bridge.Accessory.setupURI (/home/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11)
    at Server.setServerStatus (/home/homebridge/node_modules/homebridge/src/server.ts:143:45)
    at Server.teardown (/home/homebridge/node_modules/homebridge/src/server.ts:187:10)
    at signalHandler (/home/homebridge/node_modules/homebridge/src/cli.ts:93:12)
    at process.emit (node:events:518:28)
    at process.emit (/home/homebridge/node_modules/source-map-support/source-map-support.js:516:21)
homebridge.service: Main process exited, code=exited, status=143/n/a
homebridge.service: Failed with result 'exit-code'.
homebridge.service: Consumed 2.188s CPU time.
homebridge.service: Scheduled restart job, restart counter is at 84.
Stopped homebridge.service - Node.js HomeKit Server.
homebridge.service: Consumed 2.188s CPU time.

Jochen

@bwp91
Copy link
Contributor

bwp91 commented Apr 25, 2024

Hi @maxileith

In your local appletv plugin, can you update the (dev)dependency versions in your package json to the following:

        "homebridge": "^1.8.1-beta.0",
        "homebridge-config-ui-x": "^4.56.2-beta.40",

reinstall, re-run watch and see if the issue no longer appears?

@jochenpa
Copy link

jochenpa commented Apr 26, 2024

Hello

        "homebridge": "^1.8.1-beta.0",
        "homebridge-config-ui-x": "^4.56.2-beta.40",

Works for me, thank you.

Jochen

@maxileith
Copy link
Author

@bwp91 works like a charm

@bwp91
Copy link
Contributor

bwp91 commented Apr 27, 2024

Thanks both for the feedback, have just released HB 1.8.1 with this fix!

@jochenpa
Copy link

HI

Final version also works here.
Thank you again. :-)

Jochen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants