Error: EROFS: read-only file system, open optimize/.babelcache.json

I have Kibana 6.0.0 installed on a shared read-only file system and looks like kibana does not like this and refuses to start up due to the below error:

  return, stringToFlags(flags), mode);

Error: EROFS: read-only file system, open 'path/kibana/6.0.0-build001/common/optimize/.babelcache.json'
    at Error (native)
    at Object.fs.openSync (fs.js:642:18)
    at Object.fs.writeFileSync (fs.js:1348:33)
    at save (path/kibana/6.0.0-build001/common/node_modules/babel-register/lib/cache.js:45:16)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3

Is this a known issue and is there a way to work around this?

1 Like

Hi there, Kibana currently requires the ability to write to the file system.


Thanks CJ for your reply

There is a way to work around this, which is to:


(And in kibana.yml setting logging.dest, and pid.file to custom paths that are writable.)

Would you recommend this? Besides the effect of a slower start up time, are there any other side effects of when babel cache is disabled?

I checked with some of the other other engineers, and the general consensus is that this sounds like something worth trying out, but we haven't tried it ourselves nor do we actively test this scenario so you'll be in uncharted territory. You're welcome to try it out, and we'd love to hear how it goes, but we don't know if you'll run into problems. :slight_smile:


Then I will make it my mission to find out and report back :smile: - thanks for checking CJ.

So looks like the method above works and Kibana starts up fine for only Kibana 5.6.x and maybe earlier versions.

However, for 6.0.x, although the above does get me through the babel error, a subsequent error is thrown:

{"type":"error","@timestamp":"2017-12-13T11:26:25Z","tags":["fatal"],"pid":8950,"level":"fatal","error":{"message":"EROFS: read-only file system, open '/path/optimize/bundles/graph.entry.js'","name":"Error","stack":"Error: EROFS: read-only file system, open '/path/optimize/bundles/graph.entry.js'\n at Error (native)","code":"EROFS"},"message":"EROFS: read-only file system, open '/path/optimize/bundles/graph.entry.js'"}

We bumped into this as well.

We use the official RPMs and notice that Kibana wants to write to /usr/share/kibana. This messes up our security measures because we follow the recommendations of FHS and Red Hat in assuming that /usr is read-only:

@cjcenizal Wouldn't it more obvious to write to /var/lib/kibana or /opt/kibana, for example?

Thank you for bringing this up, Jacco. You're right, we shouldn't write to /usr. We've added this change to our roadmap and we'll get to it ASAP.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.