Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Parse error: Double backslash in tag unable to parse! #485

Closed
rainmanliu opened this issue Aug 3, 2017 · 4 comments
Closed

Parse error: Double backslash in tag unable to parse! #485

rainmanliu opened this issue Aug 3, 2017 · 4 comments

Comments

@rainmanliu
Copy link

{
    'fields': {'item_name': 'Used_DiskC:\\', 'timestamp': 1501741608},
    'time': 1501741608756283045,
    'tags': {'item_tag': 'Used_DiskC:\\', 'dev_tag': u'Datacenter'},
    'measurement': 'item_monitor_history'
}

error:
InfluxDBClientError: 400: {"error":"unable to parse 'item_tag=Used_DiskC:\\,item_name="Used_DiskC:\\",timestamp=1501741608i': invalid tag format"}

@rainmanliu rainmanliu changed the title Parse error: Double backslash in tag value unable to parse! Parse error: Double backslash in tag unable to parse! Aug 3, 2017
@sebito91
Copy link
Contributor

@rainmanliu can you please provide the version of the module and InfluxDB you're seeing this with?

@sebito91
Copy link
Contributor

Hmm, I can actually replicate this issue...looking into it.

In [8]: json_body = {'points': [{
      :     'fields': {'item_name': 'Used_DiskC:\\', 'timestamp': 1501741608},
      :     'time': 1501741608756283045,
      :     'tags': {'item_tag': 'Used_DiskC:\\', 'dev_tag': u'Datacenter'},
      :     'measurement': 'item_monitor_history'
      : }]}

In [9]: client.write(json_body, params={'db': 'newtest'})
---------------------------------------------------------------------------
InfluxDBClientError                       Traceback (most recent call last)
<ipython-input-9-7b04a4422b5a> in <module>()
----> 1 client.write(json_body, params={'db': 'newtest'})

/home/sborza/src/anaconda/lib/python2.7/site-packages/influxdb-4.1.1-py2.7.egg/influxdb/client.pyc in write(self, data, params, expected_response_code, protocol)
    300             data=data,
    301             expected_response_code=expected_response_code,
--> 302             headers=headers
    303         )
    304         return True

/home/sborza/src/anaconda/lib/python2.7/site-packages/influxdb-4.1.1-py2.7.egg/influxdb/client.pyc in request(self, url, method, params, data, expected_response_code, headers)
    261             return response
    262         else:
--> 263             raise InfluxDBClientError(response.content, response.status_code)
    264
    265     def write(self, data, params=None, expected_response_code=204,

InfluxDBClientError: 400: {"error":"unable to parse 'item_monitor_history,dev_tag=Datacenter,item_tag=Used_DiskC:\\\\ item_name=\"Used_DiskC:\\\\\",timestamp=1501741608i 1501741608756283045': invalid tag format"}

@sebito91
Copy link
Contributor

I think I've found where the parsing has issue, but have to work through the fixes. Created #487 if you want to follow along.

@xginn8
Copy link
Collaborator

xginn8 commented Dec 11, 2017

This issue was fixed in #537

@xginn8 xginn8 closed this as completed Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants