-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Saved objects export - unable to export when references are missing #43876
Comments
Pinging @elastic/kibana-platform |
We had a short discussion in a related bug #42343 (which really was two bugs in one, so I'm glad you opened this issue) I agree that warning about missing references but still exporting as much as possible seems to me like the most desirable behaviour. Since the API returns the export NDJSON we can't "inline" an error message. One way to work around that would be to have a ignoreMissingReferences option in the API. The UI could then try to perform an export and if that fails because of missing references, display a warning dialog and retry with ignoreMissingReferences = true. |
Based on #43233 I think we should also show which objects include the missing references so users are able to delete those objects or manually fix the references. |
This approach makes sense to me! |
Ran into the same issue here: #45520. Maybe the default experience should disable the toggle or set to off if a user is exporting all objects? |
We prioritized this in our 7.5 roadmap, but we're going to timebox to 1 week. If solving this takes longer, we should re-evaluate as a team before sinking more time into it. |
Adding the Main question is, how do we integrate this from the savedObjects page in the best way. The NDJSON format really limits what we can do in term of edge cases and user informations in case of successful call, as we have no way to add additional data (such as missing references and referencing objects) to the response without breaking the format. In case of error however, we can add anything to the error payload to actually inform the user. Options I see here without impacting the NDJSON format:
I guess option A) is the best one in term of user experience. @rudolf do you see anything else ? Other point, do we agree that even with I.E
with |
I though we could touch the NDJSON output for retro compat (importing in older than exported), but we are actually not supporting this, so after discussing with Rudolf, the solution we came to is the following:
@legrego not sure of your actual usage of the API. Are you using the import endpoint or are you importing back using another mecanism ? Is this proposal acceptable to your needs ? |
@pgayvallet the Copy to Space API uses |
The Saved Objects Export API (and corresponding UI feature) can optionally retrieve all references when exporting saved objects.
If the requested object references a non-existent object, the export operation will fail altogether.
I think it would be better if the export succeeded, or at least allowed for partial success.
curl 'http://localhost:5601/api/saved_objects/_export' -H 'kbn-version: 8.0.0' -H 'Content-Type: application/json' --data-binary '{"objects":[{"id":"722b74f0-b882-11e8-a6d9-e546fe2bba5f","type":"dashboard"}],"includeReferencesDeep":true}'
The text was updated successfully, but these errors were encountered: