Analytics poller is not feeling well, any idea on how to fix it?

97 views
Skip to first unread message

Danny Fröberg

unread,
Aug 30, 2016, 3:20:12 AM8/30/16
to scalr-discuss
tail -50 /opt/scalr-server/var/log/service/python-analytics_poller.log

[30/Aug/2016 07:16:08][    analytics_poller][ 17075]      ERROR platform: 'ec2', region: 'ap-southeast-1', envs_ids: [1]. Reason: <type 'exceptions.AttributeError'> 'module' object has no attribute 'sslwrap'
Traceback (most recent call last):
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/analytics_poller.py", line 143, in _ec2_region
    cloud_nodes = _ec2_get_only_instances(conn)
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/../scalrpy/util/helper.py", line 285, in wrapper2
    retries=retries, retry_timeout=retry_timeout, excs=excs
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/../scalrpy/util/helper.py", line 272, in retry_f
    return f(*args, **kwds)
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/analytics_poller.py", line 88, in _ec2_get_only_instances
    return ec2conn.get_only_instances(filters={'instance-state-name': 'running'})
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/boto/ec2/connection.py", line 622, in get_only_instances
    next_token=next_token)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/boto/ec2/connection.py", line 681, in get_all_reservations
    [('item', Reservation)], verb='POST')
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/boto/connection.py", line 1170, in get_list
    response = self.make_request(action, params, path, verb)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/boto/connection.py", line 1116, in make_request
    return self._mexe(http_request)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/boto/connection.py", line 943, in _mexe
    request.body, request.headers)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 1097, in _send_request
    self.endheaders(body)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 1053, in endheaders
    self._send_output(message_body)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 897, in _send_output
    self.send(msg)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 859, in send
    self.connect()
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/boto/https_connection.py", line 131, in connect
    ca_certs=self.ca_certs)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/gevent/ssl.py", line 383, in wrap_socket
    ciphers=ciphers)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/gevent/ssl.py", line 85, in __init__
    self._sslobj = _ssl.sslwrap(self._sock, server_side,
AttributeError: 'module' object has no attribute 'sslwrap'
root@scalr:~# 

Marc O'Brien

unread,
Aug 30, 2016, 5:35:50 PM8/30/16
to scalr-discuss

Hi Danny,

This behavior is related to an issue that has been resolved in Enterprise Scalr. 

Cheers,
Wm. Marc O'Brien
Scalr Technical Support

gia...@creativepulse.com.au

unread,
Sep 12, 2016, 4:11:39 PM9/12/16
to scalr-...@googlegroups.com
Hi Marc,

Just recently I updated Scalr to the latest version and everything continued to work except for the cost analytics poller. I'm getting a similar error in the logs:

...
File "/opt/scalr-server/embedded/lib/python2.7/ssl.py", line 352, in wrap_socket _context=self)
TypeError: __init__() got an unexpected keyword argument 'server_hostname'

Is this part of the same issue that has been resolved in Enterprise Scalr?

Thanks,
Gianni

Marc O'Brien

unread,
Sep 14, 2016, 11:55:52 AM9/14/16
to scalr-discuss
Hi Gianni,

Yes, this appears to be related to a similar issue that has since been resolved in Enterprise Scalr.

Many thanks,

Wm. Marc O'Brien
Scalr Technical Support

Matthieu Serrepuy

unread,
Feb 2, 2017, 7:24:14 AM2/2/17
to scalr-discuss
Hi !

I am running the community version and I want to enable cost analytics for Azure on one of our env.

I can see the same problem posted earlier on python-analytics_processor.log.

[02/Feb/2017 10:29:04][              helper][ 30497]      ERROR Azure billing for environments [2] failed. Reason: <type 'exceptions.TypeError'> __init__() got an unexpected keyword argument 'server_hostname'

Traceback (most recent call last):
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/../scalrpy/util/billing.py", line 1095, in process_envs
    self.load_access_token(envs[0])
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/../scalrpy/util/billing.py", line 871, in load_access_token
    resp = requests.post(url, headers=headers, data=data, proxies=self.proxy)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/api.py", line 111, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/adapters.py", line 403, in send
    timeout=timeout
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 578, in urlopen
    chunked=chunked)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 351, in _make_request
    self._validate_conn(conn)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 814, in _validate_conn
    conn.connect()
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 289, in connect
    ssl_version=resolved_ssl_version)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py", line 308, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)

  File "/opt/scalr-server/embedded/lib/python2.7/ssl.py", line 352, in wrap_socket
    _context=self)
TypeError: __init__() got an unexpected keyword argument 'server_hostname'

Is there a possible fix for the community version ?

Thanks,

Matt

Matthieu Serrepuy

unread,
Feb 2, 2017, 9:21:06 AM2/2/17
to scalr-discuss
Adding ndg to the dependancies fixed the issue for me on the community edition.

If anybody is interested, I added https://pypi.python.org/pypi/ndg-httpsclient (ndg + ndg_httpsclient.egg-info/) under /opt/scalr-server/embedded/lib/python2.7/site-packages/

Brandon Newport

unread,
Mar 31, 2017, 4:43:19 PM3/31/17
to scalr-discuss
Matthieu,

I am seeing the same issues.  I attempted your fix, but I am still seeing errors.

Did you have to do anything else to get this to work?

I downloaded the ndg-httpsclient to my Scalr Host (Community Version), and copied the (ndg + ndg_httpsclient.egg-info/) directories under the location you suggested, but I am still seeing errors.

I also ran a /opt/scalr-server/bin/scalr-server-ctl reconfigure but still no luck.  Any help thoughts on this would be appreciated.

Brandon

Matthieu Serrepuy

unread,
Apr 3, 2017, 4:45:13 AM4/3/17
to scalr-...@googlegroups.com
Hi Brandon,

When you added the new libraries, has the error message changed ?

Can you post the new logs here ?

Checking if I added other libraries there in the meantime.

Thanks,

--
You received this message because you are subscribed to a topic in the Google Groups "scalr-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalr-discuss/2C7376WrVrk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalr-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brandon Newport

unread,
Apr 6, 2017, 10:18:55 AM4/6/17
to scalr-discuss, matthieu...@gmail.com
Hello Matthieu,

Sorry for the delay, I am not sure if the messages have changes, but this is what I am getting now.  It may be a completely different error than before.

[06/Apr/2017 14:12:21][    analytics_poller][ 11595]      ERROR platform: 'openstack', environments: [1]. Reason: <type 'exceptions.TypeError'> __init__() got an unexpected keyword argument 'server_hostname'
Traceback (most recent call last):
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/analytics_poller.py", line 755, in process_credential
    cloud_data = eval(cred.platform)(cred)
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/analytics_poller.py", line 530, in openstack
    return _openstack(Provider.OPENSTACK, cred)
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/analytics_poller.py", line 490, in _openstack
    service_catalog = _libcloud_get_service_catalog(driver)
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/../scalrpy/util/helper.py", line 285, in wrapper2
    retries=retries, retry_timeout=retry_timeout, excs=excs
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/../scalrpy/util/helper.py", line 272, in retry_f
    return f(*args, **kwds)
  File "/opt/scalr-server/embedded/scalr/app/python/scalrpy/analytics_poller.py", line 93, in _libcloud_get_service_catalog
    return driver.connection.get_service_catalog()
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/libcloud/common/openstack.py", line 218, in get_service_catalog
    self._populate_hosts_and_request_paths()
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/libcloud/common/openstack.py", line 302, in _populate_hosts_and_request_paths
    osa = osa.authenticate(**kwargs)  # may throw InvalidCreds
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/libcloud/common/openstack_identity.py", line 843, in authenticate
    return self._authenticate_2_0_with_password()
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/libcloud/common/openstack_identity.py", line 868, in _authenticate_2_0_with_password
    return self._authenticate_2_0_with_body(reqbody)
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/libcloud/common/openstack_identity.py", line 873, in _authenticate_2_0_with_body
    method='POST')
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/libcloud/common/base.py", line 782, in request
    headers=headers)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 1097, in _send_request
    self.endheaders(body)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 1053, in endheaders
    self._send_output(message_body)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 897, in _send_output
    self.send(msg)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 859, in send
    self.connect()
  File "/opt/scalr-server/embedded/lib/python2.7/site-packages/libcloud/httplib_ssl.py", line 260, in connect
    return httplib.HTTPSConnection.connect(self)
  File "/opt/scalr-server/embedded/lib/python2.7/httplib.py", line 1278, in connect
    server_hostname=server_hostname)
  File "/opt/scalr-server/embedded/lib/python2.7/ssl.py", line 352, in wrap_socket
    _context=self)
TypeError: __init__() got an unexpected keyword argument 'server_hostname'




To unsubscribe from this group and all its topics, send an email to scalr-discus...@googlegroups.com.

James Smith

unread,
Apr 7, 2017, 2:02:50 PM4/7/17
to scalr-discuss, matthieu...@gmail.com
That error matches an error I was getting last year. Check if you need to update gevent, as that resolved the "unexpected keyword argument server_hostname" issue for me, though I still haven't managed to get analytics working with Openstack Mitaka.

This post from one of my threads might help.

Brandon Newport

unread,
Apr 14, 2017, 11:50:43 AM4/14/17
to scalr-discuss, matthieu...@gmail.com
James,

I was running 1.0.1 version of Gevent, so I upgraded to 1.0.2, and followed your instructions but I am still seeing the issue.

Not sure what is happening.  Any other thoughts?

James Smith

unread,
Apr 17, 2017, 3:42:38 PM4/17/17
to scalr-discuss
Did you restart the dbqueue service after upgrading gevent?

Brandon Newport

unread,
Apr 18, 2017, 4:04:07 PM4/18/17
to scalr-...@googlegroups.com
Yes, I actually restarted the system again yesterday to verify that everything had been restarted.

To unsubscribe from this group and all its topics, send an email to scalr-discuss+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages