xros / jsonpyes

The tool which imports raw JSON to ElasticSearch in one line of commands
Other
67 stars 21 forks source link

'float' object cannot be interpreted as an integer #46

Open unbranched opened 1 year ago

unbranched commented 1 year ago

The application suddenly doesn't work, it's many months I don't use it so I don't remember if I'm doing something wrong:

~$ jsonpyes --data input.json --bulk http://xxx.com:9201 --import --index my_index --thread 4 --check

All raw JSON data valid!
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/bin/jsonpyes", line 150, in worker_import_to_es_for_threading
    for i in range(start_line, stop_line + 1):
TypeError: 'float' object cannot be interpreted as an integer
Successfully data imported!

The message is immediate, it says successfully imported but it's not true.

My setup: python 3.8.10 Remote ES 7.13.0

xros commented 6 months ago

Did you forget the flag --type for importing?

In this case, try jsonpyes --data input.json --bulk http://xxx.com:9201 --import --index my_index --type my_type_1 --thread 4 --check