aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
432 stars 198 forks source link

Partition map empty error from Aerospike on vm #400

Open vishalpunj opened 1 year ago

vishalpunj commented 1 year ago

I am having Aerospike v6.2.0.8 running on my virtual machine having OS RHEL 7.x. and using go client v6. I am able to successfully make connection with DB but when I am trying to fetch or insert records using Get() or Put() function, I am getting error as 'Partition map empty'. However when I am running same version of Aerospike on docker, I am able to fetch and insert the records using the same code. Below is a snippet of sample code I am using to make connection and query the data:

clientPolicy := as.NewClientPolicy()
clientPolicy.User = "usename"
clientPolicy.Password = "password"
client, err := as.NewClientWithPolicy(clientPolicy, "host", 3000)
if err != nil {
    fmt.Println("Error connecting to Aerospike: ", err)
    return
}
key, err := as.NewKey("namespace", "setname", "keyname")
record, err := client.Get(nil, key)
if err != nil {
         fmt.Println(err)
}
fmt.Println(record)
khaf commented 1 year ago

Is the namespace you are using for the key defined in your config file? Can you insert the same record via AQL?

vishalpunj commented 1 year ago

aerospike.conf.zip asinfo.txt Yes namespace is defined in config file and attaching the config file and asinfo for reference. Also I am able to insert same record via AQL.

khaf commented 1 year ago

Usually this happens when the client cannot connect to the server node and update the partition table. The easiest way to find out what's happening is to enable DEBUG logging in the client:

        import asl "github.com/aerospike/aerospike-client-go/v6/logger"
...
    asl.Logger.SetLevel(asl.DEBUG)
vishalpunj commented 1 year ago

Cross checked the credentials they are correct but DEBUG log shows 'Authentication Failed'

Screenshot 2023-04-27 at 4 14 10 PM
khaf commented 1 year ago

So this is an enterprise edition? Can you help me reproduce this? I need your setup steps to see if I can repro the issue.

vishalpunj commented 1 year ago

Yes this is an enterprise edition. Following steps will be helpful to reproduce the issue. Setting up Aerospike on VM with os RHEL 7.x.: Step 1: downloaded image from https://aerospike.com/download/ Step 2: Extracted contents of the package: tar -xvf aerospike.tgz Step 3: Installed server and tools -rpm -Uvh aerospike-server-enterprise-6.2.0.0-1.el7.aarch64.rpm -rpm -Uvh aerospike-tools-8.1.0-1.el7.aarch64.rpm (Name of the package was different. It was related to v6.2.0.8) Step 4: systemctl start aerospike Setting up Client:

  1. Install go version go1.19.5 darwin/amd64
  2. Install aerospike go client using
    • go get github.com/aerospike/aerospike-client-go/v6 Driver code is there in the issue description
metallerok commented 11 months ago

what does the command clien.IsConnected() return? Maybe client connection closed during request