influxdata / influxdata/influxdb1-client

uint64 returns invalid number from Influx v1.8

Open
#41 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
192
Forks
109
PR merge metrics
No merged PRs in 30d

Description

Marshaling a field with type uint64 will trigger an "invalid number" error.

This seems to come from these lines: https://github.com/influxdata/influxdb1-client/blob/master/models/points.go#L2354-L2356

A solution would be to cast this to int64 similarly to the cases underneath it.

Additional information

Shell log:

> INSERT convert,hostname=hanaharu wrote_bytes=2363546 1593054632437
> INSERT convert,hostname=hanaharu wrote_bytes=2363546u 1593054632437
ERR: {"error":"unable to parse 'convert,hostname=hanaharu wrote_bytes=2363546u 1593054632437': invalid number"}

InfluxDB v1.8 Data Types for the line protocol reference, which doesn't show unsigned types.

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in models/points.go at the lines linked in the issue and compare uint64 handling with the cases immediately below. Reproduce the shell example or a comparable uint64 marshal, then confirm the resulting line protocol is accepted by InfluxDB v1.8 without an invalid-number error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.