When using Rails framework, the ActiveRecord needs to write caches or other files in the root project tmp folder (/workspace/tmp) but it fails with permission denied to write files to that folder. Rails Framework offers no config to change this to another tmp path, and some gem libraries for Rails have this hardcoded also.
Expected Behavior
CNB to write files in (/workspace/tmp)
Current Behavior
Access denied for CNB to write in /workspace/tmp
Example error message: Errno::EACCES · Permission denied @ dir_s_mkdir - /workspace/tmp/1670939080-843440521812643-0007-6864
Possible Solution
Allow writes to /workspace/tmp for CNB User/Rails Framework
Steps to Reproduce
- Setup rails project using https://guides.rubyonrails.org/getting_started.html
- Set default builder
pack config default-builder paketobuildpacks/builder-jammy-full
- Root project we run
pack build rails-paketo-jammy
- Run container
docker run -e RAILS_MASTER_KEY="<master-key>" rails-paketo-jammy (master key value is at ./config/master.key)
- Observe that it fails to run puma with error:
Permission denied @ rb_sysopen - tmp/pids/server.pid
Motivations
We have switched to Jammy because our backend requires a system library version that is not supported in Bionic.
When using Rails framework, the ActiveRecord needs to write caches or other files in the root project tmp folder (/workspace/tmp) but it fails with permission denied to write files to that folder. Rails Framework offers no config to change this to another tmp path, and some gem libraries for Rails have this hardcoded also.
Expected Behavior
CNB to write files in (
/workspace/tmp)Current Behavior
Access denied for CNB to write in
/workspace/tmpExample error message:
Errno::EACCES · Permission denied @ dir_s_mkdir - /workspace/tmp/1670939080-843440521812643-0007-6864Possible Solution
Allow writes to
/workspace/tmpfor CNB User/Rails FrameworkSteps to Reproduce
pack config default-builder paketobuildpacks/builder-jammy-fullpack build rails-paketo-jammydocker run -e RAILS_MASTER_KEY="<master-key>" rails-paketo-jammy(master key value is at ./config/master.key)Permission denied @ rb_sysopen - tmp/pids/server.pidMotivations
We have switched to Jammy because our backend requires a system library version that is not supported in Bionic.