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

Incorrect Content-Type when serving MessagePack #23146

Open
harmv opened this issue Feb 23, 2022 · 0 comments
Open

Incorrect Content-Type when serving MessagePack #23146

harmv opened this issue Feb 23, 2022 · 0 comments

Comments

@harmv
Copy link

harmv commented Feb 23, 2022

I'd like to report a bug in influxdb2. There seems to be a problem in the way that influxdb2 handles MessagePack responses (on the v1 interface)

This bug triggers problems (crashes) in influxdb clients. See: influxdata/influxdb-python#915

This seems to be a regression. influxdb 1.8 works fine.

Steps to reproduce

Issue a web request to the influxdb server, and specifically request data to be returned in MessagePack format (by passing the 'Accept: application/x-msgpack' header)

curl -i "http://localhost:8086/query?q=show+measurements&db=mydb" -H "Authorization: Basic *******************" -H "Content-Type: application/json" -H "Accept: application/x-msgpack" --output -

Result

The influxdb server replies, but it has the incorrect Content-Type in the reply.

HTTP/1.1 200 OK
Date: Wed, 23 Feb 2022 13:09:22 GMT
Content-Length: 83
Content-Type: application/octet-stream

??results???statement_id?series???name?measurements?columns??name?values???sensors(

The reply has the (incorrect) Content-Type: application/octet-stream
The actual response is fine. Its in MessagePack format, as requested. But the Content-Type header is wrong.

Expected result

influxdb should responds with header:

Content-Type: application/x-msgpack

version info

influxdb2 2.0.3 amd64 Distributed time-series database.
on Ubuntu 20.04.4 LTS

Older influxdb works fine (eg 1.8.3 does not have this problem, it responds with "Content-Type: application/x-msgpack"

Notes

I'm not 100% sure this is a bug in influxdb (merely 95% :) ), if its not, then its a bug in influxdb-python. As that crashes on such responses.

Anyway its an omission in the documentation too. The return Content-Type seems not properly specified. see: https://docs.influxdata.com/influxdb/v2.1/api/v1-compatibility/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant