我尝试使用google云端存储桶同步本地文件夹。但是,我从gcloud获得以下异常:
<html>
<head>
<script></script>
<div class="container">
<div class="jumbotron">
<p>Hello I am Dikshit</p>
<ul><li class="">Hello</li>
<li> India</li>
</ul>
</div></div>
</head>
<body>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Hello Lorem popum
<p> Demo text</p>
</body>
</html>
现在有人为此解决了这个问题吗?
堆栈跟踪:
ArgumentException: Object metadata supplied for destination object had no object name.
Windows上使用的版本:
018-04-15T08:30:06.3806055Z - [2 files][ 9.0 MiB/ 16.3 MiB] 69.2 KiB/s
2018-04-15T08:30:06.3806130Z DEBUG: Exception stack trace:
2018-04-15T08:30:06.3806196Z Traceback (most recent call last):
2018-04-15T08:30:06.3806287Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\__main__.py", line 571, in _RunNamedCommandAndHandleExceptions
2018-04-15T08:30:06.3806398Z user_project=user_project)
2018-04-15T08:30:06.3806489Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command_runner.py", line 319, in RunNamedCommand
2018-04-15T08:30:06.3806582Z return_code = command_inst.RunCommand()
2018-04-15T08:30:06.3806672Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\commands\rsync.py", line 1462, in RunCommand
2018-04-15T08:30:06.3806763Z fail_on_error=True, seek_ahead_iterator=seek_ahead_iterator)
2018-04-15T08:30:06.3807079Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command.py", line 1383, in Apply
2018-04-15T08:30:06.3807172Z arg_checker, should_return_results, fail_on_error)
2018-04-15T08:30:06.3807263Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command.py", line 1454, in _SequentialApply
2018-04-15T08:30:06.3807353Z worker_thread.PerformTask(task, self)
2018-04-15T08:30:06.3807449Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command.py", line 2120, in PerformTask
2018-04-15T08:30:06.3807540Z results = task.func(cls, task.args, thread_state=self.thread_gsutil_api)
2018-04-15T08:30:06.3807636Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\commands\rsync.py", line 1252, in _RsyncFunc
2018-04-15T08:30:06.3807736Z gzip_exts=cls.gzip_exts, preserve_posix=cls.preserve_posix_attrs)
2018-04-15T08:30:06.3807835Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 3515, in PerformCopy
2018-04-15T08:30:06.3807922Z allow_splitting=allow_splitting, gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3808025Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 2021, in _UploadFileToObject
2018-04-15T08:30:06.3808115Z parallel_composite_upload, logger)
2018-04-15T08:30:06.3808208Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 1872, in _DelegateUploadFileToObject
2018-04-15T08:30:06.3808308Z elapsed_time, uploaded_object = upload_delegate()
2018-04-15T08:30:06.3808401Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 2004, in CallNonResumableUpload
2018-04-15T08:30:06.3808489Z gzip_encoded=gzip_encoded_file)
2018-04-15T08:30:06.3808591Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\copy_helper.py", line 1583, in _UploadFileToObjectNonResumable
2018-04-15T08:30:06.3808684Z fields=UPLOAD_RETURN_FIELDS, gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3808778Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\cloud_api_delegator.py", line 287, in UploadObject
2018-04-15T08:30:06.3808970Z gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3809064Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\gcs_json_api.py", line 1376, in UploadObject
2018-04-15T08:30:06.3809148Z gzip_encoded=gzip_encoded)
2018-04-15T08:30:06.3809245Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\gcs_json_api.py", line 1152, in _UploadObject
2018-04-15T08:30:06.3809332Z ValidateDstObjectMetadata(object_metadata)
2018-04-15T08:30:06.3809425Z File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\cloud_api_helper.py", line 40, in ValidateDstObjectMetadata
2018-04-15T08:30:06.3809534Z 'Object metadata supplied for destination object had no object name.')
2018-04-15T08:30:06.3809621Z ArgumentException: ArgumentException: Object metadata supplied for destination object had no object name.
2018-04-15T08:30:06.3809696Z
2018-04-15T08:30:06.3809769Z ArgumentException: Object metadata supplied for destination object had no object name.
答案 0 :(得分:0)
上述错误,以及我们在此issue tracker report的讨论,特定于在Windows上使用gsutil tool,并且由于使用了正斜杠./
而不是使用反斜杠{{1在命令行和Powershell中。它可能与Windows MS-DOS uses backslashes分隔文件路径.\
中的目录而不是像其他操作系统一样的正斜杠这一事实有关。因此,以下命令应该起作用:
C:\someDirectory\anotherDirectory