elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.63k stars 8.22k forks source link

Server fails to start if basePath is set to an empty string #52087

Closed tehmoon closed 4 months ago

tehmoon commented 4 years ago

Kibana version: 7.5.0

Elasticsearch version: 7.5.0

Server OS version: ubuntu 16.4

Browser version: not a browser bug

Browser OS version: not a browser bug

Original install method (e.g. download page, yum, from source, etc.): tarball from the website then extract

Describe the bug: It looks like there is a path variable that is empty and blocks the startup process of kibana. See the error log below.

Steps to reproduce:

  1. Install kibana 7.2.0
  2. Upgrade to 7.5.0
  3. Run from command line: sudo -u elastic_kibana ./bin/kibana -c <config_file> --verbose

Expected behavior: kibana starts correctly

Screenshots (if relevant): N/A

Errors in browser console (if relevant): N/A

Provide logs and/or server output (if relevant):

  log   [16:31:16.794] [fatal][root] { ValidationError: child "path" fails because ["path" is not allowed to be empty]
    at Object.exports.process (/preveil/elastic_kibana/src/kibana-7.5.0-linux-x86_64/node_modules/joi/lib/errors.js:196:19)
    at internals.Object._validateWithOptions (/preveil/elastic_kibana/src/kibana-7.5.0-linux-x86_64/node_modules/joi/lib/types/any/index.js:675:31)
    at module.exports.internals.Any.root.validate (/preveil/elastic_kibana/src/kibana-7.5.0-linux-x86_64/node_modules/joi/lib/index.js:146:23)
    at Object.internals.implementation [as cookie] (/preveil/elastic_kibana/src/kibana-7.5.0-linux-x86_64/node_modules/hapi-auth-cookie/lib/index.js:94:25)
    at module.exports.internals.Auth._strategy (/preveil/elastic_kibana/src/kibana-7.5.0-linux-x86_64/node_modules/hapi/lib/auth.js:52:47)
    at createCookieSessionStorageFactory (/preveil/elastic_kibana/src/kibana-7.5.0-linux-x86_64/src/core/server/http/cookie_session_storage.js:86:15)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  isJoi: true,
  name: 'ValidationError',
  details:
   [ { message: '"path" is not allowed to be empty',
       path: [Array],
       type: 'any.empty',
context: [Object] } ],
_object:
{ cookie: 'sid',
password: 'xxx',
validateFunc: [AsyncFunction: validateFunc],
isSecure: false,
path: '',
clearInvalid: true,
isHttpOnly: true,
isSameSite: false },
annotate: [Function] }
log   [16:31:16.799] [debug][server] stopping server
log   [16:31:16.800] [debug][legacy-service] stopping legacy service
log   [16:31:16.800] [debug][plugins-service] Stopping plugins service
log   [16:31:16.801] [debug][elasticsearch-service] Stopping elasticsearch service 

Any additional context:

tehmoon commented 4 years ago

From the stack trace, it looks like path: basePath, which is set to '' in my config, is the culprit.

Removing server.basePath made it work. I'll leave the ticket open in case you guys need to do anything.

elasticmachine commented 4 years ago

Pinging @elastic/kibana-operations (Team:Operations)

elasticmachine commented 4 years ago

Pinging @elastic/kibana-platform (Team:Platform)

pgayvallet commented 4 months ago

There has been a more explicit error message about the problem for a long time now

https://github.com/elastic/kibana/blob/dea26c64505c2d498000d93778d6051407a8b0d8/packages/core/http/core-http-server-internal/src/http_config.ts#L66-L70

Closing.