Bubba8291 / homebridge-sharkiq

A Homebridge plugin to connect your Shark Vacuum to homebridge.
Apache License 2.0
9 stars 1 forks source link

Could not find Chrome preventing login #24

Open mmenanno opened 3 weeks ago

mmenanno commented 3 weeks ago

Describe The Bug: When the plugin starts up it throws an error about Chrome not being found, this is my only installed plugin that experiences this.

To Reproduce: Not sure, I just start the plugin

Expected behavior: No error would be thrown

Logs:

[10/9/2024, 6:42:09 PM] [SharkIQ] Loading accessory from cache: Clean Elizabeth
[10/9/2024, 6:42:09 PM] Homebridge v1.8.4 (HAP v0.12.2) (SharkIQ) is running on port 42594.
[10/9/2024, 6:42:09 PM] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[10/9/2024, 6:42:09 PM] [SharkIQ] Error with login.
[10/9/2024, 6:42:09 PM] [SharkIQ] Error: Error: Could not find Chrome (ver. 129.0.6668.70). This can occur if either
 1. you did not perform an installation before running the script (e.g. `npx puppeteer browsers install chrome`) or
 2. your cache path is incorrectly configured (which is: /home/homebridge/.cache/puppeteer).
For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.

Plugin Config:

{
    "name": "SharkIQ",
    "email": "EMAIL",
    "password": "PASSWORD",
    "vacuums": [
        "AC000W028317129"
    ],
    "europe": false,
    "invertDockedStatus": false,
    "dockedUpdateInterval": 5000,
    "_bridge": {
        "username": "0E:C6:5C:36:5C:6F",
        "port": 42594
    },
    "platform": "SharkIQ"
}

Screenshots:

image

Environment:

srmora commented 3 weeks ago

I am getting the same issues... I performed some of the suggested fixes and not I am gettin this error..

[10/9/2024, 6:12:19 PM] [SharkIQ] Error with login. [10/9/2024, 6:12:19 PM] [SharkIQ] Error: Error: Failed to launch the browser process! undefined [3978:3978:1009/181219.450356:ERROR:zygote_host_impl_linux.cc(101)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

Plugin Version: v1.3.1 Homebridge Version: 1.8.4 Node.js Version: v20.11.0

Bubba8291 commented 3 weeks ago

@mmenanno @srmora What architecture is your devices?

srmora commented 3 weeks ago

The sharkiq is model UR250BEOUSHomridege is running on Ubuntu in a hyperv instance.  I’ve been running your plug-in since you first released it and everything has been perfect. I’ve tried reverting back to previous versions, but anything beyond the recent won’t allow me to enter in my username and password, installing the most recent always gives me the same error. I’m not sure what else I can do. Thanks.—Stephen Moracourage.loyalty.self-discipline.simple livingOn Oct 11, 2024, at 3:22 PM, Bubba8291 @.***> wrote: @mmenanno @srmora What architecture is your devices?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Bubba8291 commented 3 weeks ago

@srmora I meant like arm, arm64, amd, amd64. You can check by running uname -p

mmenanno commented 3 weeks ago

@srmora I meant like arm, arm64, amd, amd64. You can check by running uname -p

Checked for myself and running uname -p in the homebridge terminal says x86_64

idle0095 commented 3 weeks ago

I have the same issue. Using home bridge on a synology NAS. I tried this plugin on my raspberry PI 4 and had Oauth issues. Would pull the key with an error 403. This is the first plugin I have used in years where I had to comment for help.

srmora commented 3 weeks ago

Oh yeah sorry yes X 86_64. As I says, it’s a window server hosting a Ubuntu VM.—Stephen Moracourage.loyalty.self-discipline.simple livingOn Oct 12, 2024, at 2:58 PM, Michael Menanno @.***> wrote:

@srmora I meant like arm, arm64, amd, amd64. You can check by running uname -p

Checked for myself and running uname -p in the homebridge terminal says x86_64

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Bubba8291 commented 2 weeks ago

@mmenanno @srmora I did some research. Turns out chromium did not install all the way.

Run $(npm root -g)/homebridge-sharkiq/node_modules/puppeteer/install.mjs to install it manually.

Keep in mind pi 4 email/password login is not currently supported due to chromium not having a arm64 build. I am looking into a workaround. For now with arm64 devices, use the manual login. The instructions are on the README.

srmora commented 2 weeks ago

Thank you, but I’m unsure where to install this. I try to Apply it in the terminal. I get an error as no run command. This is a docker Homebridge VM instance x86 not arm./var/lib/homebridge/node_modules/homebridge-sharkiq/node_modules/puppeteerPuppeteer does exists and is in the path. —Stephen Moracourage.loyalty.self-discipline.simple livingOn Oct 16, 2024, at 12:59 PM, Bubba8291 @.***> wrote: @mmenanno @srmora I did some research. Turns out chromium did not install all the way. Run $(npm root -g)/homebridge-sharkiq/node_modules/puppeteer/install.mjs to install it manually. Keep in mind pi 4 email/password login is not currently supported due to chromium not having a arm64 build. I am looking into a workaround. For now with arm64 devices, use the manual login. The instructions are on the README.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Judas2016 commented 2 weeks ago

I'm having the same problem, i'm running the plugin on a diskstation NAS device under a docker container. Is expectation to install chrome in the container? I was able to make oAuth work, you might make note in readme to make the URL show in the logs you have to remove email and password from config to force oAuth and the logging of the url.

Bubba8291 commented 2 weeks ago

@srmora Can you send a screenshot of the terminal? The error messages you're forwarding are weirdly formatted in GitHub

Bubba8291 commented 2 weeks ago

@Judas2016 Glad it's working. Yeah, there should be a separate node_modules folder in the homebridge-sharkiq folder where ever the global node_modules are.

I will definitely add that for the next README

srmora commented 2 weeks ago

I tried running your command several ways, my guess is that they install.mja does not exist??

These are were my plugins are located, if that makes sense

Understand that I had the original errors that resembled the first ticket, but I fell into a rabbit hole applying the suggested updates in the various error messages..

So to be clear my current error message is there

Thank you... — Stephen Mora courage.loyalty.self-discipline.simple living

On Oct 17, 2024, at 8:32 AM, Bubba8291 @.***> wrote:

@srmora https://github.com/srmora Can you send a screenshot of the terminal? The error messages you're forwarding are weirdly formatted in GitHub

— Reply to this email directly, view it on GitHub https://github.com/Bubba8291/homebridge-sharkiq/issues/24#issuecomment-2419872118, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYI66K2H26MYRP75IXJOKTZ37KALAVCNFSM6AAAAABPVQ3JK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJZHA3TEMJRHA. You are receiving this because you were mentioned.

mmenanno commented 2 weeks ago

I tried running the command in my Homebridge terminal and got:

bash: /opt/homebridge/lib/node_modules/homebridge-sharkiq/node_modules/puppeteer/install.mjs: No such file or directory

That being said, I saw what you were going for with the command and figured out what it should have been was: "$UIX_CUSTOM_PLUGIN_PATH"/homebridge-sharkiq/node_modules/puppeteer/install.mjs

This seemed to run an install process. I then restarted the child bridge and there is now a new error:

[10/17/2024, 5:57:09 PM] [SharkIQ] Launched child bridge with PID 6264
[10/17/2024, 5:57:09 PM] [SharkIQ] Loaded homebridge-sharkiq v1.3.1 child bridge successfully
[10/17/2024, 5:57:09 PM] Loaded 1 cached accessories from cachedAccessories.0EC65C365C6F.
[10/17/2024, 5:57:09 PM] [SharkIQ] Loading accessory from cache: Clean Elizabeth
[10/17/2024, 5:57:10 PM] Homebridge v1.8.4 (HAP v0.12.2) (SharkIQ) is running on port 42594.
[10/17/2024, 5:57:10 PM] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[10/17/2024, 5:57:10 PM] [SharkIQ] Error with login.
[10/17/2024, 5:57:10 PM] [SharkIQ] Error: Error: Failed to launch the browser process!
/home/homebridge/.cache/puppeteer/chrome/linux-129.0.6668.70/chrome-linux64/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://pptr.dev/troubleshooting

image

Bubba8291 commented 2 weeks ago

@mmenanno Try this command

apt install libnss3
Bubba8291 commented 2 weeks ago

That being said, I saw what you were going for with the command and figured out what it should have been was: "$UIX_CUSTOM_PLUGIN_PATH"/homebridge-sharkiq/node_modules/puppeteer/install.mjs

@srmora It looks like @mmenanno found a variation of the command when using the Homebridge config UI. Can you try this one?

srmora commented 2 weeks ago

Ok I tried that command and it seems I already am updated.

 — Stephen Mora courage.loyalty.self-discipline.simple living

On Oct 21, 2024, at 10:31 AM, Bubba8291 @.***> wrote:

@mmenanno https://github.com/mmenanno Try this command

apt install libnss3 — Reply to this email directly, view it on GitHub https://github.com/Bubba8291/homebridge-sharkiq/issues/24#issuecomment-2427321019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYI66OLV7ARH6WKORPZUZDZ4U25NAVCNFSM6AAAAABPVQ3JK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRXGMZDCMBRHE. You are receiving this because you were mentioned.

srmora commented 2 weeks ago

Yes I applied his command when he posted it.. it did take me further, but I am getting this error now.

[10/19/2024, 8:51:19 AM] [SharkIQ] Error with login. [10/19/2024, 8:51:19 AM] [SharkIQ] Error: Error: Failed to launch the browser process! undefined [22185:22185:1017/085119.166172:ERROR:zygote_host_impl_linux.cc(101)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

Looking at the "login error" I went ahead and created a Home Assistance server and tried their SharkIQ integration (which I used in the past before your Hombridge plugin was available).
Anyway, it would not allow me to login to my account.. So I updated my account password.. but still no go.

I tried your plugin again and got the error indicated above again :(.

THANKS

— Stephen Mora courage.loyalty.self-discipline.simple living

On Oct 21, 2024, at 10:33 AM, Bubba8291 @.***> wrote:

That being said, I saw what you were going for with the command and figured out what it should have been was: "$UIX_CUSTOM_PLUGIN_PATH"/homebridge-sharkiq/node_modules/puppeteer/install.mjs

@srmora https://github.com/srmora It looks like @mmenanno https://github.com/mmenanno found a variation of the command when using the Homebridge config UI. Can you try this one?

— Reply to this email directly, view it on GitHub https://github.com/Bubba8291/homebridge-sharkiq/issues/24#issuecomment-2427326537, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYI66MUUZ4ZAT4ZW2S3CZLZ4U3INAVCNFSM6AAAAABPVQ3JK6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRXGMZDMNJTG4. You are receiving this because you were mentioned.

mmenanno commented 1 week ago

@Bubba8291 couldn't find that package when I run it in the homebridge terminal:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libnss3
Bubba8291 commented 1 week ago

@mmenanno There are variations of it per system.

If you run apt search libnss, you should get the one for your system.

mmenanno commented 1 week ago

@Bubba8291 For my system I got:

Sorting... Done
Full Text Search... Done
libnss-mdns/now 0.15.1-1ubuntu1 amd64 [installed,local]
  NSS module for Multicast DNS name resolution

libnss-systemd/now 249.11-0ubuntu3.12 amd64 [installed,local]
  nss module providing dynamic user and group name resolution

Both of those are already installed though 🤔 I also ran the install command for each anyway which confirmed they are both also already at the newest version.

Bubba8291 commented 6 days ago

@srmora It looks like your environment is running homebridge as root. Puppeteer gets mad about that. If you aren't able to switch to a non-root user, try the manual ouath login.

I know there are a lot of drawbacks to the automatic login since Puppeteer is a heavy package and currently doesn't support arm64 devices. So I am working to see if there are any alternative options that would be more user friendly to the ouath login.

Bubba8291 commented 6 days ago

@mmenanno See if either of the solutions in this post can fix the issue https://stackoverflow.com/questions/66214552/tmp-chromium-error-while-loading-shared-libraries-libnss3-so-cannot-open-sha

It seems to be closely related to your environment.

mmenanno commented 5 days ago

@Bubba8291 Hmm the solutions in that post seem to be looking for a node_modules/puppeteer/.local-chromium, directory which I do not have. cd "$UIX_CUSTOM_PLUGIN_PATH"/homebridge-sharkiq/node_modules/puppeteer is about as deep as I go in that path:

root@Leviathan:/var/lib/homebridge/node_modules/homebridge-sharkiq/node_modules/puppeteer $ ls -la
total 55
drwxr-xr-x   4 root root    7 Oct 30 14:51 .
drwxr-xr-x 142 root root  142 Oct 30 14:41 ..
-rw-r--r--   1 root root 2030 Oct 30 14:41 README.md
-rwxr-xr-x   1 root root  987 Oct 30 14:41 install.mjs
drwxr-xr-x   4 root root    5 Oct 30 14:41 lib
-rw-r--r--   1 root root 3365 Oct 30 14:41 package.json
drwxr-xr-x   3 root root    7 Oct 30 14:41 src

So I'm not sure if those solutions are meant for this type of setup since I don't have a .local-chromium

I checked through the layers of those lib and src folders too and it doesn't seem to be hiding in there either.

Bubba8291 commented 5 days ago

@mmenanno Can you try to run the commands they provide?

The first one suggests: sudo apt-get install ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils

The second one suggests using the Docker file to add the apt-get commands, but I'm not sure how that will work in your setup.

If there are any errors saying the package is not found, just remove the ones in the command that say not found.

mmenanno commented 5 days ago

@Bubba8291 After removing the ones that weren't found this is what I ended up with:

root@Leviathan:/var/lib/homebridge $ apt-get install ca-certificates libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libglib2.0-0 libgtk-3-0 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxtst6 wget
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libgcc-s1' instead of 'libgcc1'
ca-certificates is already the newest version (20240203~22.04.1).
libatk-bridge2.0-0 is already the newest version (2.38.0-3).
libatk-bridge2.0-0 set to manually installed.
libatk1.0-0 is already the newest version (2.36.0-3build1).
libatk1.0-0 set to manually installed.
libc6 is already the newest version (2.35-0ubuntu3.8).
libcairo2 is already the newest version (1.16.0-5ubuntu2).
libcairo2 set to manually installed.
libcups2 is already the newest version (2.4.1op1-1ubuntu4.11).
libcups2 set to manually installed.
libdbus-1-3 is already the newest version (1.12.20-2ubuntu4.1).
libdbus-1-3 set to manually installed.
libexpat1 is already the newest version (2.4.7-1ubuntu0.4).
libexpat1 set to manually installed.
libfontconfig1 is already the newest version (2.13.1-4.2ubuntu5).
libfontconfig1 set to manually installed.
libgcc-s1 is already the newest version (12.3.0-1ubuntu1~22.04).
libglib2.0-0 is already the newest version (2.72.4-0ubuntu2.3).
libglib2.0-0 set to manually installed.
libgtk-3-0 is already the newest version (3.24.33-1ubuntu2.2).
libgtk-3-0 set to manually installed.
libpango-1.0-0 is already the newest version (1.50.6+ds-2ubuntu1).
libpango-1.0-0 set to manually installed.
libpangocairo-1.0-0 is already the newest version (1.50.6+ds-2ubuntu1).
libpangocairo-1.0-0 set to manually installed.
libstdc++6 is already the newest version (12.3.0-1ubuntu1~22.04).
libx11-6 is already the newest version (2:1.7.5-1ubuntu0.3).
libx11-6 set to manually installed.
libxcb1 is already the newest version (1.14-3ubuntu3).
libxcb1 set to manually installed.
libxcomposite1 is already the newest version (1:0.4.5-1build2).
libxcomposite1 set to manually installed.
libxcursor1 is already the newest version (1:1.2.0-2build4).
libxcursor1 set to manually installed.
libxdamage1 is already the newest version (1:1.1.5-2build2).
libxdamage1 set to manually installed.
libxext6 is already the newest version (2:1.3.4-1build1).
libxext6 set to manually installed.
libxfixes3 is already the newest version (1:6.0.0-1).
libxfixes3 set to manually installed.
libxi6 is already the newest version (2:1.8-1build1).
libxi6 set to manually installed.
libxrandr2 is already the newest version (2:1.5.2-1build1).
libxrandr2 set to manually installed.
libxrender1 is already the newest version (1:0.9.10-1build4).
libxrender1 set to manually installed.
libxtst6 is already the newest version (2:1.2.3-1build4).
libxtst6 set to manually installed.
wget is already the newest version (1.21.2-2ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Looks like all the valid ones were already installed, so it didn't change anything.

The second suggestion I don't think works since it wants it in the docker make script, when I'm not custom building the image, I'm just pulling it from dockerhub through unraid.

THAT BEING SAID. I figured it out. You were close when you suggested:

apt install libnss3

What was missing was that BEFORE running that, need to run this to update the index:

apt update -y

Found that from https://stackoverflow.com/a/71055499

I'm not sure if there is anything that could be changed with the plugin or with homebridge to automate this in the future.