2

I'm using GCloud version 0.18.0. On my dev PC, I actually download very well file on Google Storage. But once the script is running on a Google Compute Engine, the download start and says it's complete but it's not. It's a log file so when I'm checking the downloaded log file, I see it's not completed. The beginning of the file is there.

I made so much search and no body looks like to have my problem.

var gcloud = require('gcloud')({projectId: project_id});
var bucket = google.storage.bucket('logs');

var log_one = {filename: 'test.log'};
bucket.file(log_one.filename).download({destination: './tmp/processing_' + log_one.filename}, function(err) {
  if (err.code == 403 || err.code == 404 || err.message) {
    console.log(err);
    console.log("Error after bucket.file.download");
    return;
  }

  console.log("Downloaded file " + log_one.filename + " completed");
  // Do stuff on the log file <-- Which is here the file is incomplete on GCE
});

The instance can talk with all Google API and anyway, it downloads a part of the log file.

I also tried to put a timer to give time to finish to write the file or something like that. No success. I'm never asking for help on forum, because I'm always finding a solution. But this one, I need help.

Brandon Yarbrough
  • 37,021
  • 23
  • 116
  • 145
  • I probably downloaded the Gcloud node module at the beginning of my project. I just made a complete update of all modules and it's still not working. – Eric Grenier Nov 16 '15 at 01:21

1 Answers1

1

Since 0.18.0, we've run into a few issues related to streams & complete events. Upgrading to the latest version, 0.24.1, will likely magically resolve the issue.

Stephen
  • 5,710
  • 1
  • 24
  • 32
  • Thanks for testing! Can you open a bug on our repo? We should be able to get the right eyes on the problem easier over there. https://github.com/googlecloudplatform/gcloud-node/issues/new – Stephen Nov 16 '15 at 01:55