Nodejs-storage: Resumable upload not possible with cloud functions

Created on 11 Aug 2019  路  15Comments  路  Source: googleapis/nodejs-storage

Blocked


Should be possible to set resumable upload dir from config. Currently fails with node10 cloud function as only /tmp is writable

Environment details

  • OS:
  • Node.js version: node10 cloud-function
  • npm version:
  • @google-cloud/storage version: 3.0.3

Steps to reproduce

  1. deploy nodejs cloud function
  2. try to upload large file from /tmp
  3. A resumable upload could not be performed. The directory, /root/.config, is not writable. You may try another upload, this time setting options.resumable to false

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

storage p2 blocked bug

Most helpful comment

It appears this issue still exists. I am seeing the same issue with:

  • @google-cloud/storage: 4.3.0
  • node: 10

Adding resumable: false to my config did fix the problem.

All 15 comments

You should be able to set an option, configPath, which will override where that file gets written to. Can you give that a shot and let me know how it goes?

This issue has been resolve upstream in gcs-resumable-upload. New installations of @google-cloud/storage will pick this up. Let us know if there are still any issues!

Hi, just to let you know that I have this issue using @google-cloud/storage 4.0.0 and google cloud functions nodejs version 8.

Upload works if upload from /tmp/big_file has options: {resumable: false} but not with options: {resumable: true}.

My full options list is:

let options = {resumable: false, metadata: {gzip: true, cacheControl: "public, max-age=31536000"}};

@SinanGabel you should set an option, configPath that points to a writable directory:

let options = {
  configPath: '/path/to/writable/directory',
  metadata: {
    gzip: true,
    cacheControl: "public, max-age=31536000"
  }
};

It appears this issue still exists. I am seeing the same issue with:

  • @google-cloud/storage: 4.3.0
  • node: 10

Adding resumable: false to my config did fix the problem.

I have same issue
@stephenplusplus why can't it write to /tmp? as I'm able to write my file to /tmp, I don't know other writeable directory on cloud function.
According to cloud function /tmp is the only writeable directory https://cloud.google.com/functions/docs/concepts/exec#file_system

I'm also having this problem. What other directory than /temp can be set in configPath?

I'm having this issue with 4.7.0 also. The error im getting is

ResumableUploadError: A resumable upload could not be performed. The directory, /root/.config,
is not writable. You may try another upload, this time setting `options.resumable` to `false`.

I am able to write files to this location when I download them

Yeah, I'm having this issue all the time as well.

I am facing this issue.

I'm having this issue as well. Tried the configPath option with /tmp but that didn't help. The only way I can find to get my uploads to not fail is to set resumable = false. @stephenplusplus

Could you create a new issue with code and full environment and error details? Thanks!

Setting the configPath works, but you need to make sure that it points to a file, not a directory.
This works for me.

const options = {
  configPath: `${writableDirectory}/.config`,
  resumable: true
}

Setting the configPath works, but you need to make sure that it points to a file, not a directory.
This works for me.

const options = {
  configPath: `${writableDirectory}/.config`,
  resumable: true
}

Please send me details. I have some error to change the path

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukesneeringer picture lukesneeringer  路  4Comments

abutreca picture abutreca  路  3Comments

atn picture atn  路  6Comments

Steven4294 picture Steven4294  路  7Comments

dfrankes picture dfrankes  路  3Comments