Repository navigation
Can't add files with names which contain "/" and "." and "~" in object name #1340
Description
Activity
I couldn't reproduce with the following script:
'use strict' var gcloud = require('gcloud') var gcs = gcloud.storage() var bucket = gcs.bucket(process.env.BUCKET) var file = bucket.file('type~user/user.00000000-0000-0000-0000-000000000000') file.save('test', console.log)
Is there any chance the error is coming from a separate call? Maybe in a
beforehook?- addedapi: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on May 25, 2016 I'm sure that problem in test (not in before). I have the same problem also in node
"use strict"; var config = require('config'); var gcloud = require('gcloud'); var gcs = gcloud.storage({ keyFilename: config.gcloud.keyFilename, projectId: config.gcloud.projectId }); var myBucket = gcs.bucket(config.buckets.serviceTags.name); var file = myBucket.file('type~user/user.00000000-0000-0000-0000-000000000000'); file.save('some text', {metadata: {contentType: 'text/plain' }}, function (err) { if (err) {throw err; } });
returns
Error: Not Found at Request._callback (/home/gr1g0ry/_prj/_gmap/_code/node_gcs/demo/node_modules/gcloud/node_modules/gcs-resumable-upload/index.js:257:25) at Request.self.callback (/home/gr1g0ry/_prj/_gmap/_code/node_gcs/demo/node_modules/gcloud/node_modules/request/request.js:200:22) at Request.emit (events.js:110:17) at Request.<anonymous> (/home/gr1g0ry/_prj/_gmap/_code/node_gcs/demo/node_modules/gcloud/node_modules/request/request.js:1067:10) at Request.emit (events.js:129:20) at IncomingMessage.<anonymous> (/home/gr1g0ry/_prj/_gmap/_code/node_gcs/demo/node_modules/gcloud/node_modules/request/request.js:988:12) at IncomingMessage.emit (events.js:129:20) at _stream_readable.js:908:16 at process._tickCallback (node.js:355:11)I can reproduce when the bucket doesn't exist. Could you check that the bucket exists?
bucket.exists(console.log)
Yes bucket exists. For reproducing you need some of your bucket and correspondent key.json file.
I'm sure that problem in name because next code is successful:"use strict"; var config = require('config'); var gcloud = require('gcloud'); var gcs = gcloud.storage({ keyFilename: config.gcloud.keyFilename, projectId: config.gcloud.projectId }); var myBucket = gcs.bucket(config.buckets.serviceTags.name); var file = myBucket.file('nice/name'); file.save('some text', {metadata: {contentType: 'text/plain' }}, function (err) { if (err) {throw err; } });
The difference between them only in filename
What OS are you running?
Ubuntu 14.04
Can you try:
file.save('test', { resumable: false, metadata: { contentType: 'text/plain' } }, console.log)
Ok. The problem was solved. Thanks.
Should I close issue?
Glad it was resolved. Let's keep it open for a little longer. I want to dig into this later to figure out exactly what might have happened.
Ok.
I think I've found a resolution. That was an error from
gcs-resumable-upload, the module we use to handle resumable file uploads. In the beginning part of trying to resume an upload, it asks the server how much data it already has, so it knows at what point in the file it should start sending data from. The response to that was a 404, because of a caching issue. To track state, that module stores a piece of data in a config file. The file you were uploading must have been uploaded previously, and either it failed or it was improperly cleaned up after the file was uploaded.The fix I just released will automatically recognize that scenario (caching error), erase the old entry from the cache, and start a new resumable upload.
Thanks for catching this, it will hopefully save a lot of confusion for users going forward!
- added a commit that references this issue
on Jul 23, 2025 - added a commit that references this issue
on Jan 28, 2026 - added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 17, 2026 - added a commit that references this issue
on Mar 11, 2026 - added a commit that references this issue
on Mar 18, 2026
When I use object names with dot, slash and tilde together I receive error.
Next is mocha test:
returns error: