jamesread / prometheus-gmail-exporter

Checks gmail labels for unread messages and exposes the counts via prometheus.
Apache License 2.0
47 stars 9 forks source link

python-online-auth: Fails to start #12

Closed vorburger closed 1 year ago

vorburger commented 1 year ago

In the context of https://github.com/jamesread/prometheus-gmail-exporter/issues/10, I had a brief try at the python-online-auth branch, using my branch here, but (for me) it appears to fail to start, due to:

INFO:root:prometheus-gmail-exporter starting on port 8080
/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/.venv/lib/python3.10/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /home/vorburger/.prometheus-gmail-exporter/login_cookie.dat: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/./gmail-exporter.py", line 313, in <module>
    main()
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/./gmail-exporter.py", line 284, in main
    GMAIL_CLIENT = get_gmail_client()
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/./gmail-exporter.py", line 238, in get_gmail_client
    credentials = get_credentials()
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/./gmail-exporter.py", line 63, in get_credentials
    flow = client.flow_from_clientsecrets(args.clientSecretFile, scopes)
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/.venv/lib/python3.10/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/.venv/lib/python3.10/site-packages/oauth2client/client.py", line 2134, in flow_from_clientsecrets
    client_type, client_info = clientsecrets.loadfile(filename,
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/.venv/lib/python3.10/site-packages/oauth2client/clientsecrets.py", line 165, in loadfile
INFO:waitress:Serving on http://0.0.0.0:8080
    return _loadfile(filename)
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/.venv/lib/python3.10/site-packages/oauth2client/clientsecrets.py", line 126, in _loadfile
    return _validate_clientsecrets(obj)
  File "/home/vorburger/git/github.com/jamesread/prometheus-gmail-exporter/.venv/lib/python3.10/site-packages/oauth2client/clientsecrets.py", line 99, in _validate_clientsecrets
    raise InvalidClientSecretsError(
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "redirect_uris" in a client type of "web".
vorburger commented 1 year ago

Perhaps this is "just" because I don't (yet) have a ~/.prometheus-gmail-exporter/login_cookie.dat? But I don't know how to get one... 🤣

See also #10.