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

**URL:** <https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830>\
**Category:** Kibana\
**Created:** [December 8, 2017, 11:11am UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830 "2017-12-08T11:11:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [December 8, 2017, 11:11am UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/1 "2017-12-08T11:11:40Z")

</div>

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:

```
fs.js:642
  return binding.open(pathModule._makeLong(path), 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?

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [December 8, 2017, 6:53pm UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/2 "2017-12-08T18:53:09Z")

</div>

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

Thanks,  
CJ

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [December 11, 2017, 3:30pm UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/3 "2017-12-11T15:30:36Z")

</div>

Thanks CJ for your reply

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

export BABEL\_DISABLE\_CACHE=1

(And in kibana.yml setting logging.dest, path.data 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?

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [December 11, 2017, 8:07pm UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/4 "2017-12-11T20:07:00Z")

</div>

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. 🙂

CJ

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [December 12, 2017, 10:16am UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/5 "2017-12-12T10:16:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [December 13, 2017, 11:40am UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/6 "2017-12-13T11:40:58Z")

</div>

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'"}`

---

<div class="post-metadata">

**Author:** ![Jacco](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@Jacco](https://discuss.elastic.co/u/Jacco)\
**Post date:** [January 2, 2018, 2:31pm UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/7 "2018-01-02T14:31:32Z")

</div>

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:

[https://refspecs.linuxfoundation.org/FHS\_3.0/fhs/ch04s11.html](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html)  
[https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/7/html/storage\_administration\_guide/ch-filesystem#s1-filesystem-fhs](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-filesystem#s1-filesystem-fhs)

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

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [January 8, 2018, 5:05pm UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/8 "2018-01-08T17:05:51Z")

</div>

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.

CJ

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 5, 2018, 5:05pm UTC](https://discuss.elastic.co/t/error-erofs-read-only-file-system-open-optimize-babelcache-json/110830/9 "2018-02-05T17:05:55Z")

</div>

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