jeudi 3 septembre 2015

Sidekiq process on Elastic Beanstalk - Errno::ENOENT: No such file or directory - getcwd

We're using rest-client to send external API requests on Sidekiq workers that spin up as a process on our Elastic Beanstalk-managed EC2 instances.

Under the hood rest-client uses netrc, and netrc calls Dir.pwd when Dir.home fails. We are seeing this error sporadically:

Errno::ENOENT: No such file or directory - getcwd
[GEM_ROOT]/gems/netrc-0.10.3/lib/netrc.rb:26 :in `pwd`

Which indicates that ENV['HOME'] is not set, and apparently the current directory no longer exists. Generally HOME is set already on EB instances, and we've attempted to set it via eb setenv just to be sure.

The question is how this situation might arise on EB and how we can avoid it in the future. I hesitate to speculate but perhaps we are not killing Sidekiq processes correctly between deployments and old sidekiq processes survive, referencing old directories? I'm not terribly familiar with EB yet; any guidance would be much appreciated.




Aucun commentaire:

Enregistrer un commentaire