Issue writing point when providing historical times?

I have a csv file that contains historical measurements that I am trying to write to InfluxDB.

I have converted the timestamps to that which InfluxDB seems to like if I enter things manually.

Example data from CSV:


Timestamp and measurement, pretty simple.

I can manually insert things as such:

> insert portcount ports=62 1490252400000000000
> select * from portcount
name: portcount
time                ports
----                -----
1490252400000000000 62

My python script simple runs through each line of the csv and extracts what is needed and then should write the points to the database.


import influxdb
from influxdb import client as influxdb    
portcount = {}
with open(r'portcountlog.csv', 'r') as h:
    for line in h:
        log = line.strip('\n').split(',')
        loglist = []
        logentry = {}
        logentry['measurement'] = "portcount"
        logentry['time'] = log[0]
        logentry['fields'] = {}
        logentry['fields']['ports'] = log[1]
        print (loglist)

When I try running it I can see the data is correct for the line but it seems as though something in the client is trying generate its own timestamp or something?

[user@itnetops scripts]$ python
[{'fields': {'ports': '2\r'}, 'time': '1489647600000000000', 'measurement': 'portcount'}]
Traceback (most recent call last):
  File "", line 26, in <module>
  File "/usr/lib/python2.7/site-packages/influxdb/", line 456, in write_points
    tags=tags, protocol=protocol)
  File "/usr/lib/python2.7/site-packages/influxdb/", line 506, in _write_points
  File "/usr/lib/python2.7/site-packages/influxdb/", line 292, in write
    data = make_lines(data, precision).encode('utf-8')
  File "/usr/lib/python2.7/site-packages/influxdb/", line 160, in make_lines
    _convert_timestamp(point['time'], precision)
  File "/usr/lib/python2.7/site-packages/influxdb/", line 22, in _convert_timestamp
    timestamp = parse(timestamp)
  File "/usr/lib/python2.7/site-packages/dateutil/", line 1168, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/lib/python2.7/site-packages/dateutil/", line 578, in parse
    if cday > monthrange(cyear, cmonth)[1]:
  File "/usr/lib64/python2.7/", line 121, in monthrange
    day1 = weekday(year, month, 1)
  File "/usr/lib64/python2.7/", line 113, in weekday
    return, month, day).weekday()
OverflowError: signed integer is greater than maximum

Is it trying to convert the timestamp I provided? It shouldn’t have to convert since it is in the format that InfluxDB uses? Any suggestions or advice on getting this to work?