Adding a new query runner, I have a data source field that won't save


I’m trying to add ActiveData as a query_runner. This is where I’m at: The problem is that it won’t save the Host URL field (which is required) on the data source configuration page no matter what I do. I have no idea why. The form is generated by the dynamic-form.html page and the configuration in the file matches the syntax and attributes of other query_runner configs. Thoughts?


I copied into my environment, created new data source from it and it saved everything properly.

Can you make sure that other data source types do save properly in your environment?


Interestingly enough saving other data sources has stopped working. Have you seen this before? How do you fix it?


Didn’t see this before.

If the data source doesn’t get saved at all, then check the server logs. Otherwise, just compare your current state of the code with the latest stable version you have (master branch?) and try to see what’s changed.


Thanks Arik. I did the comparison to see what changed in the link provided above ( ).

Upon digging deeper, I have found that it is saving the values to the redash database, but it does not display the saved information back to the user making it seem like something has failed. It appears to be doing the same for other, working data sources. Is that a security feature or known issue?


It’s neither. The only values we don’t show after saving are the ones that are marked as secret, but this is not the case.

Maybe this functionality is broken in your master branch as well?



Revert you code and see if the problem persists; it may be a problem in the state of the various Redash services, but I am guessing.


HTML is always changing on me: It may be these lines

     <input name="input" type="{{}}" class="form-control" ng-model="target.options[]" ng-required=""
            ng-if=" !== 'file' && !== 'checkbox'" accesskey="tab" placeholder="{{}}">
           <div class="mute-text"> {{ }} </div>

The <input> does not end in />. Could it be messing with all following tags?


@klahnakoski All of the other input tags in the project lack the ending /, so I was not adding it to maintain consistency but I tried it for kicks and giggles and it doesn’t change anything.

I had hypothesized the same conclusion @arikfr had about the mozilla master branch just being broken, so I had tried reverting all commits I made to the mozilla/redash master branch ever (including a rebase from getredash/redash master the week of June 12) but that had no effect on, for instance, postgres data source connections displaying saved data source info. So then I went forward and tried the branch I have that does a merge from getredash/redash master ( last week and that doesn’t show saved data source values either. I also tried a visual comparison of getredash/redash master dynamic-form.html and dynamic-form.js files with my dev branch for this ticket and found no differences that seemed relevant. (There is an improvement to error handling on the save of the form but it doesn’t change the behavior in that branch.)

Now, since the values are saving, but not displaying after save, I played around with the ng-model="target.options[]" in the input tag, since it would seem the Angular data bind to the field is at least a logical place to look. Also, it refers to target.options instead of like the rest of the Angular references. I tried and a few other things mostly for kicks but they didn’t work.

I also tried a different __init__() function (commit is synced to my dev branch if you’re interested) that mirrors the same function in other query_runners to no effect.

Since the removal of information occurs after the save I also tried commenting out $scope.dataSourceForm.$setPristine(); on line 132 of dynamic-form.js (even though it should only be changing CSS classes in the form), and that didn’t work.

Then, since the doc_url field is working fine and the difference between it and the host_url field are that host_url is required, I commented out the “required” line for the host_url field in the configuration_schema and that didn’t help.

Having read dynamic-form.js, @arikfr, it seems most concerned with the type of form field (i.e. checkbox, file, etc.). Could you please point out to me where it’s pulling the saved information from the database to assign it to target.options[]?


so, given that master also has this problem, I am guessing your setup is corrupted. I suggest deploying a fresh redash instance.


From the phrasing I’m not sure – was it working properly or not?

Also, on your production system, can you save and reload data sources properly?

target is an object the DynamicForm component receives from its parent. It’s being loaded here.

I would try reverting any changes to dynamic_form.{js,html} files and to pages/data-sources/show.{js,html} files. If reverting resolves the issue, then review all changes and see what might have causes it.

Actually before that make sure the data sources controller or model code in the backend didn’t change either.


Found it. It was a change to the model from November.


:clap: glad you figured it out :slight_smile: