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

After updating from 1.3.5 to 1.3.6, all but Bond plugin are not found. #3013

Closed
LordJohnWhorfin opened this issue Nov 15, 2021 · 9 comments
Closed
Labels

Comments

@LordJohnWhorfin
Copy link

Describe The Bug:
Under 1.3.6 only the Bond plugin is found. Reverting to 1.3.5 fixes the problem.

To Reproduce:
On Raspberry Pi 4 with 1.3.5 installed and 16.13.0 nodejs with homebridge-bond v3.2.9 and homebridge-myq v2.7.1 installed and configured:

  • On Status tab, select "1.3.6 Update available" and install

Expected behavior:
Bond and MyQ accessories should persist

Logs:

homebridge.log

Homebridge Config:

{
    "bridge": {
        "name": "Homebridge 6ADC",
        "username": "XXXXX",
        "port": 51667,
        "pin": "XXXXX",
        "advertiser": "bonjour-hap",
        "bind": [
            "wlan0",
            "eth0"
        ]
    },
    "accessories": [
        {
            "name": "SolarEdge Inverter",
            "manufacturer": "SolarEdge",
            "model": "1",
            "serial": "1",
            "site_id": "XXXXX",
            "api_key": "XXXXX",
            "update_interval": 15,
            "current": true,
            "currentWatts": true,
            "debug": false,
            "accessory": "SolarEdge Inverter"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "Bitonio",
            "logMqtt": true,
            "switchValues": [
                "1",
                "2",
                "255"
            ],
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "Patio Lights",
            "logMqtt": true,
            "switchValues": [
                "10",
                "20"
            ],
            "topics": {
                "getSwitch": "zway/backyard-patioLights"
            },
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "Jill Torchiere",
            "logMqtt": true,
            "switchValues": [
                "10",
                "20"
            ],
            "topics": {
                "getSwitch": "zway/jillBedroom-jillTorchiere"
            },
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "Jack Lights 1",
            "logMqtt": true,
            "switchValues": [
                "10"
            ],
            "topics": {
                "getSwitch": "zway/jackBedroom-jackSwitch"
            },
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "Jack Lights 2",
            "logMqtt": true,
            "switchValues": [
                "20"
            ],
            "topics": {
                "getSwitch": "zway/jackBedroom-jackSwitch"
            },
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "LR Button 1",
            "logMqtt": true,
            "switchValues": [
                "1",
                "2"
            ],
            "topics": {
                "getSwitch": "tele/tasmota-0757/button1"
            },
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "LR Button 2",
            "logMqtt": true,
            "switchValues": [
                "1",
                "2"
            ],
            "topics": {
                "getSwitch": "tele/tasmota-0757/button2"
            },
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "LR Button 3",
            "logMqtt": true,
            "switchValues": [
                "1",
                "2"
            ],
            "topics": {
                "getSwitch": "tele/tasmota-0757/button3"
            },
            "accessory": "mqttthing"
        },
        {
            "type": "statelessProgrammableSwitch",
            "name": "LR Button 4",
            "logMqtt": true,
            "switchValues": [
                "1",
                "2"
            ],
            "topics": {
                "getSwitch": "tele/tasmota-0757/button4"
            },
            "accessory": "mqttthing"
        },
        {
            "name": "Flume Water Monitor",
            "username": "XXXXX",
            "password": "XXXXX",
            "client_id": "XXXXX",
            "client_secret": "XXXXX",
            "polling_minutes": 1,
            "accessory": "Flume"
        }
    ],
    "platforms": [
        {
            "name": "Config",
            "port": 80,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "platform": "VesyncPlug",
            "name": "VesyncPlug",
            "username": "XXXXX",
            "password": "XXXXX"
        },
        {
            "name": "TuyaWebPlatform",
            "options": {
                "username": "XXXXX",
                "password": "XXXXX",
                "countryCode": "1",
                "platform": "tuya",
                "pollingInterval": 600
            },
            "defaults": [
                {
                    "id": "XXXXX",
                    "device_type": "dimmer",
                    "dimmer_characteristics": [
                        "Brightness"
                    ]
                },
                {
                    "device_type": "form"
                }
            ],
            "scenes": false,
            "platform": "TuyaWebPlatform"
        },
        {
            "username": "XXXXX",
            "password": "XXXXX",
            "apiBaseURL": "http://lacrossealertsmobile.com/v1.2",
            "configCacheSeconds": 960,
            "noResponseMinutes": 30,
            "platform": "LacrosseWeb"
        },
        {
            "name": "Nest",
            "access_token": "XXXXX",
            "structureId": "XXXXX",
            "platform": "Nest"
        },
        {
            "refreshToken": "XXXXX",
            "locationIds": [
                "XXXXX"
            ],
            "platform": "Ring"
        },
        {
            "platform": "Lightify",
            "bridge_ip": "192.168.4.71",
            "name": "Lightify",
            "showGroups": true,
            "hideNodes": false
        },
        {
            "platform": "ZWayServer",
            "name": "ZWayServer",
            "url": "http://127.0.0.1:8083/",
            "login": "admin",
            "password": "XXXXX"
        },
        {
            "name": "Sonos",
            "brightness": true,
            "excludeAirPlay": true,
            "service": "switch",
            "platform": "ZP"
        },
        {
            "name": "ZbBridge",
            "mqttTopic": "tasmota_E3691E",
            "platform": "TasmotaZbBridge"
        },
        {
            "name": "Tasmota",
            "mqttHost": "localhost",
            "cleanup": 24,
            "debug": true,
            "history": false,
            "historyInterval": 10,
            "effects": false,
            "platform": "Tasmota"
        },
        {
            "email": "XXXXX",
            "password": "XXXXX",
            "options": [
                "Disable.CG0830160818",
                "Disable.CG08430A44DA"
            ],
            "debug": false,
            "platform": "myQ"
        },
        {
            "mqtt": {
                "base_topic": "zigbee2mqtt",
                "server": "mqtt://localhost:1883",
                "reject_unauthorized": false,
                "keepalive": 60,
                "version": 4
            },
            "platform": "zigbee2mqtt"
        },
        {
            "name": "MerossCloud",
            "email": "XXXXX",
            "password": "XXXXX",
            "devicediscovery": false,
            "platform": "MerossCloud"
        },
          {
            "bonds": [
                {
                    "ip_address": "192.168.4.34",
                    "token": "XXXXX"
                }
            ],
            "include_dimmer": true,
            "include_toggle_state": false,
            "fan_speed_values": true,
            "platform": "Bond"
        },
        {
            "devices": [
                {
                    "type": "null"
                }
            ],
            "platform": "TuyaLan"
        }
    ],
    "disabledPlugins": [
        "homebridge-meross",
        "homebridge-meross-cloud",
        "homebridge-flume-water-sensor"
    ]
}

