-
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
[Snapshot Restore] Fix error when deleting snapshots behind reverse proxy #66147
[Snapshot Restore] Fix error when deleting snapshots behind reverse proxy #66147
Conversation
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @alisonelizabeth! I repro'ed and verified the fix. Code LGTM. I like how it became simpler as a result of this fix. Thanks for the detailed setup instructions in the gist. Can you walk me through how nginx's proxy pass rules were causing the bug in the first place?
Thanks @cjcenizal for the review!
I’m by no means an nginx expert 😄… but from what I could understand decoding occurs before the route hits the kibana server if the From the nginx docs:
|
* upstream/master: (223 commits) [Ingest] Support root level yaml variables in agent stream template (elastic#66120) [Snapshot Restore] Fix error when deleting snapshots behind reverse proxy (elastic#66147) [Lens] fix empty state for pie (elastic#66206) [APM] Improve e2e tests (elastic#66373) [ML] Data Frame Analytics: Fix steps to be named phases. (elastic#65855) [Discover] Encode context link filter part (elastic#63831) [APM] Scope APM alert creation to environment (elastic#65681) Move Kibana Usage collectors outside the telemetry plugin (elastic#65663) [ML] Data Frame Analytics: Fix confusion matrix data grid width. (elastic#65818) Switch to core application service (elastic#63443) Removes use of prefer_v2_templates (elastic#66316) [Maps] handle case where fit to bounds does not match any documents (elastic#66307) log error instead of throw (elastic#66254) [plugin-helpers] remove outdated postinstall task (elastic#66324) Spaces - migrate default space and enter space view to KP (elastic#66098) [APM] Change plugin id for `apm_oss` to `apmOss` (elastic#66164) [Maps] convert map_selectors to TS (elastic#65905) [uptime/usage-collector] add missing await (elastic#66079) [Ingest] Add additional attributes to the Datasources Saved Object (elastic#66127) [Endpoint]EMT-339: add new policy response schema (elastic#66264) ...
@alisonelizabeth I'm working on another sdh that's reporting not being able to delete a snapshot from Kibana Management > Elastic > Snapshot and Restore but for v7.4. |
Fixes #51166
It appears there was an encoding/decoding issue with the delete snapshots request when running through a reverse proxy (more details around nginx behavior here). I changed the request method from
DELETE
toPOST
to work around this.How to test
To reproduce the bug, first checkout master and follow the reverse proxy setup instructions in this gist.
How to create a snapshot:
path.repo
ES setting, e.g.,yarn es snapshot -E path.repo=/tmp/es_backups
Navigate to the "Snapshots" tab and try to delete a snapshot. You should receive a 404 error.
With this change, the snapshot should now be deleted successfully.
Release note
This change fixes a bug in Snapshot and Restore where snapshots could not be deleted if a user was running Kibana through a reverse proxy.