Reputation: 1204
I am currently trying to create and populate a collection automatically via Python. As mentioned the DB that I've chosen is Arango. The issue that I am having is that I get an error:
[HTTP 401][ERR 11] not authorized to execute this request
I've turned off fire walls and tried reinstalling Arango to check if I messed up something with setting up the admin profile but everything seems to be fine. The only similar question I've found so far is this one but it's still somehow irrelevant to my issue.
In regards to the builder, this is how I've set it up:
config={
"database": 'exampleDB',
"host":'localhost',
"protocol":'http',
"port":'8529',
"username":'someone',
"password":'xxxx'
}
Is there anything else that I am missing for setting up the permissions config? Or the issue might be somewhere else.
I am not posting my full code because it's company owned software.
Upvotes: 3
Views: 2727
Reputation: 11855
In case of pyArango you need to provide the credentials when you instantiate the Connection class:
from pyArango.connection import *
conn = Connection(username=config['username'], password=config['password'])
Documentation: https://bioinfo.iric.ca/~daoudat/pyArango/connection.html
In case of python-arango you first need a client object, then call the db()
method and provide the database name and the credentials:
from arango import ArangoClient
client = ArangoClient(protocol='http', host='localhost', port=8529)
db = client.db('_system', username=config['username'], password=config['password'])
Documentation: https://python-driver-for-arangodb.readthedocs.io/en/master/overview.html
The original repository of arango-python is abandoned since five years, it does not support any 2.x or 3.x server versions and I could not find anything for authentication (search on GitHub yielded no results for "auth", "password", "user", "cred"). The docs site is even more stale.
The ArangoPy project appears to be pretty dead as well, it supports ArangoDB 2.2 through 2.6 according to the readme. There is no example given for authentication. The Client constructor does take a parameter called auth
, but the usage remains unclear (<username>:<password>
?).
Upvotes: 5