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

KeyError: '_module' when start run docker image #29

Closed Kiara0107 closed 1 year ago

Kiara0107 commented 1 year ago

Run the docker image failed with the following logging:

Traceback (most recent call last): File "/usr/local/sbin/gmail-exporter", line 266, in main() File "/usr/local/sbin/gmail-exporter", line 236, in main GMAIL_CLIENT = get_gmail_client() File "/usr/local/sbin/gmail-exporter", line 223, in get_gmail_client credentials = get_credentials() File "/usr/local/sbin/gmail-exporter", line 46, in get_credentials credentials = store.get() File "/usr/lib/python3.10/site-packages/oauth2client/client.py", line 407, in get return self.locked_get() File "/usr/lib/python3.10/site-packages/oauth2client/file.py", line 54, in locked_get credentials = client.Credentials.new_from_json(content) File "/usr/lib/python3.10/site-packages/oauth2client/client.py", line 302, in new_from_json module_name = data['_module'] KeyError: '_module'

Wat can be the issue here?

run command:

docker run -d \
-v /etc/gmail/:/root/.prometheus-gmail-exporter/ \
--name gmail-exporter jamesread/prometheus-gmail-exporter:latest

where /etc/gmail/ contains the client_secret.json and login_cookie.dat.

jamesread commented 1 year ago

@Kiara0107 , sorry that you hit this issue and I didn't reply for a while. Can you test now with the current version? It should be fixed.

Kiara0107 commented 1 year ago

Unfortunately not. I removed the docker images from the ubuntu server and started all over. With running the same docker-run as before I get the same result:

Traceback (most recent call last):
  File "/usr/local/sbin/gmail-exporter", line 266, in <module>
    main()
  File "/usr/local/sbin/gmail-exporter", line 236, in main
    GMAIL_CLIENT = get_gmail_client()
  File "/usr/local/sbin/gmail-exporter", line 223, in get_gmail_client
    credentials = get_credentials()
  File "/usr/local/sbin/gmail-exporter", line 46, in get_credentials
    credentials = store.get()
  File "/usr/lib/python3.10/site-packages/oauth2client/client.py", line 407, in get
    return self.locked_get()
  File "/usr/lib/python3.10/site-packages/oauth2client/file.py", line 54, in locked_get
    credentials = client.Credentials.new_from_json(content)
  File "/usr/lib/python3.10/site-packages/oauth2client/client.py", line 302, in new_from_json
    module_name = data['_module']
KeyError: '_module'