heroku / platform-api

Ruby HTTP client for the Heroku API
MIT License
214 stars 85 forks source link

Errno::EACCES: Permission denied @ dir_s_mkdir - /home/webapp #39

Closed strika closed 8 years ago

strika commented 8 years ago

I have an application that's using Platform API deployed to AWS EC2. Problem is that I see this exception Errno::EACCES: Permission denied @ dir_s_mkdir - /home/webapp when I try to instantiate Platform API client. The relevant exception happens on this line of code.

I actually think that there are 2 problems here:

  1. Platform API choice of a file cache in the home directory doesn't work in all scenarios.
  2. Although Platform API client allows overriding the cache with an option (PlatformAPI.connect('my-api-key', cache: Moneta.new(:Memory))) the client is written in such a way that it tries to create the file store in the home directory, although it's not going to be used - https://github.com/heroku/platform-api/blob/v0.5.0/lib/platform-api/client.rb#L64. This is actually a problem in Heroics.

I'm not sure what the optimal solution is but I would like to ask you to consider changing one or both of those things. Let me know if you need any further information on this. Thanks!

geemus commented 8 years ago

Thanks for the heads up and detailed report. It seems like the easiest thing to improve here would be 2. ie if you override we should avoid trying to do something with the file that you would no longer need/use. Sounds like that might be in heroics directly though? Would you be up for helping with a PR there? Thanks!

strika commented 8 years ago

I agree that option 2 sounds better. Thanks.

Let me know how I can help.

geemus commented 8 years ago

I think https://github.com/interagent/heroics/pull/72 should do it?

strika commented 8 years ago

Yes, that looks good! I'd be happy to test it once platform-api is regenerated with the new version of Heroics.

geemus commented 8 years ago

Alright, I think it should be fixed on master. Could you confirm? If everything looks good I can try to follow up with a release shortly. Thanks!

strika commented 8 years ago

Unfortunately, this doesn't fix the problem, but this should do it https://github.com/interagent/heroics/pull/73.

geemus commented 8 years ago

Should be bumped/updated again, care to take another peak?

strika commented 8 years ago

@geemus This time it works well. Thanks!

geemus commented 8 years ago

Released as 0.6.0. Thanks!

strika commented 8 years ago

Thank you!