EricJMarti / inventory-hunter

⚡️ Get notified as soon as your next CPU, GPU, or game console is in stock
MIT License
1.12k stars 263 forks source link

Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) #120

Open sclawrenc opened 3 years ago

sclawrenc commented 3 years ago

Thanks for sharing Inventory Hunter.

I am experiencing some issues getting data from BestBuy and Amazon to pull correctly on Pi 4 running the standard PI OS with desktop , but Newegg seems to work fine. The logs are attached from all 3 sites. Strangely, the BestBuy scraper seems to work fine when running in Windows 10. The Amazon scraper runs in Windows 10, but very slowly displaying an error "W2020-12-19 21:32:09,244 [root] unable to save screenshot of webpage: Message: timeout: Timed out receiving message from renderer: 10.000 (Session info: chrome=83.0.4103.116)"

I have attached some logs below.

inventory hunter logs.zip

bluecow82 commented 3 years ago

Having the same issue on my Pi 4.

njhernanz commented 3 years ago

Exact same problem on my pi 4.

jjdmeier commented 3 years ago

Having same issue on Ubuntu 18.04

bluecow82 commented 3 years ago

I believe I found a workaround on this error by turning off Boot to Desktop via sudo raspi-config (Option 1, then Option S5). Upon reboot, and restart of the processes, I don't get the Chrome error anymore. Of course, this is only useful if you don't plan on using the desktop.

sclawrenc commented 3 years ago

I believe I found a workaround on this error by turning off Boot to Desktop via sudo raspi-config (Option 1, then Option S5). Upon reboot, and restart of the processes, I don't get the Chrome error anymore. Of course, this is only useful if you don't plan on using the desktop.

Thanks for your help. :)

On a similar topic, will the Inventory Hunter docker run with the Lite Pi OS? I could just run that one with less resources anyway, but I wasn't sure initially so I just installed the full Pi OS with desktop.

maioric commented 3 years ago

Eric, thank you for sharing this tool.

In my case (Ubuntu 16.04 PC) I fixed it by adding a new Chrome option in src/driver.py. This option should start Chrome without a graphical interface. Here is the patch:

diff --git a/src/driver.py b/src/driver.py
index 2f33da4..dd29718 100644
--- a/src/driver.py
+++ b/src/driver.py
@@ -66,6 +66,7 @@ class SeleniumDriver(Driver):
         self.options.page_load_strategy = 'eager'
         if getpass.getuser() == 'root':
             self.options.add_argument('--no-sandbox')  # required if root
+        self.options.add_argument('--headless')
         self.options.add_argument('--disable-blink-features=AutomationControlled')
         self.options.add_argument('--disable-dev-shm-usage')
         self.options.add_argument(f'--user-agent="{user_agent}"')

After that, if you want to use Docker, rebuild the image and pass it to to the docker_run.bash script (-i option). Hope it helps.

bxcimu commented 3 years ago

I've experienced the Chrome issue and 100% disk usage issue until I switched to ubuntu server 20.04; before I was using desktop 20.04. Seems like it's related to GUI somehow.