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

FreeNAS Jail - Will not start after Homebridge Config UI X v4.7.0 update #461

Closed
simonlock opened this issue Jan 11, 2020 · 16 comments
Closed
Labels

Comments

@simonlock
Copy link

Describe Your Problem:
After installing the Homebridge Config UI X v4.7.0 update homebridge fails to start and continually tries to restart unsuccessfully. I am running homebridge in a Freenas Jail as detailed https://github.com/nfarina/homebridge/wiki/FreeNAS-11-Installation-using-a-Jail. and using pm2.

I've tried reinstalling Homebridge. Resetting Homebridge and using just a very simple default json.config and the problem still persists. Perhaps thsi problem is now related to the new UI displaying the cpu usage because the logs mention cpu.js?

Logs:

Show the Homebridge / Homebridge Config UI X logs here.

0|homebridge | [1/11/2020, 11:18:34 AM] [Config] Homebridge Config UI X v4.7.0 is listening on :: port 8080
0|homebridge | TypeError: Cannot read property 'replace' of undefined
0|homebridge | at /usr/local/lib/node_modules/homebridge-config-ui-x/node_modules/systeminformation/lib/cpu.js:817:50
0|homebridge | at Array.forEach ()
0|homebridge | at /usr/local/lib/node_modules/homebridge-config-ui-x/node_modules/systeminformation/lib/cpu.js:814:19
0|homebridge | at ChildProcess.exithandler (child_process.js:292:7)
0|homebridge | at ChildProcess.emit (events.js:219:5)
0|homebridge | at maybeClose (internal/child_process.js:1027:16)
0|homebridge | at Socket. (internal/child_process.js:442:11)
0|homebridge | at Socket.emit (events.js:219:5)
0|homebridge | at Pipe. (net.js:666:12)

Homebridge Config:

    "platforms": [
        {
            "name": "Config",
            "port": 8080,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "c",
            "sudo": true,
            "ssl": {
                "key": "/usr/local/etc/letsencrypt/live/xxx/privkey.pem",
                "cert": "/usr/local/etc/letsencrypt/live/xxx/cert.pem"
            },
            "platform": "config"
        },

Screenshots:

Environment:

  • Node.js Version: Node.js v13.3.0
  • NPM Version: 6.13.6
  • Homebridge Version: 0.4.50
  • Homebridge Config UI X Version:v4.7.0
  • Operating System: FreeNAS-11.2-U7
  • Process Supervisor: freeBSD jail
@oznu
Copy link
Member

oznu commented Jan 11, 2020

I'll check this out soon. I haven't tested shells - you're in fact the first person I've come across who's setup Homebridge this way.

You can roll back to 4.6.7 for now.

sudo npm install -g --unsafe-perm homebridge-config-ui-x@4.6.7

Does your version of FreeNAS support Docker?

@simonlock
Copy link
Author

Thank you for your quick reply and for letting me know how to roll back. I'm up and running for now. Freenas does support docker after first installing a linux vm so not very elegant. I look forward to hearing back from you.

@oznu
Copy link
Member

oznu commented Jan 11, 2020

I'll push an update soon to not crash on cpu stats failure / add the ability to turn it off.

You might not get CPU usage info on your dashboard anymore, but we'll see what I can do.

@oznu oznu changed the title Will not start after Homebridge Config UI X v4.7.0 update FreeNAS Jail - Will not start after Homebridge Config UI X v4.7.0 update Jan 11, 2020
@oznu
Copy link
Member

oznu commented Jan 11, 2020

@simonlock can you let me know what platform Node.js reports you as being on?

You can do this at an interactive Node prompt.

node
os.platform()

@simonlock
Copy link
Author

simonlock commented Jan 11, 2020 via email

@oznu
Copy link
Member

oznu commented Jan 11, 2020

Perfect, thanks. The systeminformation module I'm now using does not support the "current load" command on FreeBSD. I'll find an alternative.

@oznu
Copy link
Member

oznu commented Jan 12, 2020

FreeBSD 12 seems to be ok.

image

@oznu
Copy link
Member

oznu commented Jan 12, 2020

Same with 11.2:

image

@oznu
Copy link
Member

oznu commented Jan 12, 2020

I couldn't replicate this in FreeBSD, I wasn't using a jailed shell though so that may have been the difference.

Either way, I've published a @test version for you to try that uses the same method to get CPU load as v4.6.7 did on freebsd only.

You can install it like this:

sudo npm install -g --unsafe-perm homebridge-config-ui-x@test

Let me know if that works for you.

@simonlock
Copy link
Author

Thanks for your excellent support on this. I've installed your latest test update but Homebridge still continually restarts and I never get to see the status page.

The logs report:

0|homebridge | [1/12/2020, 11:24:48 PM] Homebridge is running on port 51780.
0|homebridge | TypeError: Cannot read property 'replace' of undefined
0|homebridge | at /usr/local/lib/node_modules/homebridge-config-ui-x/node_modules/systeminformation/lib/cpu.js:817:50
0|homebridge | at Array.forEach ()
0|homebridge | at /usr/local/lib/node_modules/homebridge-config-ui-x/node_modules/systeminformation/lib/cpu.js:814:19
0|homebridge | at ChildProcess.exithandler (child_process.js:292:7)
0|homebridge | at ChildProcess.emit (events.js:219:5)
0|homebridge | at maybeClose (internal/child_process.js:1027:16)
0|homebridge | at Process.ChildProcess._handle.onexit (internal/child_process.js:285:5)
0|homebridge | [1/12/2020, 11:24:48 PM] Got SIGTERM, shutting down Homebridge...

I've now moved on to using Homebridge on a Raspberry PI running docker and I'm finding it to be a big improvement over the FreeNAS jail version with great visible logging; which was something that was very much lacking using pm2 on freeNAS. I'm happy to continue testing freeNAS if this is something you'd like to solve?

@oznu
Copy link
Member

oznu commented Jan 13, 2020

Thanks @simonlock,

If you could try one more time with the latest @test I think I have found all the issues:

sudo npm install -g --unsafe-perm homebridge-config-ui-x@test

Let me know if that works for you.

@simonlock
Copy link
Author

I've just tried it out and yes you've solved it. Thanks for your support. The Raspberry Pi version is more feature-rich but this version now works and functions correctly.

fn112

@oznu
Copy link
Member

oznu commented Jan 13, 2020

Great; thanks for testing this out. It saves me having to setup and figure out FreeNAS 😄!

@oznu oznu closed this as completed Jan 13, 2020
@sidbena
Copy link

sidbena commented Jan 13, 2020

I don't mean to reopen the issue itself, more to point out to @simonlock that there are logs when running homebridge (and homebridge-config-ui-x), managed with pm2, through a FreeNAS jail too. The logs are, what I believe, automatically created at /<user pm2 is run as>/.pm2/logs/<pm2 service name>/ as <service name>-[out|error].log so in my case I've got two logs at:

/root/.pm2/logs/homebridge-out.log
/root/.pm2/logs/homebridge-error.log

I've chosen to show the logs within homebridge-config-ui-x by going into the settings for the plugin and under Log Viewer Setup I've chosen Custom Command and for the command:

tail -f /root/.pm2/logs/homebridge-out.log /root/.pm2/logs/homebridge-error.log

This solution makes new log entries show up through the logging web interface that homebridge-config-ui-x provides.
Sorry for the long explanation (and possible reopening) of the issue.

@simonlock
Copy link
Author

simonlock commented Jan 13, 2020 via email

@Grinchii
Copy link

It now works on FreeNAS with the newest Version.

But there seems to be a problem with 10GBE Mellanox Cards. While Homebridge is running the system gets flooded with noise from this card.

mlx4_core0: port level mtu is only used for IB ports
mlx4_core0: port level mtu is only used for IB ports
mlx4_core0: port level mtu is only used for IB ports
mlx4_core0: port level mtu is only used for IB ports
mlx4_core0: port level mtu is only used for IB ports

About every 3sec I get this message twice.

It seems like homebridge in the newest version is using something like sysctl quite often. This trys accessing the card and the error occurs.

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