{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/876","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/876/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/876/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/876/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/876","id":107457068,"number":876,"title":"server stops on large files","user":{"login":"stellanhaglund","id":2523054,"avatar_url":"https://avatars.githubusercontent.com/u/2523054?v=3","gravatar_id":"","url":"https://api.github.com/users/stellanhaglund","html_url":"https://github.com/stellanhaglund","followers_url":"https://api.github.com/users/stellanhaglund/followers","following_url":"https://api.github.com/users/stellanhaglund/following{/other_user}","gists_url":"https://api.github.com/users/stellanhaglund/gists{/gist_id}","starred_url":"https://api.github.com/users/stellanhaglund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stellanhaglund/subscriptions","organizations_url":"https://api.github.com/users/stellanhaglund/orgs","repos_url":"https://api.github.com/users/stellanhaglund/repos","events_url":"https://api.github.com/users/stellanhaglund/events{/privacy}","received_events_url":"https://api.github.com/users/stellanhaglund/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-21T07:17:45Z","updated_at":"2015-09-21T13:23:10Z","closed_at":null,"body":"Hi I have tried both with \r\n\r\napp.get('/file/:imageId', function(req, res){\r\n\r\nvar remoteFile = bucket.file(req.params.imageId);\r\nvar localFilename = 'uploads/' + req.params.imageId;\r\nvar src = remoteFile.createReadStream()\r\n\r\n  src\r\n  .on('error', function(err) {\r\n    console.log(err)\r\n  })\r\n  .on('data', function(data){\r\n\r\n  })\r\n  .on('response', function(response) {\r\n    // console.log(response)\r\n    // Server connected and responded with the specified status and headers.\r\n   })\r\n  .on('end', function() {\r\n    // The file is fully downloaded.\r\n    console.log('fully downloaded');\r\n  })\r\n\r\n  src.pipe(res);\r\n  // .pipe(fs.createWriteStream(localFilename));\r\n  res.attachment(localFilename);\r\n})\r\n\r\nand \r\n\r\nvar remoteFile = bucket.file('large.zip')\r\nremoteFile.createReadStream().pipe(fs.createWriteStream('uploads/test.dmg'))\r\n\r\n\r\nand in  both cases the server seems to stop the file I'm trying with is about 300mb but I also need to be able to handle gb files."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/comments/141974186","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/876#issuecomment-141974186","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/876","id":141974186,"user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars.githubusercontent.com/u/723048?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T13:23:10Z","updated_at":"2015-09-21T13:23:10Z","body":"Interesting. Let's narrow the scope of testing to just this example:\r\n\r\n```js\r\nvar remoteFile = bucket.file('large.zip')\r\nremoteFile.createReadStream().pipe(fs.createWriteStream('uploads/test.dmg'))\r\n```\r\n\r\nFor an error handler, do:\r\n\r\n```js\r\nvar remoteFile = bucket.file('large.zip')\r\nremoteFile.createReadStream()\r\n  .on('error', console.error)\r\n  .pipe(fs.createWriteStream('uploads/test.dmg'))\r\n  .on('error', console.error);\r\n```\r\n\r\nThe server freezing makes me think it's a local issue, but I'm not sure what; out of disk space?\r\n\r\nWe can narrow down the test even more to just \"download a huge file\", as this is all that our read stream does behind the scenes. This next snippet downloads a 1.1GB file. Can you let me know if this finishes successfully?\r\n\r\n```js\r\nvar request = require('request');\r\n\r\nrequest('http://releases.ubuntu.com/15.04/ubuntu-15.04-desktop-amd64.iso')\r\n  .on('error', console.error)\r\n  .pipe(fs.createWriteStream('ubuntu.iso'))\r\n  .on('error', console.error);\r\n```"}}