odata-influxdb icon indicating copy to clipboard operation
odata-influxdb copied to clipboard

KeyError: u'boolean'

Open otolizz opened this issue 6 years ago • 3 comments

Hi,

I'm trying to use your connector, but as i run the server.py, i always get this error: KeyError: u'boolean'

I'm using Influxdb 1.7, all requierments have been installed with pip install. When i run tests.py, the result seems to be ok:

/usr/local/lib/python2.7/dist-packages/requests/init.py:83:RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown. warnings.warn(warning, RequestsDependencyWarning) Querying InfluxDB: SELECT * FROM "measurement1" ...Querying InfluxDB: SELECT COUNT() FROM "measurement1" Querying InfluxDB: SELECT COUNT() FROM "measurement1" Querying InfluxDB: SELECT * FROM "measurement1" LIMIT 200 Querying InfluxDB: SELECT COUNT() FROM "measurement1" Querying InfluxDB: SELECT COUNT() FROM "measurement1" Querying InfluxDB: SELECT * FROM "measurement1" LIMIT 200 OFFSET 200 Querying InfluxDB: SELECT COUNT(*) FROM "measurement1" .. Ran 8 tests in 0.257s

OK.

The config sample file is well generated, so i copied it to production.conf, then edit it to put my conf:

[server] service_advertise_root = http://xxxxxx:8080 server_listen_interface = 0.0.0.0 server_listen_port = 8080

[metadata] ; set autogenerate to "no" for quicker startup of the server if you know your influxdb structure has not changed autogenerate = yes ; metadata_file specifies the location of the metadata file to generate metadata_file = metadata.xml

[influxdb] ; supported schemes include https+influxdb:// and udp+influxdb:// ; user:pass in this dsn is used for generating metadata dsn = https+influxdb://127.0.0.1:8086 max_items_per_query = 50 ; authentication_required will pass through http basic auth username ; and password to influxdb authentication_required = no

My influxdb is set to HTTPS, no auth required and listenning on 0.0.0.0:8086

Here is the output when i run server.py:

./usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py:851: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) [...] /usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py:851: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning) Traceback (most recent call last): File "server.py", line 168, in main() File "server.py", line 161, in main doc = load_metadata(c) File "server.py", line 66, in load_metadata metadata = generate_metadata(dsn) File "/root/odata-influxdb/influxdbmeta.py", line 131, in generate_metadata entity_sets, entity_types = entity_sets_and_types(i) File "/root/odata-influxdb/influxdbmeta.py", line 122, in entity_sets_and_types for m in db.measurements: File "/root/odata-influxdb/influxdbmeta.py", line 87, in measurements measurements.extend(m_dict(m) for m in rs.get_points()) File "/root/odata-influxdb/influxdbmeta.py", line 87, in measurements.extend(m_dict(m) for m in rs.get_points()) File "/root/odata-influxdb/influxdbmeta.py", line 85, in m_dict d['fields'] = self.fields(db['name']) File "/root/odata-influxdb/influxdbmeta.py", line 70, in fields return tuple(fields) File "/root/odata-influxdb/influxdbmeta.py", line 69, in ) for f in fields) File "/root/odata-influxdb/influxdbmeta.py", line 31, in get_edm_type return influx_type_to_edm_type[influx_type] KeyError: u'boolean'

The metadata.xml file is not generated.

In the influxdb log file, i can see request with a 200 return code:

127.0.0.1 - None [18/Sep/2019:09:50:11 +0200] "GET /query?q=SHOW+DATABASES HTTP/1.1" 200 123 "-" "python-requests/2.22.0" f108cc85-d9e8-11e9-84ba-005056a91a3c 1020 127.0.0.1 - None [18/Sep/2019:09:50:11 +0200] "GET /query?db=ORA&q=SHOW+MEASUREMENTS HTTP/1.1" 200 285 "-" "python-requests/2.22.0" f10c14cd-d9e8-11e9-84bc-005056a91a3c 13063 127.0.0.1 - None [18/Sep/2019:09:50:11 +0200] "GET /query?db=ORA&q=SHOW+FIELD+KEYS HTTP/1.1" 200 2741 "-" "python-requests/2.22.0" f10e6318-d9e8-11e9-84bd-005056a91a3c 27526

i have no idea on what to do here.... can you help ? :)

otolizz avatar Sep 18 '19 08:09 otolizz

Currently this tool only supports float, integer, and string types in your influxdb database. Seems like your influxdb target has a boolean field. Try running the tool on a different db with no boolean fields, then adjusting the generated xml file by hand.

soundstripe avatar Sep 29 '19 15:09 soundstripe

Same issue here in server.

When this tool is running, will it select specific influxdb database? To be specific, I did not understand the statement running the tool on a different db.

Thanks

Zhenye-Na avatar Nov 08 '19 01:11 Zhenye-Na

Resolved

Zhenye-Na avatar Nov 12 '19 16:11 Zhenye-Na