Giter VIP home page Giter VIP logo

southwest-docker's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

southwest-docker's Issues

mkdir permission error for log directory

Somehow a directory lacks permissions to allow autoluv to create the log and subsequent subdirectories.

My docker container is exiting and the logs are showing the following. Granted, this is when I give it one of my old record locator. However, I think it is even dying early on a valid PNR code and not checking in the person. But I can't find a log for that error happening. So, I'm hoping if we fix this issue, it'll fix another related issue.

I found this because I was trying to test the SMTP email function. The autoluv docs say to give it a false record locator and fake name.

To verify your SMTP settings, schedule a check-in with invalid information and a valid email address.

    autoluv schedule AAAAAA Fake Name [email protected]

So, I fired up the container and launched a bash shell into it.

To me, it looks like it can't create the log directory. That would give me an error unless I ran this first:
sudo chmod a+w //var/lib/gems/2.7.0/gems/autoluv-0.3.1/

For example:

swuser@08dac4f6ce00:/checkin/southwest-checkin$     autoluv schedule AAAAAA Fake Name [email protected]
Traceback (most recent call last):
        13: from /usr/local/bin/autoluv:23:in `<main>'
        12: from /usr/local/bin/autoluv:23:in `load'
        11: from /var/lib/gems/2.7.0/gems/autoluv-0.3.1/bin/autoluv:19:in `<top (required)>'
        10: from /var/lib/gems/2.7.0/gems/autoluv-0.3.1/lib/autoluv/southwestclient.rb:22:in `schedule'
         9: from /var/lib/gems/2.7.0/gems/autoluv-0.3.1/lib/autoluv/southwestclient.rb:91:in `departing_flights'
         8: from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient.rb:66:in `get'
         7: from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:63:in `execute'
         6: from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:163:in `execute'
         5: from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:727:in `transmit'
         4: from /usr/lib/ruby/2.7.0/net/http.rb:933:in `start'
         3: from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:743:in `block in transmit'
         2: from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:836:in `process_result'
         1: from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:129:in `return!'
/var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:249:in `exception_with_response': 400 Bad Request (RestClient::BadRequest)
        12: from /usr/local/bin/autoluv:23:in `<main>'
        11: from /usr/local/bin/autoluv:23:in `load'
        10: from /var/lib/gems/2.7.0/gems/autoluv-0.3.1/bin/autoluv:12:in `<top (required)>'
         9: from /var/lib/gems/2.7.0/gems/autoluv-0.3.1/bin/autoluv:26:in `rescue in <top (required)>'
         8: from /var/lib/gems/2.7.0/gems/autoluv-0.3.1/lib/autoluv.rb:46:in `notify_user'
         7: from /var/lib/gems/2.7.0/gems/autoluv-0.3.1/lib/autoluv.rb:29:in `log'
         6: from /usr/lib/ruby/2.7.0/fileutils.rb:211:in `mkdir_p'
         5: from /usr/lib/ruby/2.7.0/fileutils.rb:211:in `each'
         4: from /usr/lib/ruby/2.7.0/fileutils.rb:226:in `block in mkdir_p'
         3: from /usr/lib/ruby/2.7.0/fileutils.rb:226:in `reverse_each'
         2: from /usr/lib/ruby/2.7.0/fileutils.rb:228:in `block (2 levels) in mkdir_p'
         1: from /usr/lib/ruby/2.7.0/fileutils.rb:250:in `fu_mkdir'
