gbrodman / order-tracking

Automated Amazon and Best Buy order tracking for buying groups
GNU Affero General Public License v3.0
33 stars 13 forks source link

Configuration Issue #173

Closed jomizrahi92 closed 3 years ago

jomizrahi92 commented 3 years ago

Hey guys, I stumbled upon this and I am a member of many buying groups for years. Would love to try this out, i've configured everything as stated but i'm stuck, i've tried multiple times but can't seem to figure out whats wrong with my setup, posting my error below hoping you can help me figure it out. My thought is it's around the OAuth portion since it does not look like my email is being hit.

➜  order-tracking git:(master) python main.py
Buying Group Reconciliation Tool
Choose an option, or 0 to exit: 
1: Get tracking numbers and upload to BG portals and Google Sheets
2: Reconcile shipments with results from BG portals
3: Manually import or delete tracking numbers and order details
4: Import an Amazon Business spreadsheet from a Google Sheet
5: Generate an Amazon cart URL

Enter your choice [1-5] or 0 to exit: 1
Retrieving Amazon tracking numbers from email ...
Searching for emails since 28-Oct-2020
Traceback (most recent call last):
  File "/Users/jmizrahi/Buying/order-tracking/get_tracking_numbers.py", line 43, in main
    trackings = amazon_tracking_retriever.get_trackings()
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_tracking_retriever.py", line 57, in get_trackings
    self.all_email_ids = self.get_email_ids()
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_tracking_retriever.py", line 233, in get_email_ids
    mail = self.get_all_mail_folder()
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_tracking_retriever.py", line 227, in get_all_mail_folder
    mail = email_auth.email_authentication()
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_auth.py", line 30, in email_authentication
    creds = get_oauth_credentials()
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_auth.py", line 58, in get_oauth_credentials
    flow = client.flow_from_clientsecrets('client_secret.json', GMAIL_URL)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/client.py", line 2135, in flow_from_clientsecrets
    cache=cache)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
    return _loadfile(filename)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 126, in _loadfile
    return _validate_clientsecrets(obj)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 101, in _validate_clientsecrets
    prop_name, client_type))
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "redirect_uris" in a client type of "web".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 47, in <module>
    main()
  File "main.py", line 35, in main
    get_tracking_numbers.main()
  File "/Users/jmizrahi/Buying/order-tracking/get_tracking_numbers.py", line 45, in main
    send_error_email(email_sender, "Error retrieving Amazon emails")
  File "/Users/jmizrahi/Buying/order-tracking/get_tracking_numbers.py", line 25, in send_error_email
    email_sender.send_email_content(subject, util.get_traceback_lines())
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_sender.py", line 43, in send_email_content
    email_auth.send_email(recipients, message)
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_auth.py", line 45, in send_email
    creds = get_oauth_credentials()
  File "/Users/jmizrahi/Buying/order-tracking/lib/email_auth.py", line 58, in get_oauth_credentials
    flow = client.flow_from_clientsecrets('client_secret.json', GMAIL_URL)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/client.py", line 2135, in flow_from_clientsecrets
    cache=cache)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
    return _loadfile(filename)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 126, in _loadfile
    return _validate_clientsecrets(obj)
  File "/Users/jmizrahi/.pyenv/versions/3.7.4/lib/python3.7/site-packages/oauth2client/clientsecrets.py", line 101, in _validate_clientsecrets
    prop_name, client_type))
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "redirect_uris" in a client type of "web".
jomizrahi92 commented 3 years ago

Will continue exploring but looks like this was my issue, needed to add a redirect URI image