gax-ruby icon indicating copy to clipboard operation
gax-ruby copied to clipboard

File permissions cause LoadError

Open blowmage opened this issue 9 years ago • 6 comments

Hi, the google-cloud-ruby project has a couple of reports of LoadError when requiring "google/gax". (See GoogleCloudPlatform/google-cloud-ruby#1193 and GoogleCloudPlatform/google-cloud-ruby#1194) The cause for this is that the gems are packaged with files using 640 permissions, where 664 or 644 permissions are expected.

A very common production scenario for Ruby applications is to have a deploy user install the application and all dependent libraries, and an app user account run the application. Because of how the google-gax file permissions are set, it is entirely possible that the app user cannot read the files, and a LoadError is raised.

Here are the permissions for google-gax 0.6.0:

├── [-rw-r-----]  README.md
├── [-rw-r-----]  Rakefile
├── [drwxr-xr-x]  lib
│   └── [drwxr-xr-x]  google
│       ├── [drwxr-xr-x]  gax
│       │   ├── [-rw-r-----]  api_callable.rb
│       │   ├── [-rw-r-----]  bundling.rb
│       │   ├── [-rw-r-----]  errors.rb
│       │   ├── [-rw-r-----]  grpc.rb
│       │   ├── [-rw-r-----]  path_template.rb
│       │   ├── [-rw-r-----]  settings.rb
│       │   └── [-rw-r-----]  version.rb
│       ├── [-rw-r-----]  gax.rb
│       └── [drwxr-xr-x]  longrunning
│           ├── [-rw-r-----]  operations_api.rb
│           └── [-rw-r-----]  operations_client_config.json
└── [drwxr-xr-x]  spec
    ├── [drwxr-xr-x]  google
    │   └── [drwxr-xr-x]  gax
    │       ├── [-rw-r-----]  api_callable_spec.rb
    │       ├── [-rw-r-----]  bundling_spec.rb
    │       ├── [-rw-r-----]  path_template_spec.rb
    │       └── [-rw-r-----]  settings_spec.rb
    └── [-rw-r-----]  spec_helper.rb

7 directories, 17 files

This problem also affects googleapis-common-protos, but I don't see a repo for that gem, so I'm mentioning it here.

blowmage avatar Jan 20 '17 15:01 blowmage

Likely related to #42.

blowmage avatar Jan 20 '17 15:01 blowmage

This problem does not affect any of the google-cloud-* gems, googleauth, google-protobuf, grpc, or grpc-google-iam-v1.

blowmage avatar Jan 20 '17 15:01 blowmage

Here are the file permissions of the latest gem, 0.7.0:

├── [-rw-r--r--]  README.md
├── [-rw-r--r--]  Rakefile
├── [drwxr-xr-x]  lib
│   └── [drwxr-xr-x]  google
│       ├── [drwxr-xr-x]  gax
│       │   ├── [-rw-r--r--]  api_callable.rb
│       │   ├── [-rw-r--r--]  bundling.rb
│       │   ├── [-rw-r--r--]  constants.rb
│       │   ├── [-rw-r--r--]  errors.rb
│       │   ├── [-rw-r--r--]  grpc.rb
│       │   ├── [-rw-r--r--]  operation.rb
│       │   ├── [-rw-r--r--]  path_template.rb
│       │   ├── [-rw-r--r--]  settings.rb
│       │   └── [-rw-r--r--]  version.rb
│       ├── [-rw-r--r--]  gax.rb
│       └── [drwxr-xr-x]  longrunning
│           ├── [-rw-r--r--]  operations_client.rb
│           └── [-rw-r--r--]  operations_client_config.json
└── [drwxr-xr-x]  spec
    ├── [drwxr-xr-x]  google
    │   └── [drwxr-xr-x]  gax
    │       ├── [-rw-r--r--]  api_callable_spec.rb
    │       ├── [-rw-r--r--]  bundling_spec.rb
    │       ├── [-rw-r--r--]  operation_spec.rb
    │       ├── [-rw-r--r--]  path_template_spec.rb
    │       └── [-rw-r--r--]  settings_spec.rb
    └── [-rw-r--r--]  spec_helper.rb

7 directories, 20 files

This looks to be fixed so I will close this issue. We will move to the latest version as soon as we can. Thanks much!

blowmage avatar Feb 10 '17 19:02 blowmage

The googleapis-common-protos gem still has not had a release that fixes the file permissions.

blowmage avatar Feb 11 '17 05:02 blowmage

@swcloud This is the issue created for both google-gax and googleapis-common-protos.

blowmage avatar Feb 13 '17 19:02 blowmage

@landrito

swcloud avatar Feb 16 '17 05:02 swcloud