/usr/lib/ruby/2.7.0/fileutils.rb:250:in `mkdir': Permission denied @ dir_s_mkdir - /var/lib/gems/2.7.0/gems/autoluv-0.3.1/logs (Errno::EACCES)
swuser@08dac4f6ce00:/checkin/southwest-checkin$ ls -latr /var/lib/gems/2.7.0/gems/autoluv-0.3.1/
total 28
drwxr-xr-x 1 root root   34 Apr 23  2023 lib
drwxr-xr-x 1 root root   46 Apr 23  2023 data
drwxr-xr-x 1 root root   38 Apr 23  2023 bin
-rw-r--r-- 1 root root 1313 Apr 23  2023 autoluv.gemspec
-rw-r--r-- 1 root root   51 Apr 23  2023 Rakefile
-rw-r--r-- 1 root root 4493 Apr 23  2023 README.md
-rw-r--r-- 1 root root 1076 Apr 23  2023 LICENSE.txt
-rw-r--r-- 1 root root   62 Apr 23  2023 Gemfile
-rw-r--r-- 1 root root   44 Apr 23  2023 .gitignore
drwxr-xr-x 1 root root  584 Apr 23  2023 ..
drwxr-xr-x 1 root root  140 Apr 23  2023 .
swuser@08dac4f6ce00:/checkin/southwest-checkin$ sudo chmod a+w /var/lib/gems/2.7.0/gems/autoluv-0.3.1/
swuser@08dac4f6ce00:/checkin/southwest-checkin$ ls -latr /var/lib/gems/2.7.0/gems/autoluv-0.3.1/
total 28
drwxr-xr-x 1 root root   34 Apr 23  2023 lib
drwxr-xr-x 1 root root   46 Apr 23  2023 data
drwxr-xr-x 1 root root   38 Apr 23  2023 bin
-rw-r--r-- 1 root root 1313 Apr 23  2023 autoluv.gemspec
-rw-r--r-- 1 root root   51 Apr 23  2023 Rakefile
-rw-r--r-- 1 root root 4493 Apr 23  2023 README.md
-rw-r--r-- 1 root root 1076 Apr 23  2023 LICENSE.txt
-rw-r--r-- 1 root root   62 Apr 23  2023 Gemfile
-rw-r--r-- 1 root root   44 Apr 23  2023 .gitignore
drwxr-xr-x 1 root root  584 Apr 23  2023 ..
drwxrwxrwx 1 root root  140 Apr 23  2023 .
swuser@08dac4f6ce00:/checkin/southwest-checkin$ autoluv schedule AAAAAA Fake Name [email protected] 
swuser@08dac4f6ce00:/checkin/southwest-checkin$

Then the email works (since I have a fixed ~swuser/.autoluv.env file with updated SMTP settings.
Which, as a side note, I'm providing that file via the volume mount on the CLI:
docker run -itd -v /path/on/local/filesystem/to/.autoluv.env:/home/swuser/.autoluv.env altodd/southwest-docker schedule PNRCODE FIRST LAST [email protected]

403 Forbidden

I just ran today and am getting the following. Let me know if there is a workaround

docker pull altodd/southwest-docker

docker run altodd/southwest-docker schedule Confirmation First Last

Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.
/var/lib/gems/2.7.0/gems/autoluv-0.3.2/lib/autoluv.rb:33:in `log': undefined method `+' for nil:NilClass (NoMethodError)
        from /var/lib/gems/2.7.0/gems/autoluv-0.3.2/lib/autoluv.rb:46:in `notify_user'
        from /var/lib/gems/2.7.0/gems/autoluv-0.3.2/bin/autoluv:26:in `rescue in <top (required)>'
        from /var/lib/gems/2.7.0/gems/autoluv-0.3.2/bin/autoluv:12:in `<top (required)>'
        from /usr/local/bin/autoluv:23:in `load'
        from /usr/local/bin/autoluv:23:in `<main>'
/var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:249:in `exception_with_response': 403 Forbidden (RestClient::Forbidden)
        from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:129:in `return!'
        from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:836:in `process_result'
        from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:743:in `block in transmit'
        from /usr/lib/ruby/2.7.0/net/http.rb:933:in `start'
        from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:727:in `transmit'
        from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:163:in `execute'
        from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient/request.rb:63:in `execute'
        from /var/lib/gems/2.7.0/gems/rest-client-2.1.0/lib/restclient.rb:66:in `get'
        from /var/lib/gems/2.7.0/gems/autoluv-0.3.2/lib/autoluv/southwestclient.rb:91:in `departing_flights'
        from /var/lib/gems/2.7.0/gems/autoluv-0.3.2/lib/autoluv/southwestclient.rb:22:in `schedule'
        from /var/lib/gems/2.7.0/gems/autoluv-0.3.2/bin/autoluv:19:in `<top (required)>'
        from /usr/local/bin/autoluv:23:in `load'
        from /usr/local/bin/autoluv:23:in `<main>'

Can't send email - 535 Authentication credentials invalid

When using the email option, the following is output:

dazayas@xxxxxx:~$ docker run -it altodd/southwest-docker checkin xxxxxx yyyyyy zzzzzz [email protected]
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.
535 Authentication credentials invalid

If no email is input, the script seems to work correctly (e.g. points out that it's more than 24 hours until the flight). I did log into the container and verify the .autoluv.env file is present and seems correctly formatted.

where does the email go? and autoluv log file

When we schedule a job, we give it an email address.

When the at job fires off, I see /var/log/exim4/mainlog shows a mail was sent.. but where does it go? I never receive it at the address I scheduled with.

root@aa599a5e9601:/var/log/exim4# cat mainlog
2022-09-07 14:35:20 1oVw9A-00008C-G3 <= root@bfdb1f6222b3 U=root P=local S=390
2022-09-07 14:35:20 1oVw9A-00008C-G3 => /var/mail/mail root@bfdb1f6222b3 R=mail4root T=address_file
2022-09-07 14:35:20 1oVw9A-00008C-G3 Completed

On a similar note, is there some local log file that I can review to see how successful or unsuccessful the autoluv process was at checking in?

DevToolsActivePort file doesn't exist

Hello,

Thanks for your work on this. I was considering making this docker myself but came across yours and it was exactly what I was planning to make.

I'm running into an issue when I try to run it though. It's related to the ChromeDriver.

I ran the command:

docker run --platform linux/amd64 -itd altodd/southwest-docker schedule ABCXYZ John Doe

And got the output:


Starting periodic command scheduler: cron.

Traceback (most recent call last):

  File "/headers/southwest-headers/southwest-headers.py", line 37, in <module>

    driver = webdriver.Chrome(os.getcwd() + "/chromedriver", options=chrome_options, seleniumwire_options=seleniumwire_options)

  File "/headers/southwest-headers/env/lib/python3.9/site-packages/seleniumwire/webdriver.py", line 195, in __init__

    super().__init__(*args, **kwargs)

  File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__

    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",

  File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 93, in __init__

    RemoteWebDriver.__init__(

  File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 268, in __init__

    self.start_session(capabilities, browser_profile)

  File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 359, in start_session

    response = self.execute(Command.NEW_SESSION, parameters)

  File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute

    self.error_handler.check_response(response)

  File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response

    raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.

  (unknown error: DevToolsActivePort file doesn't exist)

  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Specifically, it seems to be caused by unknown error: DevToolsActivePort file doesn't exist which is related to running Chrome as root. It appears southwest-headers factors this in.

Did you run into this issue? Any ideas? Thanks!

Wrong date timestamp for checkin output

Hi - my flight is departing IND at 5am on 2022-04-01

The output says it will start the cron job to checkin at 'Thu Mar 31 10:00:00 2022'

Shouldn't this be 'Thu Mar 31 5:00:00 2022' given that my flight leaves the next day at 5am?

image

This version of ChromeDriver only supports Chrome version 110

I just tried pulling the latest image and running it interactively to see the stdout and it shows this:

$ docker run -it altodd/southwest-docker schedule xxxxxx xxxx xxxxxx [email protected]
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.
Traceback (most recent call last):
File "/headers/southwest-headers/southwest-headers.py", line 22, in
driver = uc.Chrome(headless = True)
File "/headers/southwest-headers/env/lib/python3.9/site-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in init
super().init(*args, **kwargs)
File "/headers/southwest-headers/env/lib/python3.9/site-packages/undetected_chromedriver/init.py", line 429, in init
super(Chrome, self).init(
File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init
super().init(
File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py", line 106, in init
super().init(
File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 288, in init
self.start_session(capabilities, browser_profile)
File "/headers/southwest-headers/env/lib/python3.9/site-packages/undetected_chromedriver/init.py", line 715, in start_session
super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 381, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 444, in execute
self.error_handler.check_response(response)
File "/headers/southwest-headers/env/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 249, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:35490
from session not created: This version of ChromeDriver only supports Chrome version 110
Current browser version is 108.0.5359.124

Stacktrace:
#0 0x55b7dcda7d93
#1 0x55b7dcb762d7
#2 0x55b7dcba32f4
#3 0x55b7dcb9a2fc
#4 0x55b7dcbdf4f4
#5 0x55b7dcbd6353
#6 0x55b7dcba5e40
#7 0x55b7dcba7038
#8 0x55b7dcdfb8be
#9 0x55b7dcdff8f0
#10 0x55b7dcddff90
#11 0x55b7dce00b7d
#12 0x55b7dcdd1578
#13 0x55b7dce25348
#14 0x55b7dce254d6
#15 0x55b7dce3f341
#16 0x7f7bd78f5ea7 start_thread

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.