This repository was archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 524
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
Tutorial.py in examples doesn't work #197
Copy link
Copy link
Closed
Description
The turorial.py in examples (most basic example) doesn't work when connecting to a 0.9.0 server.
Here's the error and some additional info:
root@kenny:~/influxdb-python/examples# python tutorial.py
Create database: example
Create a retention policy
Switch user: smly
Write points: [{'timestamp': '2009-11-10T23:00:00Z', 'name': 'cpu_load_short', 'fields': {'value': 0.64}, 'tags': {'host': 'server01', 'region': 'us-west'}}]
Traceback (most recent call last):
File "tutorial.py", line 65, in <module>
main(host=args.host, port=args.port)
File "tutorial.py", line 39, in main
client.write_points(json_body)
File "/usr/local/lib/python2.7/dist-packages/influxdb/client.py", line 364, in write_points
tags=tags)
File "/usr/local/lib/python2.7/dist-packages/influxdb/client.py", line 406, in _write_points
expected_response_code=204
File "/usr/local/lib/python2.7/dist-packages/influxdb/client.py", line 277, in write
expected_response_code=expected_response_code
File "/usr/local/lib/python2.7/dist-packages/influxdb/client.py", line 257, in request
raise InfluxDBClientError(response.content, response.status_code)
influxdb.client.InfluxDBClientError: 400: {"error":"missing measurement"}
Python and influxdb extension versions:
root@kenny:~/influxdb-python/examples# pip freeze |grep influxdb
influxdb==2.4.0
root@kenny:~# python --version
Python 2.7.6
Influxdb server version:
root@kenny:~/influxdb-python/examples# aptitude show influxdb |grep -i version
Version: 0.9.0
root@kenny:~# md5sum influxdb_latest_amd64.deb
5642258db6888049a88ecbc4b9996bf9 influxdb_latest_amd64.deb
Ubuntu version:
root@kenny:~/influxdb-python/examples# cat /etc/issue
Ubuntu 14.04.1 LTS \n \l
Server log entry:
root@kenny:~/influxdb-python/examples# tail -n 1 /var/log/influxdb/influxd.log
[http] 2015/06/15 04:37:28 127.0.0.1 - - [15/Jun/2015:04:37:28 -0400] POST /write?p=my_secret_password&u=smly HTTP/1.1 400 56 - python-requests/2.2.1 CPython/2.7.6 Linux/3.13.0-43-generic c15a5a7e-1339-11e5-b5b3-000000000000 5.694303ms
At this point i am unable to write anything from python to ifluxdb simply because i don't know how. Any pointers/updated example and documentation is welcome.
Metadata
Metadata
Assignees
Labels
No labels