Skip to Content

Testing & Debugging

Fix embed problems

Find why an embedded dashboard or metric is blank, slow or shows an error, and fix it.

Find the failing step

An embed loads in four steps. Check them in this order:

  1. The plugin loads and registers dbn-dashboard and dbn-metric.
  2. Your server makes a guest token with the data app API token.
  3. The embed sends the token to the Databrain API and gets the dashboard.
  4. Each chart runs its query on your warehouse.

Open the browser’s developer tools on your page, and look at the console and the network tab.

The embed is blank

Run this in the browser console:

({
  dashboard: Boolean(customElements.get('dbn-dashboard')),
  metric: Boolean(customElements.get('dbn-metric')),
})
  • Both are false. The plugin did not load. Check that you import @databrainhq/plugin/web once, before the component renders, and that the page has no script error.
  • true, but nothing shows. Give the element a width and a height. Check that token and dashboard-id (or metric-id) are set and not empty.
  • No request to the Databrain API. The token is missing, or your framework renders the element before the token arrives. Render it after you have the token.

The embed shows an error

You seeCauseFix
The request is refused with a token errorThe guest token expired or is not validMake a new guest token on your server
UNAUTHORIZED_ORIGINYour page’s domain is not allowedAdd the domain in the data app’s Domains tab. See Whitelist domains
DASHBOARD_NOT_FOUNDThe dashboard-id is not an embed of the token’s data appUse the embed’s dashboard ID from the data app’s Embeds tab, and a guest token from the same data app
“This dashboard can’t load right now. Contact your admin.”A cause written for you, the integrator, not for the viewerRead the error body in the network tab: code, hint and cause. See Read API and embed errors
“This chart did not load” or “This dashboard did not load.” with RetryThe server did not answer in 60 secondsSelect Retry. If it repeats, the warehouse query is slow. Check the datasource
Requests go to Databrain cloud on a self-hosted installThe plugin does not know your API addressSet base-url. See Point embeds at your instance

A failed chart or dashboard shows Request ID: <id> with Copy. It is the x-request-id of the failed response. A timeout has no ID, because no answer came back.

To show your own text instead of the default error, set customMessages.error in the component options.

The data looks wrong

  • A client sees another client’s rows. Stop and check tenancy first. The data app’s Tenancy tab shows what is not set up. Check that the guest token carries the right clientId.
  • No rows. Check the filters in the guest token and the clientId.
  • The numbers differ from your warehouse. Check the metric’s filters and time range. Then check the cache in workspace settings.

The layout changes on a narrow page

Below 1024 pixels wide, an embedded dashboard uses one column, even on a wide screen. Tables show as labelled records. This follows the width of the embed, not the screen. Give the element more width to keep the grid.

Ask for help

Send support:

  • The request ID or the ref from the error, and the time.
  • The plugin version (npm ls @databrainhq/plugin) and the page URL.
  • What you expected and what you saw.

Do not send guest tokens, API tokens or customer data. Admins can find the same request in Settings > Diagnostics > Logs by its ref.