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

Kibana crashed on ERR_UNESCAPED_CHARACTERS('Request path') #29194

Closed
LeeDr opened this issue Jan 23, 2019 · 7 comments
Closed

Kibana crashed on ERR_UNESCAPED_CHARACTERS('Request path') #29194

LeeDr opened this issue Jan 23, 2019 · 7 comments
Labels
blocker bug Fixes for quality problems that affect the customer experience regression Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.6.0

Comments

@LeeDr
Copy link

LeeDr commented Jan 23, 2019

Kibana version: 6.6.0 BC8

Elasticsearch version: 6.6.0 BC8

Server OS version: CentOS 7

Browser version: Chrome

Browser OS version: Windows 10

Original install method (e.g. download page, yum, from source, etc.): .rpm package default distribution

Describe the bug: while an automated test was creating a makelogs-* index pattern I was typing while the browser took focus. So the index pattern name temporarily became makelogs-t*. I deleted the t thinking the test would recover and continue. But the Kibana server process had exited.

Steps to reproduce:

  1. Not sure if it's reproducible yet. Start Kibana, go to Manamgement > Index patterns
  2. type various index pattern names. Some which match existing indices and change to not match, and back to matching again (Kibana is querying Elasticsearch as you make changes)
  3. See if Kibana crashes

Expected behavior: Kibana shouldn't crash.

Screenshots (if relevant):

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):
The kibana.stdout with last output at 15:39:09

{"type":"log","@timestamp":"2019-01-23T15:39:07Z","tags":["plugin","debug"],"pid":13334,"message":"Checking Elasticsearch version"}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","legacy-proxy"],"pid":13334,"message":"Event is being forwarded: connection"}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","legacy-service"],"pid":13334,"message":"Request will be handled by proxy POST:/elasticsearch/makelogs-t*/_search?ignore_unavailable=true."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate user request to /elasticsearch/makelogs-t*/_search?ignore_unavailable=true."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate via login attempt."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Username and password not found in payload."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate via header."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Authorization header is not presented."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate via state."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Request has been authenticated via state."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","legacy-proxy"],"pid":13334,"message":"Event is being forwarded: connection"}
{"type":"response","@timestamp":"2019-01-23T15:39:09Z","tags":[],"pid":13334,"method":"post","statusCode":200,"req":{"url":"/elasticsearch/makelogs-t*/_search?ignore_unavailable=true","method":"post","headers":{"host":"localhost:5601","connection":"keep-alive","content-length":"69","accept":"application/json, text/plain, */*","origin":"https://localhost:5601","kbn-version":"6.6.0","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","content-type":"application/json","referer":"https://localhost:5601/app/kibana","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9"},"remoteAddress":"10.0.2.2","userAgent":"10.0.2.2","referer":"https://localhost:5601/app/kibana"},"res":{"statusCode":200,"responseTime":72,"contentLength":9},"message":"POST /elasticsearch/makelogs-t*/_search?ignore_unavailable=true 200 72ms - 9.0B"}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","legacy-service"],"pid":13334,"message":"Request will be handled by proxy POST:/elasticsearch/makelogs-t%20*/_search?ignore_unavailable=true."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate user request to /elasticsearch/makelogs-t%20*/_search?ignore_unavailable=true."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate via login attempt."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Username and password not found in payload."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate via header."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Authorization header is not presented."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Trying to authenticate via state."}
{"type":"log","@timestamp":"2019-01-23T15:39:09Z","tags":["debug","security","basic"],"pid":13334,"message":"Request has been authenticated via state."}

The kibana.stderr which doesn't include the timestamp but stat shows modify time 1 second after the last stdout message;

[root@localhost vagrant]# stat /var/log/kibana/kibana.stderr
Modify: 2019-01-23 15:39:10.423822090 +0000
[root@localhost vagrant]# cat /var/log/kibana/kibana.stderr
_http_client.js:114
      throw new ERR_UNESCAPED_CHARACTERS('Request path');
      ^

TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
    at new ClientRequest (_http_client.js:114:13)
    at Object.request (https.js:281:10)
    at Object.request (/usr/share/kibana/node_modules/https-proxy-agent/node_modules/agent-base/patch-core.js:23:20)
    at HttpConnector.request (/usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:169:23)
    at sendReqWithConnection (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:223:35)
    at Object.utils.applyArgs (/usr/share/kibana/node_modules/elasticsearch/src/lib/utils.js:187:19)
    at wrapper (/usr/share/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:5199:19)
    at process._tickCallback (internal/process/next_tick.js:61:11)

Any additional context:

@LeeDr LeeDr added bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Jan 23, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@LeeDr
Copy link
Author

LeeDr commented Jan 23, 2019

This is a regression since 6.5.4. Apparently related to our bumping node to 10.

@marius-dr
Copy link
Member

I used romanian characters to test this: mașini (which means cars)

Also, it errors out in Dev Tools as well, but it doesn't crash the Kibana server:

 error  [18:12:40.440]  TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
    at new ClientRequest (_http_client.js:114:13)
    at Object.request (http.js:41:10)
    at internals.Client._request (C:\Users\ratonbox\Desktop\kibana-6.6.0-windows-x86_64\node_modules\wreck\lib\index.js:191:24)
    at internals.Client.request (C:\Users\ratonbox\Desktop\kibana-6.6.0-windows-x86_64\node_modules\wreck\lib\index.js:108:22)
    at handler (C:\Users\ratonbox\Desktop\kibana-6.6.0-windows-x86_64\src\legacy\core_plugins\console\server\proxy_route.js:132:48)
    at module.exports.internals.Manager.execute (C:\Users\ratonbox\Desktop\kibana-6.6.0-windows-x86_64\node_modules\hapi\lib\toolkit.js:35:106)
    at Object.internals.handler (C:\Users\ratonbox\Desktop\kibana-6.6.0-windows-x86_64\node_modules\hapi\lib\handler.js:50:48)
    at exports.execute (C:\Users\ratonbox\Desktop\kibana-6.6.0-windows-x86_64\node_modules\hapi\lib\handler.js:35:36)
    at process._tickCallback (internal/process/next_tick.js:68:7)

@LeeDr
Copy link
Author

LeeDr commented Jan 23, 2019

Marius used Unicode Character “ș” (U+0219)
which did crash Kibana.

Extended ASCII (8-bit up to FF) doesn't crash it. Example: Çüéâ...Ü

@LeeDr LeeDr added the v6.6.1 label Jan 23, 2019
@LeeDr
Copy link
Author

LeeDr commented Jan 23, 2019

When fixed, this obviously needs an automated test added.

@spalger
Copy link
Contributor

spalger commented Jan 23, 2019

Fix in the client: elastic/elasticsearch-js#756

@LeeDr LeeDr added v6.6.0 and removed v6.6.1 labels Jan 23, 2019
@spalger
Copy link
Contributor

spalger commented Jan 23, 2019

Fix for Kibana #29210

spalger pushed a commit to spalger/kibana that referenced this issue Jan 24, 2019
…astic#29210)

Fixes elastic#29194

In node 10, urls are validated to not include any multi-byte characters, which wouldn't be possible if we were always encoding variables injected into URLs but we missed a couple places.
spalger pushed a commit that referenced this issue Jan 24, 2019
…9210)

Fixes #29194

In node 10, urls are validated to not include any multi-byte characters, which wouldn't be possible if we were always encoding variables injected into URLs but we missed a couple places.
spalger pushed a commit that referenced this issue Jan 24, 2019
…9210) (#29236)

Fixes #29194

In node 10, urls are validated to not include any multi-byte characters, which wouldn't be possible if we were always encoding variables injected into URLs but we missed a couple places.
spalger pushed a commit to spalger/kibana that referenced this issue Jan 24, 2019
…astic#29210)

Fixes elastic#29194

In node 10, urls are validated to not include any multi-byte characters, which wouldn't be possible if we were always encoding variables injected into URLs but we missed a couple places.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Fixes for quality problems that affect the customer experience regression Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.6.0
Projects
None yet
Development

No branches or pull requests

4 participants