"There was a problem completing this query" on Dashboards for session based breakdown insights (Self-Hosted)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 7h 27m
- Merged PRs (30d)
- 222
Description
Bug description
We are using the self-hosted docker image for Posthog version Git SHA: 728d2c1c46
It seems like there is a bug with session related insights in Dashboards.
If we create a trends insight for Page views (Unique sessions) and add a breakdown by "Entry URL", the insight work well but as soon as you add it to the dashboard the widget says: "There was a problem completing this query" and if we click on "Open in query debugger" the query also works. The insight also works in Notebooks so it only doesn't work in dashboards.
The same issue occurs with any other session based breakdown. We tested "Entry pathname", "Entry URL", "Session Duration", etc. for different types of event "Page views", "All events", custom events.
How to reproduce
- Create a trend insight.
- Select "Page views" by "Unique Sessions"
- Add breakdown by "Entry URL"
- Save insight and add to dashboard.
- Insight won't work in dashboard.
Additional context
Here is the raw query that is working in insights and notebooks but NOT in dashboards:
{
"kind": "TrendsQuery",
"filterTestAccounts": true,
"dateRange": {
"date_to": null,
"date_from": null
},
"series": [
{
"kind": "EventsNode",
"event": "$pageview",
"name": "$pageview",
"math": "unique_session"
}
],
"interval": "day",
"breakdownFilter": {
"breakdown_type": "session",
"breakdown": "$entry_current_url"
},
"trendsFilter": {
"display": "ActionsLineGraph"
}
}
Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [X] PostHog Hobby self-hosted with `docker compose`, version/commit: 728d2c1c46
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TrendsQuery shown in the issue and compare how it is executed in dashboards versus insights, notebooks, and the query debugger. Reproduce the session breakdown with Unique Sessions and Entry URL, then trace the dashboard widget path; done means the same query renders successfully in a dashboard and has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- analytics, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100