From 4d195d5a526e6d1e38fe1ecb9962ec47e5b44ec8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 12 Jun 2019 10:51:49 +0100 Subject: [PATCH] gcs: Fix upload errors when uploading pre 1970 files Before this change rclone attempted to set the "updated" field in uploaded objects to the modification time. However when this modification time was before 1970, google drive would return the rather cryptic error: googleapi: Error 400: Invalid value for UnsignedLong: -42000, invalid However API docs: https://cloud.google.com/storage/docs/json_api/v1/objects#resource state the "updated" field is read only and tests confirm that. Even though the field is read only, it looks like Google parses it. This change therefore removes the attempt to set the "updated" field (which was doing nothing anyway) and fixes the problem uploading pre 1970 files. See #3196 and https://forum.rclone.org/t/invalid-value-for-unsignedlong-file-missing-date-modified/3466 --- backend/googlecloudstorage/googlecloudstorage.go | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/googlecloudstorage/googlecloudstorage.go b/backend/googlecloudstorage/googlecloudstorage.go index 71269e9d7..7a5482442 100644 --- a/backend/googlecloudstorage/googlecloudstorage.go +++ b/backend/googlecloudstorage/googlecloudstorage.go @@ -1003,7 +1003,6 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOptio Bucket: o.fs.bucket, Name: o.fs.root + o.remote, ContentType: fs.MimeType(src), - Updated: modTime.Format(timeFormatOut), // Doesn't get set Metadata: metadataFromModTime(modTime), } var newObject *storage.Object