Display a helpful error when the instance fails to connect to Cube API

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

When a project has product analytics onboarded and the stack is unreachable we show a generic An error occurred while fetching data. Refresh the page to try again. error message. Also when a user navigates to a product analytics dashboard like Audience it shows an empty state instead.

This doesn't help the user solve the actual issue in anyway.

Screenshots

image

image

Current

Dashboard list GraphQL response contains an error which gives a good idea of the actual error.

Error from Cube API: Failed to open TCP connection to 127.0.0.1:4000 (Connection refused - connect(2) for "127.0.0.1" port 4000)

We could look match against this in the backend / frontend and display a nicer error on our UI. Something like Failed to connect to the product analytics data source. with a link to our troubleshooting documentation.

Dashboard page GraphQL for hardcoded dashboards simply returns empty. So the backend will need to be updated to pass the actual error if product analytics is onboarded and the stack is unreachable.

Scenarios to cover

  1. GitLab fails to connect to Cube API
  2. A request to /load a query has been made, but Product Analytics has not yet been onboarded.
    • Possible when a custom dashboard was created before PA is onboarded.

Implementation plan

TBD 🚧

Edited by 🤖 GitLab Bot 🤖