2

I'm a newbie and trying to learn Python, Bulbs, Neo4j. I have no idea how to debug this problem that occurs at the very start when I just try to create a Graph object. Here's the traceback:

 File "test.py", line 12, in __init__
    self.graph = Graph()
  File "C:\Python27\lib\site-packages\bulbs\neo4jserver\graph.py", line 55, in __init__
    super(Graph, self).__init__(config)
  File "C:\Python27\lib\site-packages\bulbs\base\graph.py", line 58, in __init__
    self.vertices = self.build_proxy(Vertex)
  File "C:\Python27\lib\site-packages\bulbs\base\graph.py", line 124, in build_proxy
    return self.factory.build_element_proxy(element_class, index_class)
  File "C:\Python27\lib\site-packages\bulbs\factory.py", line 19, in build_element_proxy
    primary_index = self.get_index(element_class,index_class,index_name)
  File "C:\Python27\lib\site-packages\bulbs\factory.py", line 27, in get_index
    index = index_proxy.get_or_create(index_name)
  File "C:\Python27\lib\site-packages\bulbs\neo4jserver\index.py", line 87, in get_or_create
    resp = self.client.get_or_create_vertex_index(index_name,index_config=config)
  File "C:\Python27\lib\site-packages\bulbs\neo4jserver\client.py", line 742, in get_or_create_vertex_index
    return self.create_vertex_index(index_name, *args, **kwds)
  File "C:\Python27\lib\site-packages\bulbs\neo4jserver\client.py", line 697, in create_vertex_index
    resp = self.request.post(path, params)
  File "C:\Python27\lib\site-packages\bulbs\rest.py", line 131, in post
    return self.request(POST, path, params)
  File "C:\Python27\lib\site-packages\bulbs\rest.py", line 184, in request
    http_resp = self.http.request(uri, method, body, headers)
  File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1608, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1359, in _request
    for authorization in self._auth_from_challenge(host, request_uri, headers, response, content):
  File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 1243, in _auth_from_challenge
    challenges = _parse_www_authenticate(response, 'www-authenticate')
  File "C:\Python27\lib\site-packages\httplib2\__init__.py", line 317, in _parse_www_authenticate
    raise MalformedHeader("WWW-Authenticate")
httplib2.MalformedHeader: WWW-Authenticate

I'm running on Windows 7, if that matters. Can anyone help?

Thanks!

  • 2
    I think bulbs is not actively maintained anymore and doesn't support neo4j 2.2 and authentication. The last version on PyPI is from 04/2014 and github doesn't look better. Go for http://py2neo.org/ instead. – Martin Preusse May 01 '15 at 17:10
  • Well then! That blows. Bulbs looked so promising. I guess I'll have to stick with the py2neo. Thanks for stopping me before I wasted any more time on this. – horcle_buzz Nov 16 '15 at 02:48

1 Answers1

1

According to https://code.google.com/p/httplib2/issues/detail?id=289 httplib2 throws that error when the service you're accessing sends a 401 and requests authentication.

Since version 2.2 Neo4j has built in authentication which is enabled by default, see http://neo4j.com/docs/stable/security-server.html#security-server-auth.

So you can either supply your username and password to bulbs when creating the connection (don't know details of bulbs, so cannot give a more precise advice here) or you can switch off authentication in the neo4j server by setting

dbms.security.auth_enabled=false

in neo4j-server.properties.

Stefan Armbruster
  • 39,465
  • 6
  • 87
  • 97
  • Thanks, I'll look into bulbs/authentication. Odd, though, because the bulbs quickstart that I'm following makes no mention of needing to do this, and the quickstart begins from downloading and installing. I wonder if it's some kind of installation problem, maybe peculiar to Windows?. – Big Data Newbie May 01 '15 at 16:53
  • Yes, disabling authentication in the neo4j server gets around this problem. But I'd still like to know why the authentication didn't work. I tried supplying a config with my user and password to the Graph constructor, but I still got the same malformed header error. – Big Data Newbie May 02 '15 at 19:17