-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
server returned HTTP status 401 Unauthorized (401): no org id #7081
Comments
Not sure if it's a fix or just a workaround, but I had to do the following to make it work: promtail values.yaml config:
# publish data to loki
clients:
- url: http://loki-gateway/loki/api/v1/push
tenant_id: 1 and then in the values.yaml of the grafana chart datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Loki
type: loki
url: http://loki:3100
jsonData:
httpHeaderName1: 'X-Scope-OrgID'
secureJsonData:
httpHeaderValue1: '1' |
+1 to get this fixed or documented, it took a while to get things working... |
Grafana Agent Operator continously fails with: server returned HTTP status 401 Unauthorized (401): no org id ...and that is probably tracked upstream via: <grafana/loki#7081> (We are not interesting in having multi-tenant configuration and this is probably okay-ish.)
Grafana Agent Operator continously fails with: server returned HTTP status 401 Unauthorized (401): no org id ...and that is probably tracked upstream via: <grafana/loki#7081> (We are not interesting in having multi-tenant configuration and this is probably okay-ish.)
https://github.com/grafana/loki/tree/main/production/helm/loki |
good! |
This was very helpful, it enabled auth by default, you can change the value here to false and apply helm again |
Hey guys, I got the same issue when I built the following structure:
I tried the solution of setting a tenant in promtail values file, but still getting the error Note: I am using grafana/loki helm chart, do you have any other recommendations for helm chart? |
I fond this solution: My Environment:
1. If you want simplely enable multitenant support:## loki-distributed-values.yaml
loki:
config: |
auth_enabled: true
ingress:
enabled: false
gateway:
enabled: true
basicAuth:
enabled: false <-- not support basic auth ## promtail-values.yaml
config:
clients:
- url: http://loki-distributed-gateway/loki/api/v1/push
tenant_id: tenant-1
snippets:
pipelineStages:
- cri: {}
- match:
selector: '{stream="stderr",container="promtail"}'
action: drop
- match:
selector: '{namespace="dev",stream="stdout"}'
stages:
- tenant: <-- dynamic match tenantID
source: namespace In Grafana Web-UI:
2. If you want to use basic_auth
|
I ran into this issue when deploying Loki to my homelab. Then I used these values with the grafana/loki chart to get it to work: loki:
auth_enabled: false
commonConfig:
replication_factor: 1
storage:
type: "filesystem"
singleBinary:
replicas: 1 Note that this is an installation for learning and hobby purposes. |
if you set the auth_basic: false, you need to set your promtail config.yaml like
|
This change creates an initial configuration for Grafana Loki. This is surprisingly hard-won, and as a result, not yet fully hooked up to ArgoCD. This was applied manually with ``` helm upgrade --create-namespace --namespace logging logging . ``` There were a lot of reasons why this was hard-won. For starters, the Grafana Loki chart claimed there was a `global` section into which you could put `extraEnvFrom`, but that's not implemented (grafana/loki#11391). Next, every part of the installation guide (https://grafana.com/docs/loki/v2.9.x/setup/install/helm/install-scalable/) says to just copy-paste your S3 credentials. This is not a good idea for a variety of reasons, starting with them not being static, as they're being provisioned by Rook's CephObjectStore integration, and ending with it just not being good practice to put secrets into plaintext in a helm chart anyway. Fortunately, buried in the documentation and the helm chart are clues: it's possible to use `extraEnvFrom` to load the data from ConfigMap/Secret, but then you need to pass a special command-line argument `-config.expand-env=true`. See also, the aforementioned `global` section that does not actually work. But, after this adventure, we have centralized logging. There's still a few TODO issues, like figuring out authentication (see the sample on grafana/loki#7081 for guidance). There's also the question of how to automatically configure the Loki source in Grafana.
@dellnoantechnp |
I used helm install Loki and Promtail,But Promtail send 'caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"'
loki.yaml
loki的副本.md
promtail.yaml
promtail的副本.md
logs
level=error ts=2022-09-07T04:29:34.599308846Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:35.800382126Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:36.900329685Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:38.09956929Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:39.19990638Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:40.299893729Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:41.399964187Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:42.600158749Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:43.800863042Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:44.90022787Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:46.100090867Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:47.299770482Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:48.39999092Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
level=error ts=2022-09-07T04:29:49.599192624Z caller=client.go:380 component=client host=loki-gateway msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id"
The text was updated successfully, but these errors were encountered: