-1

I am running ruby "3.1.1", rails (7.0.3.1), fog-aws (3.14.0), fog-core (2.3.0) and I start puma using systemd. Requests come in through AWS ALB 443 -> 80.

Since implementing the fog-aws Gem my puma_access.log just keeps writing: [31723] ! Unable to start worker [31723] /var/www/iot/shared/bundle/ruby/3.1.0/gems/fog-core-2.3.0/lib/fog/core/cache.rb:94:in `expand_path' [31723] Early termination of worker

and any requests just 504 Gateway time-out. Running puma outside of systemctl seems to work ok.

/var/www/iot/shared/bundle/ruby/3.1.0/gems/fog-core-2.3.0/lib/fog/core/cache.rb:94 is:

SANDBOX = ENV["HOME"] ? File.expand_path("~/.fog-cache") : File.expand_path(".fog-cache")

Although I am not sure why that is relevant, ENV["HOME"] = "/home/ec2-user"

Please help!

Ruby Dev
  • 63
  • 6
  • Server: NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/" – Ruby Dev Jul 23 '22 at 22:04
  • how is this not about programming? This is a Ruby on Rails app having issues with puma. – Ruby Dev Jul 25 '22 at 09:44
  • Do not place answers to your question here in the comment section. Create an answer and mark it as the solution. – Rob Jul 27 '22 at 11:14
  • Apologies @Rob have altered. – Ruby Dev Jul 29 '22 at 08:02

1 Answers1

0

I managed to resolve the issue by setting env["HOME"] in my systemd process, but unsure why this helped.

Ruby Dev
  • 63
  • 6