Ascli trying to get numeric key


#1

Hi,

I have stored data in aerospike with numeric key. When I use ascli to retrieve the record I cant. Below is the command. ascli get nsname setname 459517144

I am able to get value from Java Client which is aware of key datatype.

-Manish


#2

Ascli expects the input to be strings.

The cli and aql tools can read numeric keys, but currently ascli lack the semantics.


#3

Thanks kporter for the reply.

I did try “cli” tool as below:

cli -h localhost -p 3000 -o get -n ns1d -s hhid_segment -k 100009884741

I get following error.

Traceback (most recent call last):
  File "/bin/cli", line 201, in <module>
    sys.exit(main())
  File "/bin/cli", line 167, in main
    r, gen, values = citrusleaf.get(cluster, args.namespace, args.set, parsed_key, debug=args.verbose)
  File "/opt/aerospike/lib/python/citrusleaf.py", line 1478, in get
    return citrusleafTransaction(cluster, buf, autoretry, debug)
  File "/opt/aerospike/lib/python/citrusleaf.py", line 1101, in citrusleafTransaction
    s = cluster.getConnection()
  File "/opt/aerospike/lib/python/citrusleaf.py", line 543, in getConnection
    c = host.getConnection()
  File "/opt/aerospike/lib/python/citrusleaf.py", line 416, in getConnection
    if s.connect() == True:
  File "/opt/aerospike/lib/python/citrusleaf.py", line 242, in connect
    self.s.connect(self.host_obj.sockaddr[0])
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
TypeError: getsockaddrarg() takes exactly 2 arguments (4 given)

Any pointers appreciated.


#4

Will need to investigate what caused that trace, not seeing it locally. What OS are you running on?

Is it a virtual machine?

Are you on a cloud? If so Which?

Could you also try passing the “-i” option for integer keys?

cli -h localhost -p 3000 -o get -n ns1d -s hhid_segment -k 100009884741 -i

#5

Hi,

I have tried -i option but it gives same error.

deployment machine is a CentosVM on our own h/w, not in the cloud.

Linux qa-aerospike-01 3.10.0-229.1.2.el7.x86_64 #1 SMP Fri Mar 27 03:04:26 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Thanks, Manish


#6

We will try to reproduce this crash on Centos7. In the meantime, could you instrument citrusleaf.py and print out the contents of self.host_obj.sockaddr[0] in the following file:

  File "/opt/aerospike/lib/python/citrusleaf.py", line 242, in connect
    self.s.connect(self.host_obj.sockaddr[0])

#7

We were able to reproduce this issue on CentOS 7 and I have filed the ticket AER-3801 to track this issue.


#8

Until citrusleaf.py can be made to work on CentOS 7, the only alternative tool will be AQL.


#9

Thanks kporter!

>>>>>>>>Debug:
('::1', 3000, 0, 0)

debugged the host information and it appears as above. ignore the first message.

-Manish


#10

So “::1” is localhost in IPv6 and currently citrusleaf.py doesn’t support IPv6.

You can work around this immediately by changing -h localhost to -h 127.0.0.1. Also if you cat /etc/hosts you will see the line that defines localhost as ::1 and if you are not using IPv6 you could change it to 127.0.0.1.