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

JSON Push API endpoint broken #3257

Closed
lukesteensen opened this issue Jan 28, 2021 · 2 comments
Closed

JSON Push API endpoint broken #3257

lukesteensen opened this issue Jan 28, 2021 · 2 comments

Comments

@lukesteensen
Copy link

Describe the bug
The push API endpoint no longer accepts JSON data, returning a 400 and snappy: corrupt input.

To Reproduce
Steps to reproduce the behavior:

  1. Started Loki (docker run --rm -it --network=host grafana/loki:master-51952da)
  2. Send the example curl request from the API docs.

Expected behavior
The request should succeed.

Environment:

  • Infrastructure: local Ubuntu machine
  • Deployment tool: docker

Screenshots, Promtail config, or terminal output

$ curl -v -H "Content-Type: application/json" -XPOST -s "http://localhost:3100/loki/api/v1/push" --data-raw '{"streams": [{ "stream": { "foo": "bar2" }, "values": [ [ "1570818238000000000", "fizzbuzz" ] ] }]}'
*   Trying 127.0.0.1:3100...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 3100 (#0)
> POST /loki/api/v1/push HTTP/1.1
> Host: localhost:3100
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 99
> 
* upload completely sent off: 99 out of 99 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 28 Jan 2021 21:22:58 GMT
< Content-Length: 22
< 
snappy: corrupt input
@dannykopping
Copy link
Contributor

Hey @lukesteensen - thanks for reporting.
We noticed it to and have pushed a fix already (#3261)

@lukesteensen
Copy link
Author

Great, thank you!

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

2 participants