Writable directories

unsupported-install

(Thomas Dutrion) #1

Hi!

I know this use case is not supported, but even though I am currently trying to install on platform.sh, I am running into a read-only filesystem exception (trying to create a folder apparently).

E, [2017-10-10T20:50:57.085606 #1442] ERROR -- : Read-only file system @ dir_s_mkdir - tmp (Errno::EROFS)
/opt/ruby/2.4/lib/ruby/2.4.0/fileutils.rb:229:in `mkdir'
/opt/ruby/2.4/lib/ruby/2.4.0/fileutils.rb:229:in `fu_mkdir'
/opt/ruby/2.4/lib/ruby/2.4.0/fileutils.rb:207:in `block (2 levels) in mkdir_p'
/opt/ruby/2.4/lib/ruby/2.4.0/fileutils.rb:205:in `reverse_each'
/opt/ruby/2.4/lib/ruby/2.4.0/fileutils.rb:205:in `block in mkdir_p'
/opt/ruby/2.4/lib/ruby/2.4.0/fileutils.rb:191:in `each'
/opt/ruby/2.4/lib/ruby/2.4.0/fileutils.rb:191:in `mkdir_p'

I don’t really know Ruby and have no clue how to debug. Platform.sh indeed has a read-only filesystem (for security purpose), and I have to declare any writable folder as mount point. Unfortunately I couldn’t find a list of writable folders…

Here’s what I could retrieve from different implementations (docker, ansible and so on):

  • ${my_app}/log
  • ${my_app}/tmp
  • ${my_app}/app/log
  • ${my_app}/app/tmp
  • ${my_app}/app/app/public/uploads
  • ${my_app}/app/app/tmp

Not sure about these, or about other I could have missed, still doesn’t work though :frowning:
If you can help me please do!


(Thomas Dutrion) #2

I changed my mount point for the following:

  • ${my_app}/tmp
  • ${my_app}/log
  • ${my_app}/public/plugins

And it seems to be fine.

Currently struggling with the database configuration (from a json string provided by platform.sh), but once this is done and a basic installation works I’ll update the post with more details (uploads folder, specific plugins installed and no override when redeploying…).


(Ori Pekelman) #3

Discourse seems to be doing something a bit evil. It has publc/images under git and it wants it writable… I’ll try to track this down and open a PR.

Other than that discourse seems not to have its configuration in the default rails way (in config/database.yml) but in config/discourse.config (If I understand correctly). So it seems you would want to override it there.

The last thing is a Platform.sh specific thing. “normal environment” variables need to be prefixed by env: so rather than doing platform variable:set RAILS_ENV production you needed platform variable:set env:RAILS_ENV production