-
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
Internal server error when saving a widget with German characters in name #8705
Conversation
According to my analysis this error is caused by missing url encoding of the Possible workarounds and solutions would be to...
|
To add a few more details about the |
@weltenwort I would rather not transform the headers coming back from Elasticsearch, but if @tylersmalley had a good reason for not going to 15+ it might be necessary. Either way it would be great if you would file an issue at elastic/elasticsearch. |
@spalger I totally agree with header rewriting not being a great solution. But if we want this to be fixed before 5.0.0 GA I would feel apprehensive of making as big a change as upgrading to hapi. |
I agree with @weltenwort that upgrading to Hapi 15 would be a large change to get in at the last minute before GA. I will work on the upgrade path and see what is necessary. @weltenwort, do you want to go down the rewrite path? |
It would also theoretically be possible for us to fork hapijs@14 and cherry-pick this commit onto it, if the rewriting path doesn't work out hapijs/hapi@9f2bd3d I tried this out locally, and it seemed to resolve the issue. |
Yes, that's another possibility. I have a re-encode PR almost done though - just want to add some tests. Thanks for all your input! 🙇♂️ |
I have a PR up, but still have quite a bit of testing to do: #8737 |
Right now there are situations in which ElasticSearch puts characters in the character code range between 128 and 255 into the `Location` header. This leads to an exception when trying to pass on that header through the hapi proxy in versions before 15.0.0, because it validates that only US-ASCII characters are used in headers. To work around that situation, the `Location` header is encoded using `encodeURI()` for now. Closes elastic#8705
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.
LGTM
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.
@@ -20,7 +20,14 @@ function createProxy(server, method, route, config) { | |||
xforward: true, | |||
timeout: server.config().get('elasticsearch.requestTimeout'), | |||
onResponse: function (err, responseFromUpstream, request, reply) { | |||
reply(err, responseFromUpstream); | |||
const upstreamLocation = responseFromUpstream.headers.location; |
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.
I don't think we can depend on responseFromUpstream
being defined if there was an error. We should probably early return if there was an error and then read the location header from the responseFromUpstream
--------- **Commit 1:** URI-encode forwarded location header in proxy Right now there are situations in which ElasticSearch puts characters in the character code range between 128 and 255 into the `Location` header. This leads to an exception when trying to pass on that header through the hapi proxy in versions before 15.0.0, because it validates that only US-ASCII characters are used in headers. To work around that situation, the `Location` header is encoded using `encodeURI()` for now. Closes #8705 * Original sha: 18c23c1 * Authored by Felix Stürmer <[email protected]> on 2016-10-18T17:55:31Z **Commit 2:** Add test to verify umlaut in vis name Relates to #8705 * Original sha: e100e1f * Authored by Felix Stürmer <[email protected]> on 2016-10-19T09:01:46Z **Commit 3:** [elasticsearch/proxy] use different code path with erorr * Original sha: fec5e1a * Authored by spalger <[email protected]> on 2016-10-19T19:06:39Z
--------- **Commit 1:** URI-encode forwarded location header in proxy Right now there are situations in which ElasticSearch puts characters in the character code range between 128 and 255 into the `Location` header. This leads to an exception when trying to pass on that header through the hapi proxy in versions before 15.0.0, because it validates that only US-ASCII characters are used in headers. To work around that situation, the `Location` header is encoded using `encodeURI()` for now. Closes #8705 * Original sha: 18c23c1 * Authored by Felix Stürmer <[email protected]> on 2016-10-18T17:55:31Z **Commit 2:** Add test to verify umlaut in vis name Relates to #8705 * Original sha: e100e1f * Authored by Felix Stürmer <[email protected]> on 2016-10-19T09:01:46Z **Commit 3:** [elasticsearch/proxy] use different code path with erorr * Original sha: fec5e1a * Authored by spalger <[email protected]> on 2016-10-19T19:06:39Z
Right now there are situations in which ElasticSearch puts characters in the character code range between 128 and 255 into the `Location` header. This leads to an exception when trying to pass on that header through the hapi proxy in versions before 15.0.0, because it validates that only US-ASCII characters are used in headers. To work around that situation, the `Location` header is encoded using `encodeURI()` for now. Closes elastic#8705
--------- **Commit 1:** URI-encode forwarded location header in proxy Right now there are situations in which ElasticSearch puts characters in the character code range between 128 and 255 into the `Location` header. This leads to an exception when trying to pass on that header through the hapi proxy in versions before 15.0.0, because it validates that only US-ASCII characters are used in headers. To work around that situation, the `Location` header is encoded using `encodeURI()` for now. Closes elastic#8705 * Original sha: 03ccb8ec56eb92c86162e307a286305384ba92c3 [formerly 18c23c1] * Authored by Felix Stürmer <[email protected]> on 2016-10-18T17:55:31Z **Commit 2:** Add test to verify umlaut in vis name Relates to elastic#8705 * Original sha: 238f6f64a55d113f30fd8f61f5330c1c97f23627 [formerly e100e1f] * Authored by Felix Stürmer <[email protected]> on 2016-10-19T09:01:46Z **Commit 3:** [elasticsearch/proxy] use different code path with erorr * Original sha: 0f7e4548c7808d845bf0df661d9a3742b81f14da [formerly fec5e1a] * Authored by spalger <[email protected]> on 2016-10-19T19:06:39Z Former-commit-id: afbc790
Kibana version:
5.0-rc2 snapshot, build 14376
Elasticsearch version:
5.0-rc1
Server OS version:
MacOS, El Capitan 10.11.6 (15G31)
Browser version:
Version 53.0.2785.143 (64-bit)
Browser OS version:
MacOS, El Capitan 10.11.6 (15G31)
Original install method (e.g. download page, yum, from source, etc.):
Manual tar
Description of the problem including expected versus actual behavior:
When creating widgets with special German characters (and m
Steps to reproduce:
Errors in browser console (if relevant):
Error from Kibana log:
Interestingly, visualization is still saved on refresh.
Note: It's possible other languages and special characters are affected... I tested Russian, Japanese, and Bengali and didn't run into the same problem, but it was not thorough testing.