lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
MIT License
307 stars 130 forks source link

File permissions issue in peddler 2.4.2 #152

Closed heythisisnate closed 4 years ago

heythisisnate commented 4 years ago

My application was unable to load peddler 2.4.2 and I tracked it down to a file permissions issue. The ruby files in the distributed gem do not have read permission for non-owner. This is problematic on environments where gems are not owned by the same system user as the running application, making it impossible for the application to load the files.

The file permissions in this github repo appear to be fine. It's the gem recently uploaded to rubygems.org that is problematic. Maybe something went wrong in the gem build process?

You can verify the problem from downloading peddler-2.4.2.gem from Rubygems, and extracting it with tar -xvf peddler-2.4.2 then extract data.tar.gz with tar -zxvf data.tar.gz. List the resulting data/lib directory:

> ls -la
total 16
drwxr-xr-x   6 nate  staff  192 Aug  6 21:37 .
drwxr-xr-x   8 nate  staff  256 Aug  6 21:37 ..
drwxr-xr-x  31 nate  staff  992 Aug  6 21:37 mws
-rw-------   1 nate  staff  747 Aug  4 07:51 mws.rb
drwxr-xr-x  14 nate  staff  448 Aug  6 21:37 peddler
-rw-------   1 nate  staff   45 Aug  4 07:51 peddler.rb

Notice that the ruby files do not have group or public read permissions.

This problem does not exist in peddler 2.4.1:

> ls -la
total 16
drwxr-xr-x   6 nate  staff  192 Aug  6 21:38 .
drwxr-xr-x   8 nate  staff  256 Aug  6 21:38 ..
drwxr-xr-x  31 nate  staff  992 Aug  6 21:38 mws
-rw-r--r--   1 nate  staff  747 May  5 14:02 mws.rb
drwxr-xr-x  14 nate  staff  448 Aug  6 21:38 peddler
-rw-r--r--   1 nate  staff   45 May  5 14:02 peddler.rb
hakanensari commented 4 years ago

@heythisisnate thanks for reporting this. I inadvertently messed up file permissions in my code folder when trying to cloud sync it. It should all be fixed now.

heythisisnate commented 4 years ago

Thank you for the quick fix!

And thanks for the great library. It took me less than an hour to set up a bot to pull inventory data from my Amazon seller account ...

... then most of the following day trying to figure out why it wasn't working on production 😆

All good now. Cheers. 🍻