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

Failing to run on 3rd step #12

Closed Dwall4954 closed 3 years ago

Dwall4954 commented 3 years ago

on the third step when i go to run i get this error. Any ideas?

./docker_run.bash -c /home/pi/inventory-hunter/config/newegg_rtx_3080.yaml -e dan4954@gmail.com -r 192.168.86.1 the inventory-hunter docker image does not exist... please build the image and try again build command: docker build -t inventory-hunter .

Wood578Guy commented 3 years ago

Couple thoughts...

For instance, here's what mine shows:

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
inventory-hunter    latest              621b73c32053        10 seconds ago      1.65GB
Dwall4954 commented 3 years ago

Hmm i was in that folder while trying to launch. Here is the result of the docker image list command.

Linux pi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l

root@pi:/home/pi/inventory-hunter# docker image list REPOSITORY TAG IMAGE ID CREATED SIZE 9d50c207c058 6 hours ago 1.34GB python 3.9 1e73204649e2 11 days ago 694MB root@pi:/home/pi/inventory-hunter#

Dwall4954 commented 3 years ago

Got it to work. On the last command of step 1 i was leaving the period off the end. docker build -t inventory-hunter .

Got it running now. Can you run multiple instances for multiple config files?

Wood578Guy commented 3 years ago

Yes, you can. That's exactly how I use it. Simply change the config file referenced by -c argument in subsequent commands. It will create multiple docker containers -- you can view running ones with docker ps

Dwall4954 commented 3 years ago

Awesome! It seems to be working good at first with log readouts like this....

I2020-11-29 17:49:54,102 gigabyte-geforce-rtx-3080-gv-n3080gaming-oc-10gd: not in stock I2020-11-29` 17:50:01,794 gigabyte-geforce-rtx-3080-gv-n3080vision-oc-10gd: not in stock I2020-11-29 17:50:08,639 msi-geforce-rtx-3080-rtx-3080-gaming-x-trio-10g: not in stock

then after about a minute they turn to this....

E2020-11-29 17:50:19,659 evga-geforce-rtx-3080-10g-p5-3881-kr: scrape failed E2020-11-29 17:50:21,658 evga-geforce-rtx-3080-10g-p5-3883-kr: caught exception during request: Message: invalid session id

E2020-11-29 17:50:21,659 evga-geforce-rtx-3080-10g-p5-3883-kr: scrape failed E2020-11-29 17:50:23,658 evga-geforce-rtx-3080-10g-p5-3885-kr: caught exception during request: Message: invalid session id

E2020-11-29 17:50:23,659 evga-geforce-rtx-3080-10g-p5-3885-kr: scrape failed E2020-11-29 17:50:25,657 evga-geforce-rtx-3080-10g-p5-3895-kr: caught exception during request: Message: invalid session id

Wood578Guy commented 3 years ago

My guess is you need to pull down the code again and rebuild the image, I had a similar issue before he reverted back to a different method of scraping.

You can stop your existing images with docker stop <name>.

Pull the code down again with git pull.

Then rebuild and try again.

Dwall4954 commented 3 years ago

I am trying git pull https://github.com/EricJMarti/inventory-hunter.git

but getting this in return

fatal: not a git repository (or any of the parent directories): .git

Any ideas?

Wood578Guy commented 3 years ago

Just git pull

Don't put the URL after it.

Dwall4954 commented 3 years ago

Thank you for all the help. Appreciate it! I got the git pull to work. Whats the command to rebuild? Pretty new to linux stuff

Wood578Guy commented 3 years ago

No worries! Everyone is new at some point.

Run the steps from the README.md file.

docker build -t inventory-hunter .

What git pull did was pull down the latest updated code from the remote respository (Github). The build command then builds a docker image using the latest code you just grabbed.

Then after this, run the code again with your command that started with ./docker_run.bash

Dwall4954 commented 3 years ago

Finally got it running for about 5 mins now and no errors! Thanks again for all the help. I picked a terrible time to start my first build lol. Hopefully this helps find me a 3080 and 5950x.

Dwall4954 commented 3 years ago

Well it runs fine and works but the email trigger is failing. I put a test link in there and this is the result...

I2020-11-29 22:39:03,787 msi-geforce-rtx-2080-ti-rtx-2080-ti-gaming-x-trio: now in stock at 1553.99! E2020-11-29 22:39:03,893 caught exception Traceback (most recent call last): File "/src/run.py", line 32, in main hunt(args, config, driver) File "/src/hunter.py", line 121, in hunt engine.run() File "/src/hunter.py", line 43, in run self.scheduler.run(blocking=True) File "/usr/local/lib/python3.9/sched.py", line 151, in run action(*argument, **kwargs) File "/src/hunter.py", line 58, in tick self.process_scrape_result(s, result) File "/src/hunter.py", line 95, in process_scrape_result self.send_alert(s, result, f'now in stock at {current_price}!') File "/src/hunter.py", line 116, in send_alert self.alerter(result.alert_subject, result.alert_content) File "/src/hunter.py", line 27, in call with smtplib.SMTP(self.relay) as s: File "/usr/local/lib/python3.9/smtplib.py", line 253, in init (code, msg) = self.connect(host, port) File "/usr/local/lib/python3.9/smtplib.py", line 339, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/local/lib/python3.9/smtplib.py", line 310, in _get_socket return socket.create_connection((host, port), timeout, File "/usr/local/lib/python3.9/socket.py", line 843, in create_connection raise err File "/usr/local/lib/python3.9/socket.py", line 831, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused root@pi:/home/pi/inventory-hunter#

Wood578Guy commented 3 years ago

Did you test your email first before running the command according to the SMTP Tutorial posted in the README file?

If you have the SMTP relay on the same machine as the docker, use 127.0.0.1 as your SMTP relay IP address, instead of your local LAN IP.

Something like: ./docker_run.bash -c /home/pi/inventory-hunter/config/newegg_rtx_3080.yaml -e dan4954@gmail.com -r 127.0.0.1

Dwall4954 commented 3 years ago

Ah you got it i had the ip address of the router plugged in instead of 127.0.0.1. Changing that fixed it and test email came through. Thank you!!!