Screenshots:

Environment:

  • Node.js Version: 16.13.0
  • NPM Version: v8.1.0
  • Homebridge Version: 1.3.6
  • Operating System: Raspbian
  • Process Supervisor: none
@Supereg
Copy link
Member

Supereg commented Nov 19, 2021

For traceability purposes, this is the error occurring:

[15/11/2021, 15:32:25] ERROR LOADING PLUGIN homebridge-flume-water-sensor:
[15/11/2021, 15:32:25] Error [ERR_REQUIRE_ESM]: require() of ES Module /usr/local/lib/node_modules/homebridge-flume-water-sensor/node_modules/node-fetch/src/index.js from /usr/local/lib/node_modules/homebridge-flume-water-sensor/index.js not supported.
Instead change the require of /usr/local/lib/node_modules/homebridge-flume-water-sensor/node_modules/node-fetch/src/index.js in /usr/local/lib/node_modules/homebridge-flume-water-sensor/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-flume-water-sensor/index.js:1:15)
    at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:132:77)
    at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/lib/pluginManager.js:64:30)
    at async Server.start (/usr/local/lib/node_modules/homebridge/lib/server.js:106:9)

For context, your plugin loader seems to skip all further plugins, if one of them encountered an error. The problematic plugin is homebridge-flume-water-sensor.

This issue is most likely caused by #2915. We will investigate if this issue is an error in our codebase or caused by the plugin itself.

@Supereg
Copy link
Member

Supereg commented Nov 19, 2021

Getting a rough overview of the situation, it seems you have the homebridge-flume-water-sensor disabled, right?
To verify my suspicion, could you send us the homebridge log output when starting up with version 1.3.5, please?

I have the feeling, this isn't entirely #2915, but a slight change which slipped through how we continue after a plugin initialization error.

@LordJohnWhorfin
Copy link
Author

homebridge_1.3.5.log

Hi Supereg, thanks, you're correct the Flume plugin is disabled. Anything you want me to test, let me know :-)

@ShogunPanda
Copy link
Contributor

ShogunPanda commented Nov 22, 2021

Hello!
I checked, the problem is in homebridge-flume-water-sensor. Their package.json specifies "node-fetch": ">=2.6.0", which means that lately is downloading node-fetch v3.1.0 or similar.
Now, the problem is that node-fetch has gone to ESM only in v3.0.0, so it cannot be loaded using require anymore. This is not related to #2915 as all it does is to make plugin loading async, but nothing is parallelized.

@bwp91
Copy link
Contributor

bwp91 commented Nov 22, 2021

Hello!
I checked, the problem is in homebridge-flume-water-sensor. Their package.json specifies "node-fetch": ">=2.6.0", which means that lately is downloading node-fetch v3.1.0 or similar.
Now, the problem is that node-fetch has gone to ESM only in v3.0.0, so it cannot be loaded using require anymore. This is not related to #2915 as all it does is to make plugin loading async, but nothing is parallelized.

I can’t find the git repo for this plugin, has it been deleted? Ideally needs a pull request changing the package json node-fetch version to "node-fetch": "^2.6.0"

@ShogunPanda
Copy link
Contributor

Yes, I couldn't find it either. I discovered by using the Explore tab on npmjs.com. I suspect downgrading to 1.3.5 worked as some dependency forces node-fetch to v2.x.x

@bwp91
Copy link
Contributor

bwp91 commented Nov 22, 2021

Okay, homebridge-flume now exists which uses the code of the (seems to be forgotten about) homebridge-flume-water-sensor.

@LordJohnWhorfin can you try to uninstall the old plugin (homebridge-flume-water-sensor) and install homebridge-flume?

@LordJohnWhorfin
Copy link
Author

Thanks so much for all your work guys. I removed the old homebridge-flume-water-sensor plugin, installed home bridge-flume, updated, restarted, and everything is working great! I'll be more careful with experimental plugins -- I didn't realize they could cause problems once disabled. Thanks again!

@bwp91
Copy link
Contributor

bwp91 commented Nov 22, 2021

@LordJohnWhorfin are you on the homebridge discord? it would be useful to be able to message you about the plugin i have created

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

No branches or pull requests

4 participants