Security enabled, exception.NotAuthenticated: (80L, 'Failed to connect', 'src/main/aerospike/as_cluster.c', 254, False)

Hi running Aerospike enterprise edition, using python client to connect to aerospike.

The code is as follows:

 # aerospike class variables
  dbHost = "rhes75"
  dbPort = 3000
  dbConnection = "mich"
  namespace = "test"
  dbPassword = "xxxxxxxx"
  dbSet = "oracletoaerospike2"

    # Check aerospike is accessible
      config = {
          'hosts': [(self.dbHost, self.dbPort)]
      client = aerospike.client(config).connect([self.dbConnection, self.dbPassword])
    except ClientError as e:
      print("Error: {0} [{1}]".format(e.msg, e.code))
        print("Connection successful")

 I am getting this error

Traceback (most recent call last):
  File "./", line 88, in <module>
  File "./", line 76, in read_aerospike_set
    client = aerospike.client(config).connect([self.dbConnection, self.dbPassword])
exception.NotAuthenticated: (80L, 'Failed to connect', 'src/main/aerospike/as_cluster.c', 254, False)

and the audit log shows

Nov 11 20:46:15 rhes75 asd: not authenticated | client: | authenticated user: <none> | action: info request | detail: <none>

So it cannot see the username. The documentation says:

connect([username, password])
Connect to the cluster. The optional username and password only apply when connecting to the Enterprise Edition of Aerospike.
username (str) – a defined user with roles in the cluster. See admin_create_user().
password (str) – the password will be hashed by the client using bcrypt.
ClientError, for example when a connection cannot be established to a seed node (any single node in the cluster from which the client learns of the other nodes).


With a clarification from Ronan Botzer , this is resolved :slight_smile:

The issue was that I interpreted the as part of the syntax

connect([username, password])

So the correct code is:

client = aerospike.client(config).connect(self.dbConnection, self.dbPassword)


© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.