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 --version shouldn't produce permission error #13053

Closed
jacobweber opened this issue Jul 23, 2017 · 3 comments
Closed

kibana --version shouldn't produce permission error #13053

jacobweber opened this issue Jul 23, 2017 · 3 comments
Labels
bug Fixes for quality problems that affect the customer experience Team:Operations Team label for Operations Team

Comments

@jacobweber
Copy link

jacobweber commented Jul 23, 2017

Kibana version: 5.2.0, 5.4.0

Elasticsearch version: 5.2.0, 5.4.0

Server OS version: CentOS 6.9

Browser version: N/A

Browser OS version: N/A

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

Description of the problem including expected versus actual behavior:
When I run kibana --version as a user other than kibana, I get a "permission denied" message. Very minor, but confusing.

Steps to reproduce:

  1. Install kibana via yum.
  2. Install x-pack as kibana user: sudo -u kibana bin/kibana-plugin install x-pack
  3. Run /usr/share/kibana/bin/kibana --version as a user other than root or kibana.

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

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

5.4.0
fs.js:641
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/usr/share/kibana/optimize/.babelcache.json'
    at Error (native)
    at Object.fs.openSync (fs.js:641:18)
    at Object.fs.writeFileSync (fs.js:1347:33)
    at process.save (/usr/share/kibana/node_modules/babel-register/lib/cache.js:45:16)
    at emitOne (events.js:96:13)
    at process.emit (events.js:188:7)
    at process.exit (internal/process.js:164:15)
    at Command.<anonymous> (/usr/share/kibana/node_modules/commander/index.js:820:13)
    at emitNone (events.js:91:20)
    at Command.emit (events.js:185:7)

If I run sudo -u kibana /usr/share/kibana/bin/kibana --version, I don't get this error.

The permissions on the directory seem correct:

$ ls -al /usr/share/kibana/optimize/
total 2660
drwxr-xr-x  3 kibana kibana    4096 May 31 13:31 .
drwxr-xr-x 10 root   root      4096 May 31 13:31 ..
-rw-rw-r--  1 kibana kibana 2707748 Jul 22 21:44 .babelcache.json
drwxr-xr-x  3 kibana kibana    4096 May 31 13:34 bundles

although I ran sudo chown -R kibana:kibana /usr/share/kibana/optimize/ just to be sure.

Related to #8818 and other issues. But I think I'm doing things the way the documentation recommends. And I'm not having errors in Kibana itself.

@jbudz jbudz added the Team:Operations Team label for Operations Team label Jul 25, 2017
@jbudz
Copy link
Member

jbudz commented Jul 25, 2017

All the server code is ran through babel, which unfortunately writes to a file owned by the kibana user. This does look like a bug.

A workaround until this is fixed can be something like
apt-cahe policy kibana

@jbudz jbudz added the bug Fixes for quality problems that affect the customer experience label Jul 25, 2017
@ghost
Copy link

ghost commented Jul 26, 2017

chown -R kibana:kibana /opt/kibana/optimize/bundles
chmod g+s /opt/kibana/optimize/bundles

@jbudz
Copy link
Member

jbudz commented Nov 3, 2020

babel/register was removed starting in 7.10 with #79379 so babel writes should no longer be a source of permission errors. +1 on the comment above as a workaround in the interim. Closing this out

@jbudz jbudz closed this as completed Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

2 participants