Getting the following error while putting record in the aerospike database using python client

exception.ClientError: (-1, 'Unable to call dumps function', 'src/main/serializer.c', 364, False)

Is this record size related issue ? Thanks in advance

Hi Arpit_Maiya,

The error is produced during the serialization of data in the python client by the following code.

                    PyObject * py_funcname = PyString_FromString("dumps");

                    Py_INCREF(cpickle_module);
                    initresult = PyObject_CallMethodObjArgs(cpickle_module,
                            py_funcname, value, NULL);
                    Py_DECREF(cpickle_module);
                    Py_DECREF(py_funcname);

                    if (!initresult) {
                        /* more error handling &c */
                        as_error_update(error_p, AEROSPIKE_ERR_CLIENT, "Unable to call dumps function");
                        goto CLEANUP;

See https://github.com/aerospike/aerospike-client-python/blob/984b75f1101c4c0bd3b40fbfedeaeb662e0da875/src/main/serializer.c#L368

My guess is “value” is something that the pickle module’s dumps() function can’t handle. It’s hard to tell exactly what the issue is without seeing the data that is being serialized. It could be a size issue if the data is large enough to cause pickle to run out of memory. If you can provide any more information about the python version you are on, what type of data is being serialized, and how large the records are, that might help solve the problem.

Best, Dylan.

Hi Dylan,

Thanks for the speedy response. I am using Python3.6 and the record is of size 25Kb. The type of data is stringified HTML-js.

On a lighter note, I tried to serialize/de-serialize this data using dumps()/loads() functions and its working fine.

Is there any issue with the aerospike python3 pickle module ?

Regards, Arpit

Thanks for your patience Arpit.

The python client uses the pickle module installed on the host python. I have not seen this issue arise before, but it could be the code calling the dumps function or passing it arguments. I will try to replicate the issue and take a look at the code.

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