bithauschile / datadog-ga

Datadog custom check for Google Analytics Real Time
MIT License
45 stars 22 forks source link

Check stoped working... #5

Closed rechena closed 7 years ago

rechena commented 7 years ago

Hi, suddenly the check stoped working.. not sure why. Looking at the output the only thing I see is:

Traceback (most recent call last): File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/googleapiclient/discovery_cache/init.py", line 41, in autodetect from . import file_cache File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/googleapiclient/discovery_cache/file_cache.py", line 41, in 'file_cache is unavailable when using oauth2client >= 4.0.0') ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 2017-06-09 09:41:18,577 | INFO | dd.collector | googleapiclient.discovery(discovery.py:273) | URL being requested: GET https://www.googleapis.com/discovery/v1/apis/analytics/v3/rest 2017-06-09 09:41:18,577 | INFO | dd.collector | oauth2client.transport(transport.py:157) | Attempting refresh to obtain initial access_token 2017-06-09 09:41:18,577 | ERROR | dd.collector | config(config.py:954) | Unable to initialize check ga Traceback (most recent call last): File "/opt/datadog-agent/agent/config.py", line 951, in _initialize_check agentConfig=agentConfig) File "/etc/dd-agent/checks.d/ga.py", line 120, in init self.init_config.get('service_account_email')) File "/etc/dd-agent/checks.d/ga.py", line 128, in get_service service = build(api_name, api_version, http=http) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper return wrapped(*args, *kwargs) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/googleapiclient/discovery.py", line 228, in build requested_url, discovery_http, cache_discovery, cache) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/googleapiclient/discovery.py", line 275, in _retrieve_discovery_doc resp, content = http.request(actual_url) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/transport.py", line 159, in new_request credentials._refresh(orig_request_method) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/client.py", line 749, in _refresh self._do_refresh_request(http) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/client.py", line 774, in _do_refresh_request body = self._generate_refresh_request_body() File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/client.py", line 1484, in _generate_refresh_request_body assertion = self._generate_assertion() File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/service_account.py", line 385, in _generate_assertion key_id=self._private_key_id) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/crypt.py", line 97, in make_signed_jwt signature = signer.sign(signing_input) File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/oauth2client/_openssl_crypt.py", line 97, in sign return crypto.sign(self._key, message, 'sha256') File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/OpenSSL/crypto.py", line 2088, in sign md_ctx = _ffi.new("EVP_MD_CTX") TypeError: cannot instantiate ctype 'EVP_MD_CTX' of unknown size

Any idea what could be?

rechena commented 7 years ago

Well, it seems that after downgrading the dd agent to 5.10.1-1 and running /opt/datadog-agent/embedded/bin/pip install --upgrade pyopenssl

So I'm assuming something changed on the Datadog agent that breaks the ga.py.

Zensavona commented 7 years ago

If anyone else encounters this issue and ends up here:

I encountered it also, and downgrading did not fix it for me, but instead downgrading my python cryptography library to 1.4:

/opt/datadog-agent/embedded/bin/pip install cryptography==1.4

I am running datadog-agent 5.15.0