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

Invalid searchSourceJSON causes saved object migration to fail #78530

Closed
rudolf opened this issue Sep 25, 2020 · 1 comment · Fixed by #78535
Closed

Invalid searchSourceJSON causes saved object migration to fail #78530

rudolf opened this issue Sep 25, 2020 · 1 comment · Fixed by #78535
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Feature:Saved Objects Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@rudolf
Copy link
Contributor

rudolf commented Sep 25, 2020

Discover's migrateMatchAllQuery ignores JSON.parse exceptions on searchSourceJSON but then in line 36 tries to access searchSource.query

try {
searchSource = JSON.parse(searchSourceJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (searchSource.query?.match_all) {

It seems like the intended behaviour is to ignore the JSON parse exception, but instead migrations fail without a useful error message.

@rudolf rudolf added bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Feature:Saved Objects Team:AppArch labels Sep 25, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@flash1293 flash1293 added :KibanaApp/fix-it-week Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Team:AppArch labels Sep 25, 2020
@alexwizp alexwizp self-assigned this Sep 25, 2020
alexwizp added a commit to alexwizp/kibana that referenced this issue Sep 25, 2020
alexwizp added a commit to alexwizp/kibana that referenced this issue Sep 28, 2020
alexwizp added a commit to alexwizp/kibana that referenced this issue Sep 30, 2020
alexwizp added a commit that referenced this issue Sep 30, 2020
)

* Invalid `searchSourceJSON` causes saved object migration to fail

Closes: #78530

* 7.8.2 -> 7.9.3

* return migration into 6.7.2
alexwizp added a commit to alexwizp/kibana that referenced this issue Sep 30, 2020
…stic#78535)

* Invalid `searchSourceJSON` causes saved object migration to fail

Closes: elastic#78530

* 7.8.2 -> 7.9.3

* return migration into 6.7.2
alexwizp added a commit to alexwizp/kibana that referenced this issue Sep 30, 2020
…stic#78535)

* Invalid `searchSourceJSON` causes saved object migration to fail

Closes: elastic#78530

* 7.8.2 -> 7.9.3

* return migration into 6.7.2
# Conflicts:
#	src/plugins/visualizations/server/saved_objects/visualization_migrations.ts
alexwizp added a commit that referenced this issue Sep 30, 2020
) (#78936)

* Invalid `searchSourceJSON` causes saved object migration to fail

Closes: #78530

* 7.8.2 -> 7.9.3

* return migration into 6.7.2
# Conflicts:
#	src/plugins/visualizations/server/saved_objects/visualization_migrations.ts
alexwizp added a commit that referenced this issue Sep 30, 2020
) (#78935)

* Invalid `searchSourceJSON` causes saved object migration to fail

Closes: #78530

* 7.8.2 -> 7.9.3

* return migration into 6.7.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Feature:Saved Objects Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants