Hari-Nagarajan / fairgame

Tool to help us buy hard to find items.
GNU General Public License v3.0
2.44k stars 804 forks source link

Chromium Error on RPI #631

Open iannuz92 opened 3 years ago

iannuz92 commented 3 years ago

Describe the bug When I start the script (pipenv run python app.py amazon --delay 3), after entering the password, I get an error:

`ERROR|Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

2021-03-31 23:32:09|0.6.2|ERROR|If you have a JSON warning above, try cleaning your profile (e.g. --clean-profile) 2021-03-31 23:32:09|0.6.2|ERROR|If that's not it, you probably have a previous Chrome window open. You should close it.`

Desktop (please complete the following information):

iannuz92 commented 3 years ago

It's work only in headless mode, but, in headless, at random I get "exception" error

DakkJaniels commented 3 years ago

Did you follow the raspberry pi directions in the readme?

iannuz92 commented 3 years ago

yes, now i started again with a clean install, add updates

timbru31 commented 3 years ago

Try reverting the change in /home/$USER/.local/share/virtualenvs/fairgame-<RANDOMCHARS>/lib/python3.8/site-packages/selenium/webdriver/common/service.py - I found that only the cp is required. Fresh install on a RPi 3

Edit: This works in both headless and non-headless mode for me.

avelis26 commented 3 years ago

Try reverting the change in /home/$USER/.local/share/virtualenvs/fairgame-<RANDOMCHARS>/lib/python3.8/site-packages/selenium/webdriver/common/service.py - I found that only the cp is required. Fresh install on a RPi 3

Edit: This works in both headless and non-headless mode for me.

Hey Tim... I've been trying since yesterday to get this working on an RPi 3 ... and nothing I do works to get chrome running ... and I'm trying to run headless over ssh... any tips? Bellow you'll find my ops log and error:

cd ~
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential tk-dev libreadline-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev libxslt1-dev rustc libjpeg-dev zlib1g-dev libfreetype6-dev libopenjp2-7 libtiff5 libncurses5-dev libncursesw5-dev chromium-chromedriver
# liblcms1-dev fails to install so I installed liblcms2-dev
version=3.8.8
wget https://www.python.org/ftp/python/$version/Python-$version.tgz
tar zxf Python-$version.tgz
cd Python-$version
./configure --enable-optimizations
make -j4
sudo make altinstall
cd ..
sudo python3.8 -m pip install --upgrade pip
mkdir sources
cd ./sources
git clone git@github.com:avelis26/fairgame.git
cd fairgame/
git switch dev
# I forked fairgame to my repo, and then made a dev branch off master for reasons
pip3 install pipenv
export PATH=$PATH:/home/$USER/.local/bin
pipenv shell 
pipenv install
cp /usr/bin/chromedriver /home/$USER/.local/share/virtualenvs/fairgame-9C-Yzi6E/lib/python3.8/site-packages/chromedriver_py/chromedriver_linux64

pipenv run python app.py amazon --headless --test
2021-04-01 23:13:37|0.6.2|INFO|FairGame v0.6.2
2021-04-01 23:13:37|0.6.2|INFO|Initializing Global configuration...
2021-04-01 23:13:37|0.6.2|INFO|No Apprise config found at config/apprise.conf.
2021-04-01 23:13:37|0.6.2|INFO|For notifications, see config/apprise.conf_template
2021-04-01 23:13:37|0.6.2|INFO|Initializing Amazon configuration...
2021-04-01 23:13:37|0.6.2|INFO|Reading credentials from: config/amazon_credentials.json
Credential file password: *************
2021-04-01 23:13:48|0.6.2|ERROR|Message: unknown error: Chrome failed to start: crashed.
  (chrome not reachable)
  (The process started from chrome location /snap/chromium/1527/usr/lib/chromium-browser/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

2021-04-01 23:13:48|0.6.2|ERROR|If you have a JSON warning above, try cleaning your profile (e.g. --clean-profile)
2021-04-01 23:13:48|0.6.2|ERROR|If that's not it, you probably have a previous Chrome window open. You should close it.
avelis26 commented 3 years ago

Oh and this is the OS I'm using: ubuntu-20.04.2-preinstalled-server-arm64+raspi.img

Next I'm going to try Rasbian

timbru31 commented 3 years ago

Can you test if your chromium is working correctly? Something like chromium-browser --headless --no-sandbox --disable-gpu --screenshot https://github.com"

MovieMaker93 commented 3 years ago

Same errore for me i tried the command suggested by @timbru31 and the terminal shows fairgame$ chromium-browser --headless --no-sandbox --disable-gpu --screenshot https://github.com /usr/bin/chromium-browser: 12: xdg-settings: not found [0403/203016.802441:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir. Trace/breakpoint trap (core dumped) [0100/000000.580595:ERROR:zygote_linux.cc(608)] Zygote could not fork: process_type renderer numfds 4 child_pid -1 [0100/000000.581707:ERROR:zygote_linux.cc(640)] write: Broken pipe (32) Any news?

jpataj commented 3 years ago

Try reverting the change in /home/$USER/.local/share/virtualenvs/fairgame-<RANDOMCHARS>/lib/python3.8/site-packages/selenium/webdriver/common/service.py - I found that only the cp is required. Fresh install on a RPi 3

Edit: This works in both headless and non-headless mode for me.

I had the same issue as reported by @iannuz92 and reverting change above solved it. The bot runs now fine on my RPI4.