Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No values in "a list of all values" filtering widget – metadata.js:228 Missing id #7542

Closed
Poggen opened this issue May 3, 2018 · 15 comments
Assignees
Labels
Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Parameters & Variables Filter widgets, field filters, variables etc. Type:Bug Product defects
Milestone

Comments

@Poggen
Copy link

Poggen commented May 3, 2018

  • Your browser and the version: Chrome 66.0.3359.139
  • Your operating system: macOS 10.13.4
  • Your databases: SQL Server
  • Metabase version: 29.0
  • Metabase hosting environment: Linux/Ubuntu 12
  • Metabase internal database: MySQL

Was super excited to try out the new search widget, but I am unfortunately unable to get it to work. The first time I focus on one of the filters in order to bring up the "Search the list" expanded input field, the following error is being thrown in my console:

metadata.js:228 Missing id: {values: ƒ}
copyObjects @ metadata.js:228
(anonymous) @ metadata.js:79
(anonymous) @ index.js:76
(anonymous) @ index.js:36
(anonymous) @ index.js:90
(anonymous) @ index.js:36
(anonymous) @ index.js:86
(anonymous) @ index.js:36
mapStateToProps @ QueryBuilder.jsx:75
mapToPropsProxy @ wrapMapToProps.js:43
handleNewState @ selectorFactory.js:52
handleSubsequentCalls @ selectorFactory.js:69
pureFinalPropsSelector @ selectorFactory.js:74
runComponentSelector @ connectAdvanced.js:26
componentWillReceiveProps @ connectAdvanced.js:150
updateComponent @ ReactCompositeComponent.js:611
receiveComponent @ ReactCompositeComponent.js:544
receiveComponent @ ReactReconciler.js:122
_updateRenderedComponent @ ReactCompositeComponent.js:751
_performComponentUpdate @ ReactCompositeComponent.js:721
updateComponent @ ReactCompositeComponent.js:642
receiveComponent @ ReactCompositeComponent.js:544
receiveComponent @ ReactReconciler.js:122
_updateRenderedComponent @ ReactCompositeComponent.js:751
_performComponentUpdate @ ReactCompositeComponent.js:721
updateComponent @ ReactCompositeComponent.js:642
receiveComponent @ ReactCompositeComponent.js:544
receiveComponent @ ReactReconciler.js:122
_updateRenderedComponent @ ReactCompositeComponent.js:751
_performComponentUpdate @ ReactCompositeComponent.js:721
updateComponent @ ReactCompositeComponent.js:642
receiveComponent @ ReactCompositeComponent.js:544
receiveComponent @ ReactReconciler.js:122
_updateRenderedComponent @ ReactCompositeComponent.js:751
_performComponentUpdate @ ReactCompositeComponent.js:721
updateComponent @ ReactCompositeComponent.js:642
receiveComponent @ ReactCompositeComponent.js:544
receiveComponent @ ReactReconciler.js:122
_updateRenderedComponent @ ReactCompositeComponent.js:751
_performComponentUpdate @ ReactCompositeComponent.js:721
updateComponent @ ReactCompositeComponent.js:642
performUpdateIfNecessary @ ReactCompositeComponent.js:558
performUpdateIfNecessary @ ReactReconciler.js:154
runBatchedUpdates @ ReactUpdates.js:148
perform @ Transaction.js:141
perform @ Transaction.js:141
perform @ ReactUpdates.js:87
flushBatchedUpdates @ ReactUpdates.js:170
closeAll @ Transaction.js:207
perform @ Transaction.js:154
batchedUpdates @ ReactDefaultBatchingStrategy.js:60
enqueueUpdate @ ReactUpdates.js:198
enqueueUpdate @ ReactUpdateQueue.js:22
enqueueSetState @ ReactUpdateQueue.js:216
ReactComponent.setState @ ReactBaseClasses.js:62
onStateChange @ connectAdvanced.js:205
notify @ Subscription.js:26
notifyNestedSubs @ Subscription.js:65
onStateChange @ connectAdvanced.js:202
dispatch @ createStore.js:173
dispatch @ VM329:1
(anonymous) @ middleware.js:22
(anonymous) @ index.js:28
(anonymous) @ store.js:70
(anonymous) @ store.js:17
dispatch @ applyMiddleware.js:35
_callee$ @ redux.js:16
tryCatch @ runtime.js:65
invoke @ runtime.js:303
prototype.(anonymous function) @ runtime.js:117
step @ redux.js:13
(anonymous) @ redux.js:13
Promise.then (async)
step @ redux.js:13
(anonymous) @ redux.js:13
(anonymous) @ redux.js:13
(anonymous) @ redux.js:29
(anonymous) @ store.js:17
(anonymous) @ bindActionCreators.js:3
componentWillMount @ FieldValuesWidget.jsx:86
performInitialMount @ ReactCompositeComponent.js:348
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
mountChildren @ ReactMultiChild.js:234
_createInitialChildren @ ReactDOMComponent.js:701
mountComponent @ ReactDOMComponent.js:520
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
mountChildren @ ReactMultiChild.js:234
_createInitialChildren @ ReactDOMComponent.js:701
mountComponent @ ReactDOMComponent.js:520
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
performInitialMount @ ReactCompositeComponent.js:368
mountComponent @ ReactCompositeComponent.js:255
mountComponent @ ReactReconciler.js:43
mountComponentIntoNode @ ReactMount.js:102
perform @ Transaction.js:141
batchedMountComponentIntoNode @ ReactMount.js:124
batchedUpdates @ ReactDefaultBatchingStrategy.js:58
batchedUpdates @ ReactUpdates.js:95
_renderNewRootComponent @ ReactMount.js:317
_renderSubtreeIntoContainer @ ReactMount.js:399
renderSubtreeIntoContainer @ ReactMount.js:340
_renderPopover @ Popover.jsx:276
componentDidMount @ Popover.jsx:91
notifyAll @ CallbackQueue.js:74
close @ ReactReconcileTransaction.js:78
closeAll @ Transaction.js:207
perform @ Transaction.js:154
perform @ Transaction.js:141
perform @ ReactUpdates.js:87
flushBatchedUpdates @ ReactUpdates.js:170
closeAll @ Transaction.js:207
perform @ Transaction.js:154
batchedUpdates @ ReactDefaultBatchingStrategy.js:60
batchedUpdates @ ReactUpdates.js:95
dispatchEvent @ ReactEventListener.js:145

I am able to perform the query by manually typing a value into the filter, but the search / autocomplete feature would have really aided the data exploration possibilities.

@danieltanfh95
Copy link

Does this work on your machine with the sample dataset?

@mazameli
Copy link
Contributor

mazameli commented May 3, 2018

Is this a dashboard filter or a query builder filter? What is the metadata type and the underlying data type of field is it that you're attempting to filter on? If it's a dashboard filter, which type of filter widget is it (date, id, location, category)?

@Poggen
Copy link
Author

Poggen commented May 3, 2018

@danieltanfh95 – with the sample dataset, I get the same console error, but it actually shows the available values immediately upon placing focus on the search widget.

@mazameli – this was a query builder filter (SQL mode), using the "Category" filter type (the only one available). All data in question are strings.

@Poggen
Copy link
Author

Poggen commented May 3, 2018

Tried to change the filtering settings for the field in question to "Search box" (from "a list of all values") and that worked! I'll change the title to make sure it reflects the fact that this only occurs with the "a list of all values" filter type.

@Poggen Poggen changed the title No results in search widget – metadata.js:228 Missing id No values in "a list of all values" filtering widget – metadata.js:228 Missing id May 3, 2018
@mazameli
Copy link
Contributor

mazameli commented May 4, 2018

@Poggen glad to hear you found a fix. I think I have a hunch as to what's going on: does your field have more than 100 distinct values?

If so, I think what's happening is that Metabase should have changed the filtering-on-this-field setting for that field to "search box" automatically, but did not. Secondly, if that's the case, we're not handling the case of a field with more than 100 values set to "a list of all values" correctly: presumably, this scenario should either result in a list of each and every possible field value (potentially a bad outcome), or we should force fields with more than 100 values to either be set to "search box" or "input box."

@camsaul
Copy link
Member

camsaul commented May 4, 2018

@Poggen does your Field have more than 100 distinct values?

@camsaul
Copy link
Member

camsaul commented May 4, 2018

@tlrobinson have you seen this JS error before? It's the same one in #7543

@camsaul
Copy link
Member

camsaul commented May 4, 2018

@mazameli have you been able to repro this at all locally or on our Stats instance?

@mazameli
Copy link
Contributor

mazameli commented May 4, 2018

@camsaul not yet. What I'm in the process of doing to try and repro this is go back to an old db with version 0.28.4 (happened to be the most recent jar I had lying around), create a couple of questions and dashboards with category filters on high cardinality fields with redshift, mysql, and postgres data, copy the app db over and then "upgrade" it to v0.29.0 locally and see what happens.

@camsaul
Copy link
Member

camsaul commented May 4, 2018

ok let me know if you figure out how to repro. I'm doing the same thing. I think most of the effort involved in this fix will be reproducing and once we can do that the fix should be easy

@Poggen
Copy link
Author

Poggen commented May 4, 2018

@camsaul sorry for my late response. All of the fields in our DB definitely had >100 distinct values.

@mazameli
Copy link
Contributor

mazameli commented May 4, 2018

@camsaul so I was able to reproduce this:

  1. Started up an instance on version 0.28.4.
  2. Created two dashboards, one with mysql data, one with postgres data (couldn't connect to our redshift db incidentally, I think due to No suitable driver found for jdbc:redshift #6350).
  3. In both dashboards, I created two filters: one with a field with more than 100 values, the other with fewer than 100 values. They were all Category filters with one exception: the large values filter for the postgres table was an "ID" widget dashboard filter.
  4. I copied over my app DB and used it to spin up a 0.29.0 instance.
  5. Everything worked as it should except the large values Category filter in the mysql dashboard was incorrectly set to "a list of all values" instead of "search box." Interestingly, the ID filter widget did correctly get set to "search box."
  6. I manually changed the broken Category field to "search box," and it worked, just as @Poggen reported. Manually triggering a sync/scan either on the field or the table did not appear to break things.
  7. I then manually switched that category field back to "a list of values." As I wrote above, what happens is that my filter widget turned into a dumb input box, presumably because it has more than 100 distinct values. This is definitely broken behavior. To repeat myself, I think it should either not let you choose the "a list of values" option for very high cardinality fields, or it should do what it says and render the full list of values.

As long as the field is set to "search box," new dashboard filters that use that field seem to correctly show the search box.

tl;dr — seems like Category fields aren't correctly getting switched over to "search box" when they have more than 100 distinct values. Also seems like our behavior for "a list of values" for fields with > 100 values is bad UX, if not outright broken.

@mazameli
Copy link
Contributor

mazameli commented May 4, 2018

Correction: I just tried a new dashboard filter using the Vendors field in the sample dataset which has 200 distinct values. It is set to "a list of values," and it is correctly displaying the full list. My other field in the example in the previous comment had 375 distinct values, so I now suspect the problem is actually when there are more than 300 distinct values set to "a list of values."

screen shot 2018-05-04 at 12 37 28 pm

Just for additional context, my ID field in the example in my previous comment has 17,712 distinct values.

@camsaul
Copy link
Member

camsaul commented May 4, 2018

Yeah, I've found another way to repro this, if you mark a Field with > 100 distinct values as "list" it doesn't list because there's a restriction in there somewhere that "list" Fields have to have 100 values or less. The big issue was when we migrated over from "Categories" having 300 values or less to "list Fields" having 100 or less things that were caught in-between those two limits are "having a bad time" so-to-speak. Should have a fix in a bit.

@camsaul camsaul self-assigned this May 4, 2018
@camsaul camsaul added this to the 0.29.1 milestone May 4, 2018
@salsakran salsakran added Querying/Parameters & Variables Filter widgets, field filters, variables etc. Type:Bug Product defects Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness labels May 7, 2018
@camsaul
Copy link
Member

camsaul commented May 8, 2018

Fixed by #7556

@camsaul camsaul closed this as completed May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:P1 Security holes w/o exploit, crashing, setup/upgrade, login, broken common features, correctness Querying/Parameters & Variables Filter widgets, field filters, variables etc. Type:Bug Product defects
Projects
None yet
Development

No branches or pull requests

5 participants