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

syntax error: unexpected $end when setting server.http_path_prefix #2176

Closed
tarokkk opened this issue Jun 4, 2020 · 4 comments
Closed

syntax error: unexpected $end when setting server.http_path_prefix #2176

tarokkk opened this issue Jun 4, 2020 · 4 comments
Labels
stale A stale issue or PR that will automatically be closed.

Comments

@tarokkk
Copy link
Contributor

tarokkk commented Jun 4, 2020

Describe the bug
When you set http_path_prefix Loki response with:
error parsing labels: parse error : syntax error: unexpected $end

To Reproduce
Installed Loki from latest chart and port-forwarded to localhost-
loki-0.29.0 v1.5.0

Example curl (working)

$ curl -v -H "Content-Type: application/json" -XPOST -s "http://localhost:3100/loki/api/v1/push" --data-raw \
  '{"streams": [{ "stream": { "foo": "bar2" }, "values": [ [ "1591260992000000000", "fizzbuzz" ] ] }]}'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3100 (#0)
> POST /loki/api/v1/push HTTP/1.1
> Host: localhost:3100
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 99
>
* upload completely sent off: 99 out of 99 bytes
< HTTP/1.1 204 No Content
< Date: Thu, 04 Jun 2020 08:56:49 GMT
<
* Connection #0 to host localhost left intact
* Closing connection 0

Setting the http_path_prefix to loki-server

$ curl -v -H "Content-Type: application/json" -XPOST -s "http://localhost:3100/loki-server/loki/api/v1/push" --data-raw \
  '{"streams": [{ "stream": { "foo": "bar2" }, "values": [ [ "1591260992000000000", "fizzbuzz" ] ] }]}'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3100 (#0)
> POST /loki-server/loki/api/v1/push HTTP/1.1
> Host: localhost:3100
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 99
>
* upload completely sent off: 99 out of 99 bytes
< HTTP/1.1 400 Bad Request
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 04 Jun 2020 09:00:23 GMT
< Content-Length: 66
<
error parsing labels: parse error : syntax error: unexpected $end
* Connection #0 to host localhost left intact
* Closing connection 0

Expected behavior
It should work like without the settings.

Environment:

  • Infrastructure: Kubernetes
  • Deployment tool: Helm

Config:

auth_enabled: false
chunk_store_config:
  max_look_back_period: 0s
ingester:
  chunk_block_size: 262144
  chunk_idle_period: 3m
  chunk_retain_period: 1m
  lifecycler:
    ring:
      kvstore:
        store: inmemory
      replication_factor: 1
  max_transfer_retries: 0
limits_config:
  enforce_metric_name: false
  reject_old_samples: true
  reject_old_samples_max_age: 168h
schema_config:
  configs:
  - from: "2018-04-15"
    index:
      period: 168h
      prefix: index_
    object_store: filesystem
    schema: v9
    store: boltdb
server:
  http_listen_port: 3100
  http_path_prefix: /loki-server
storage_config:
  boltdb:
    directory: /data/loki/index
  filesystem:
    directory: /data/loki/chunks
table_manager:
  retention_deletes_enabled: false
  retention_period: 0s%
@sandeepsukhani
Copy link
Contributor

The problem is with detecting the version from the API here.
I think support for a prefix could be hard considering the endpoints being hardcoded at some of the places in query-frontend like here.

@cyriltovena
Copy link
Contributor

All good point @sandeepsukhani, I think we can do it for the frontend, considering the config is shared.

@slim-bean
Copy link
Collaborator

@tarokkk in the future please avoid asking your peers to thumbs up an issue in an attempt to game the priority, this is a good way to find yourself at the bottom of the priority list....

@stale
Copy link

stale bot commented Jul 4, 2020

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Jul 4, 2020
@stale stale bot closed this as completed Jul 11, 2020
cyriltovena pushed a commit to cyriltovena/loki that referenced this issue Jun 11, 2021
* Hide passwords in URLs from flags.
* Add secret flag handler that hides the value of the secret when marshalled to YAML.
* Use flagext.Secret for Azure, GCP, Redis, Cassandra secrets and block storage config.
* Teach doc generator how to handle flagext.Secret.

Signed-off-by: Tom Wilkie <tom@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale A stale issue or PR that will automatically be closed.
Projects
None yet
Development

No branches or pull requests

4 participants