Redash: URL data source settings screen crashes the front-end

Created on 20 Mar 2020  路  6Comments  路  Source: getredash/redash

Issue Summary

The URL data source is deprecated but many of them still exist in the wild. If you visit settings for the data source, the front-end crashes.

Steps to Reproduce

  1. Create a new type: url data source via the API:
curl --request POST \
  --url https://app.redash.io/default/api/data_sources \
  --header 'authorization: Key <your api key>' \
  --header 'content-type: application/json' \
  --data '{
  "name": "Bug Proof",
  "type": "url",
  "syntax": "sql",
  "paused": 0,
  "pause_reason": null,
  "options": {
    "password": "pass",
    "url": "example.com",
    "username": "user"
  },
  "queue_name": "queries",
  "scheduled_queue_name": "scheduled_queries"
}'
  1. Try to view the data source in settings. The front-end crashes and the console fills with dynamicForm errors

image

Technical details:

  • Redash Version: v9 alpha
  • Browser/OS: FF & Chrome
  • How did you install Redash: SaaS
Bug

All 6 comments

@gabrieldutra maybe because the options schema isn't available?

@gabrieldutra maybe because the options schema isn't available?

I think that's the exact reason, but I'm also not sure about how we can handle this (at least frontend side)... Since there's no configuration schema, we technically don't "know" how to handle the form.

On the frontend what we can do is not render the form (render a message instead) and allow actions to be performed (e.g: delete the DS). Other options include somehow migrate existing deprecated data sources, or keeping them in the settings with a flag (not that good, as we keep some "unnecessary" code).

One option is to have the API return the configuration schemas for all data source types, but mark the deprecated ones so they are excluded from the create UI.

One option is to have the API return the configuration schemas for all data source types, but mark the deprecated ones so they are excluded from the create UI.

Oh, I see, I thought the deprecated ones had their code deleted :sweat_smile:. That's feasible, basically move the filtering logic from #3972 to the frontend, I'll push a PR with that :+1:.

Does the URL data source have a configuration schema? I don't see one in url.py.

Does the URL data source have a configuration schema? I don't see one in url.py.

Yes, it's totally based on BaseHTTPQueryRunner

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomaytotomato picture tomaytotomato  路  4Comments

yalisassoon picture yalisassoon  路  4Comments

GitSumito picture GitSumito  路  3Comments

atharvai picture atharvai  路  4Comments

brylie picture brylie  路  3Comments