Skip to content

storage upload use /temp/ instead of /home/? #1235

Closed

Description

I'm on aws lambda trying to upload a file to gcs.
This line of code to upload a file:

var bucket = gcs.bucket('biweekly.hylight.tv');
bucket.upload(tmpobj.name, {
        destination : uuidName + '.mp4',
        metadata : {
            contentType : 'video/mp4',
            name : uuidName + '.mp4'
        }
    });

Results in:

Error: EROFS: read-only file system, mkdir '/home/sbx_user1053

at Error (native)
    at Object.fs.mkdirSync (fs.js:794:18)
    at sync (/var/task/node_modules/gcloud/node_modules/gcs-resumable-upload/node_modules/configstore/node_modules/mkdirp/index.js:71:13)
    at sync (/var/task/node_modules/gcloud/node_modules/gcs-resumable-upload/node_modules/configstore/node_modules/mkdirp/index.js:77:24)
    at Function.sync (/var/task/node_modules/gcloud/node_modules/gcs-resumable-upload/node_modules/configstore/node_modules/mkdirp/index.js:77:24)
    at Object.create.all.get (/var/task/node_modules/gcloud/node_modules/gcs-resumable-upload/node_modules/configstore/index.js:38:13)
    at Object.Configstore (/var/task/node_modules/gcloud/node_modules/gcs-resumable-upload/node_modules/configstore/index.js:27:44)
    at new Upload (/var/task/node_modules/gcloud/node_modules/gcs-resumable-upload/index.js:48:22)
    at Upload (/var/task/node_modules/gcloud/node_modules/gcs-resumable-upload/index.js:26:41)
    at File.startResumableUpload_ (/var/task/node_modules/gcloud/lib/storage/file.js:1443:22)

So this is solved by setting resumable to false, which is great, but I was wondering if it was possible to change the cache(I assume it's cache) directory to something else like temp?

Activity

  1. stephenplusplus commented on Apr 15, 2016

    @stephenplusplus
    Contributor

    You can change the directory with an env var XDG_CONFIG_HOME (see #1051). Please re-open if this doesn't work.

  2. added
    type: questionRequest for information or clarification. Not an issue.
    api: storageIssues related to the Cloud Storage API.
    on Apr 15, 2016
  3. added a commit that references this issue on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions