Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `create_file' for nil:NilClass #1

Open
Yanson opened this issue Nov 12, 2015 · 2 comments
Open

undefined method `create_file' for nil:NilClass #1

Yanson opened this issue Nov 12, 2015 · 2 comments
Assignees
Labels

Comments

@Yanson
Copy link

Yanson commented Nov 12, 2015

I've seen this error, but only in one case. It looks like it's calling write before setup.

I tried adding @gs_bucket = initialize_bucket unless @gs_bucket before the write but it didn't help. I don't get the error, but it doesn't write the file, timeout or error in another way.

I am writing to a bucket in the US and only experience this issue from europe-west1. It works fine from my instances in us-central1 and AWS us-east-1.

All the instances are setup with puppet so I doubt there is any environmental differences.

Any ideas?

@trekdemo
Copy link

I only had this error when I used a non-existing bucket name.
I'm working on a guard method which checks the specified bucket in configuration time. You can expect it in a few days.

Until then just double check if you can reach your bucket from the mentioned server.

Here's a quick gist to check it:

require "gcloud"
Gcloud
  .new("<project-name>", "<path-to-key-file>")
  .storage
  .bucket("<name-of-your-bucket>")

@ghost ghost added the bug label Nov 13, 2015
@ghost ghost assigned trekdemo Nov 13, 2015
@Yanson
Copy link
Author

Yanson commented Nov 13, 2015

Thanks for your help. The gist worked fine.

I've diagnosed this to be due to using 512MB buffers. If I split an existing buffer into smaller chunks, the files uploaded without a problem.

The only difference with my European instances was that they were smaller and had 1.8GB RAM. I've upgraded them to instances with more RAM and 512MB buffers work fine again.

I'm assuming there is an issue in the Google Cloud client that causes the create_file operation to hang at a point before the timeout (which seems to be 120s by default, on a separate note maybe you could make that configurable).

I don't think you can do anything about this, but we can leave this ticket open as you have identified the cause of the error message as a genuine bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants