kibana icon indicating copy to clipboard operation
kibana copied to clipboard

Kibana container stopped working after upgrading to 4.2.1 from 4.2.0

Open vmendi opened this issue 11 years ago • 11 comments

docker logs shows only this:

fs.js:565
fs.write = function(fd, buffer, offset, length, position, callback) {
                                                 ^
Error: EACCES, permission denied '/opt/kibana/optimize/.babelcache.json'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)
    at Object.fs.writeFileSync (fs.js:1099:15)
    at save (/opt/kibana/node_modules/babel-core/lib/api/register/cache.js:35:19)
    at process._tickDomainCallback (node.js:381:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3

vmendi avatar Nov 18 '15 05:11 vmendi

Oh that's strange -- can you provide the docker run arguments you used to start the container so we can try and reproduce? Are you using any volumes?

tianon avatar Nov 19 '15 00:11 tianon

I saw this as well. It only happens after I've installed a plugin like Marvel or Sense. I saw that .babelcache.json had 644 permissions. I added RUN chmod o+w /opt/kibana/optimize/.babelcache.json and it works fine.

Deseao avatar Nov 19 '15 23:11 Deseao

ditto; I ran into the same issue. I have a custom image that only has RUN kibana plugin -i elasticsearch/marvel/latest

If I use my custom image it fails with the same error as noted above, but if I use the official kibana image, it works.

Dockerfile

FROM kibana:4

# 2.0 plugin structure
RUN kibana plugin -i elasticsearch/marvel/latest

This works, but fails if I use the image created with the above dockerfile.

docker run \
  --rm \
  -p 5601:5601 \
  -e "ELASTICSEARCH_URL=http://logging.elasticsearch.service.consul:9200" \
  kibana

skippy avatar Dec 04 '15 16:12 skippy

ah, I see the issue. In the Kibana dockerfile it runs this: RUN chown -R kibana:kibana /opt/kibana

it looks like when I run kibana plugin -i elasticsearch/marvel/latest it is installing it as root and not under the uid:gid `kibana:kibana. Adding

RUN chown -R kibana:kibana /opt/kibana

as the last line in my dockerfile fixes the issues. Is there a way for kibana plugin to respect the uid:gid of the folder it is installing into?

skippy avatar Dec 04 '15 16:12 skippy

I think your best bet is probably to just use gosu like the entrypoint itself does, ie:

FROM kibana:4
RUN gosu kibana kibana plugin -i elasticsearch/marvel/latest

tianon avatar Dec 07 '15 18:12 tianon

Any ideas what to do if I tried all the suggestions in this thread?

mastoj avatar Feb 29 '16 22:02 mastoj

Thank you @tianon. I am using gosu and all is nice and dandy again.

reikani avatar Mar 02 '16 17:03 reikani

Using gosu didn't work for me, but changing to the user kibana and back to root again worked for me, using one of the solutions in https://github.com/spujadas/elk-docker/issues/34#issuecomment-214701418

My Dockerfile ended up looking like:

FROM kibana:4.5

USER kibana
RUN kibana plugin --install elastic/sense
USER root

I'll leave this here in case it helps someone else.

tiangolo avatar Jun 20 '16 00:06 tiangolo

I'm hitting this same kind of error after upgrading from 5.0 rc to 5.0 rtm. I checked all the file permissions on windows.

C:\kibana-5.0\bin>kibana.bat
fs.js:640
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EPERM: operation not permitted, open 'C:\kibana-5.0\optimize\.babelcache.json'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.writeFileSync (fs.js:1333:33)
    at save (C:\kibana-5.0\node_modules\babel-core\lib\api\register\cache.js:35:19)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

niemyjski avatar Oct 31 '16 15:10 niemyjski

@niemyjski is this still an issue with one of the latest supported versions?

Supported tags and respective Dockerfile links

5.1.1, 5.1, 5, latest (5/Dockerfile) 4.6.3, 4.6, 4 (4.6/Dockerfile)

mi-hol avatar Dec 14 '16 20:12 mi-hol

This image is officially deprecated in favor of upstream's images (see https://www.elastic.co/guide/en/kibana/current/_pulling_the_image.html).

For more information, please see docker-library/elasticsearch#160, docker-library/docs#842, and docker-library/docs#945.

This image has been deprecated in favor of the official kibana image provided and maintained by elastic.co. The upstream images are available to pull via docker.elastic.co/kibana/kibana:[version] like 5.4.2. The images found here will receive no further updates once the 5.6.0 release is available upstream. Please adjust your usage accordingly.

Elastic provides open-source support for Kibana via the elastic/kibana GitHub repository and the Docker image via the elastic/kibana-docker GitHub repository, as well as community support via its forums.

Thanks!

tianon avatar Oct 04 '17 17:10 tianon