Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"influxdb2client E! Write error: json: cannot unmarshal string into Go struct field Error.Err of type error" in logs #376

Open
ajb opened this issue Mar 10, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ajb
Copy link

ajb commented Mar 10, 2023

Specifications

  • Client Version: Telegraf 1.25.2
  • InfluxDB Version: InfluxDB v2.6.1
  • Platform: Debian 11

Steps to reproduce

We are writing like this:

		influxClient := influxdb2.NewClient(w.url, w.authString)
		writeAPI := influxClient.WriteAPI("", "")

		for {
			select {
			case e := <-w.influxCh:
				writeAPI.WritePoint(influxdb2.NewPoint(e.measurement, e.tags, e.fields, e.time))
			case <-w.quit:
				writeAPI.Flush()
				return
			}
		}

Appears in our logs occasionally. Seems like an error is being returned to the write method, but the structure is incorrect for unmarshalling. Don't know exactly how to grab more data without forking the package and adding some prints.

Expected behavior

No errors are displayed

Actual behavior

Screenshot 2023-03-10 at 9 03 58 AM

Additional info

No response

@ajb ajb added the bug Something isn't working label Mar 10, 2023
@ajb
Copy link
Author

ajb commented Apr 19, 2023

found this in the telegraf agent logs:

Error parsing the request body: metric parse error: expected field at 1:214: "name_of_metric,foo=bar,main=true count=1i,reason="503 Service Unavailable: {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32011,\"message\":\"no backends available for method\"},\"id\":4465}\n"

@ajb
Copy link
Author

ajb commented Apr 19, 2023

Looks like maybe the issue is due to the trailing newline.

@powersj
Copy link
Contributor

powersj commented Apr 19, 2023

Looks like maybe the issue is due to the trailing newline.

Line protocol is newline separated so you would need to escape it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants