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

Failing to run on 3rd step #12

Closed
Dwall4954 opened this issue Nov 29, 2020 · 14 comments
Closed

Failing to run on 3rd step #12

Dwall4954 opened this issue Nov 29, 2020 · 14 comments

Comments

@Dwall4954
Copy link

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
Copy link

Couple thoughts...

  • Make sure you are running the command from the directory /home/pi/inventory-hunter. You can see where you're at with pwd.
  • Run docker image list - is the image name listed as inventory-hunter?

For instance, here's what mine shows:

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

@Dwall4954
Copy link
Author

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
Copy link
Author

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
Copy link

Wood578Guy commented Nov 29, 2020

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
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link

Just git pull

Don't put the URL after it.

@Dwall4954
Copy link
Author

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
Copy link

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
Copy link
Author

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 Dwall4954 reopened this Nov 29, 2020
@Dwall4954
Copy link
Author

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
Copy link

Wood578Guy commented Nov 29, 2020

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
Copy link
Author

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!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants