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

Server error: TypeError: a.filter is not a function #6604

Closed
nithusha21 opened this issue Apr 14, 2019 · 1 comment
Closed

Server error: TypeError: a.filter is not a function #6604

nithusha21 opened this issue Apr 14, 2019 · 1 comment

Comments

@nithusha21
Copy link
Contributor

This error occurred recently in production

TypeError: a.filter is not a function
at (https://www.oppia.org/build/templates/head/filters/RemoveDuplicatesInArrayFilter.e5864333c42fa4d75af316c8ff0b432e.js:1)
at Object.ContainsAtLeastOneOf (https://www.oppia.org/build/extensions/interactions/ItemSelectionInput/directives/ItemSelectionInputRulesService.70d85addbcac6ca6d5650e0d39ac6704.js:1)
at a (https://www.oppia.org/build/templates/head/pages/exploration_player/AnswerClassificationService.4ebb539509f632cdd38bb73142bcbf47.js:1)
at Object.getMatchingClassificationResult (https://www.oppia.org/build/templates/head/pages/exploration_player/AnswerClassificationService.4ebb539509f632cdd38bb73142bcbf47.js:1)
at Object.isClassifiedExplicitlyOrGoesToNewState (https://www.oppia.org/build/templates/head/pages/exploration_player/AnswerClassificationService.4ebb539509f632cdd38bb73142bcbf47.js:1)
at (https://www.oppia.org/build/templates/head/services/StateTopAnswersStatsService.cb89ccebb730ae6b4fc48acfd3d4eca8.js:1)
at Array.forEach (<anonymous>)
at j (https://www.oppia.org/build/templates/head/services/StateTopAnswersStatsService.cb89ccebb730ae6b4fc48acfd3d4eca8.js:1)
at f (https://www.oppia.org/build/templates/head/services/StateTopAnswersStatsService.cb89ccebb730ae6b4fc48acfd3d4eca8.js:1)
at (https://www.oppia.org/build/templates/head/pages/exploration_editor/ExplorationStatesService.5663d297f771506e6a0652cd3b1794cd.js:1)

Additional context I tried investigating this and the issue seems to stem from https://github.com/oppia/oppia/blob/develop/extensions/interactions/ItemSelectionInput/directives/ItemSelectionInputRulesService.js#L30. I guess that the value passed into the filter (answer) might not be an array under some circumstance, which leads to the error. This needs further investigation to understand when and why it happens.

General instructions
There are no specific repro steps available for this bug report. The general procedure to fix server errors should be the following:

  • Analyze the code in the file where the error occurred and come up with a hypothesis for the reason.
  • Get the logic of the proposed fix validated by an Oppia team member (have this discussion on the issue thread).
  • Make a PR that fixes the issue, then close the issue on merging the PR. (If the error reoccurs in production, the issue will be reopened for further investigation.)
seanlip pushed a commit that referenced this issue Jun 15, 2019
* add logging for guppy error, and filter expression error

* fix lint

* fix merge and review comments
@kevintab95
Copy link
Member

Closing this since it no longer occurs on the server. Will reopen if it shows up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants