Troubleshoot logflare analytics 401 Unauthorized response #20065
-
Questions
ContextI have a self-hosted setup in both kubernetes and docker-compose. The kubernetes deployment is a faithful translation of the current official docker-compose file in the main branch. Nearly everything is working with full parity between the two, except logs, which I'm working on presently. I have both running simultaneously to compare behavior. Expected behaviorIn the docker compose, fetching Actual behaviorIn my kubernetes cluster, fetching the same path, {
"code": 401,
"message": "Unauthorized",
"requestId": "4561f640-f54a-4464-9ad6-47a434c596ec"
} I can see the fetch request in the browser, and I can see this request makes it through the Kong API gateway and is destined for the studio service:
I assume this request is sent to the studio given this route: services:
## Protected Dashboard - catch all remaining routes
- name: dashboard
_comment: 'Studio: /* -> http://studio:3000/*'
url: http://studio:3000/
routes:
- name: dashboard-all
strip_path: true
paths:
- /
plugins:
- name: cors
- name: basic-auth
config:
hide_credentials: true However, I'm struggling to figure out why the request is unauthorized. The studio logs are empty in both docker-compose and kubernetes:
Lastly, I've searched through all of the services container log outputs and I can't find that request id ( Please advise, thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 5 replies
-
I verified the request is going from kong to studio by incorporating the studio pod into the service mesh. This allows me to observe the request id from kong to studio to analytics, but it's still unclear why the request is unauthorized.
{
"protocol": "HTTP/1.1",
"authority": "analytics:4000",
"route_name": "default",
"upstream_local_address": "10.65.200.220:53792",
"bytes_sent": 24,
"requested_server_name": null,
"upstream_host": "10.65.246.126:4000",
"start_time": "2023-12-30T20:49:23.262Z",
"user_agent": "node",
"x_forwarded_for": null,
"client_ip": null,
"path": "/api/endpoints/query/logs.all?project=default&sql=%0ASELECT%0A--+log-event-chart%0A++timestamp_trunc%28t.timestamp%2C+minute%29+as+timestamp%2C%0A++count%28t.timestamp%29+as+count%0AFROM%0A++edge_logs+t%0A++cross+join+unnest%28metadata%29+as+m%0A++cross+join+unnest%28m.request%29+as+request%0A++cross+join+unnest%28m.response%29+as+response%0A++where+t.timestamp+%3E+%272023-12-30T13%3A00%3A00.000Z%27%0AGROUP+BY%0Atimestamp%0AORDER+BY%0A++timestamp+ASC%0A++&ref=default&project_tier=ENTERPRISE",
"method": "GET",
"upstream_cluster": "outbound|4000||analytics.dev-jeff.svc.cluster.local",
"response_flags": "-",
"upstream_transport_failure_reason": null,
"bytes_received": 0,
"downstream_remote_address": "10.65.200.220:45902",
"downstream_local_address": "10.64.27.78:4000",
"response_code_details": "via_upstream",
"status_code": 401,
"request_id": "cac80416-b6f0-4b3f-a889-e079244d175d",
"duration": 6,
"upstream_service_time": null
} |
Beta Was this translation helpful? Give feedback.
-
I've verified it's definitely logflare by enabling debug logs with
|
Beta Was this translation helpful? Give feedback.
-
I notice the
|
Beta Was this translation helpful? Give feedback.
-
Did you ever figure this out? |
Beta Was this translation helpful? Give feedback.
-
Also having this error :/ |
Beta Was this translation helpful? Give feedback.
-
@jeffmccune getting same issue but with Database, did you have trouble with Database part too or just logs ? below is from kong pod
|
Beta Was this translation helpful? Give feedback.
-
Never figured this out unfortunately, mainly because I hit my time box limit working on this issue.
|
Beta Was this translation helpful? Give feedback.
-
Hi, dev of logflare here. The issue as to why the queries are failing is due to the seeding sources not completing before queries are getting made. Somehow or the other, the necessary supabase log sources are not getting created. A few things that we can determine from your analysis:
Some things that I can advise to help with debugging this:
Edit 10 sept: Please try to use v1.8.9, as it contains a patch relating to stale PG config. |
Beta Was this translation helpful? Give feedback.
-
still same error ..... |
Beta Was this translation helpful? Give feedback.
Hi, dev of logflare here. The issue as to why the queries are failing is due to the seeding sources not completing before queries are getting made. Somehow or the other, the necessary supabase log sources are not getting created.
A few things that we can determine from your analysis:
Some things that I can advise to help with debugging this: