简体   繁体   English

在尚不存在的存储桶名称上调用PutBucket会引发异常

[英]Calling PutBucket on a bucket name that doesn't already exist throws an exception

My team is setting up a Eucalyptus server w/ Walrus that we want to use to run tests on our C# code, which uses Amazon's AWS stuff. 我的团队正在建立一个带有Walrus的桉树服务器,我们要使用它对我们的C#代码运行测试,该代码使用Amazon的AWS东西。 It's nearly set up and we're getting the code pointed at Eucalyptus now, but we're running into some difficulty. 它几乎已经设置好了,现在我们将代码指向Eucalyptus,但是遇到了一些困难。

We started out by calling PutBucket to create the bucket that we'll be using. 我们首先调用PutBucket来创建将要使用的存储桶。 The bucket did not exist previously, so there shouldn't be any problems. 该存储桶以前不存在,因此应该没有任何问题。 However, we're getting a null reference exception with the following stacktrace: 但是,我们得到了带有以下堆栈跟踪的空引用异常:

at System.Xml.XmlReader.CalcBufferSize(Stream input)  
at System.Xml.XmlTextReaderImpl.InitStreamInput(Uri baseUri, String baseUriStr, Stream stream, Byte[] bytes, Int32 byteCount, Encoding encoding)  
at System.Xml.XmlTextReaderImpl..ctor(String url, Stream input, XmlNameTable nt)  
at System.Xml.XmlTextReader..ctor(Stream input)  
at Amazon.S3.AmazonS3Client.transform(String responseBody, String actionName, Type t)  
at Amazon.S3.AmazonS3Client.processRequestResponse[T](HttpWebResponse httpResponse, S3Request request, Type t, T& response, Exception& cause)  
at Amazon.S3.AmazonS3Client.handleHttpResponse[T](S3Request userRequest, HttpWebRequest request, HttpWebResponse httpResponse, Int32 retries, Int64 lengthOfRequest, T& response, Exception& cause, HttpStatusCode& statusCode)  
at Amazon.S3.AmazonS3Client.getResponseCallback[T](IAsyncResult result)  
at Amazon.S3.AmazonS3Client.endOperation[T](IAsyncResult result)  
at Amazon.S3.AmazonS3Client.EndPutBucket(IAsyncResult asyncResult)  
at Amazon.S3.AmazonS3Client.PutBucket(PutBucketRequest request)  
[at application library]

Now here's where it gets weird. 现在这是奇怪的地方。 When we checked the server, the bucket was successfully created! 当我们检查服务器时,存储桶已成功创建! The server processed the request correctly and made the bucket that we wanted. 服务器正确处理了请求,并制作了我们想要的存储桶。 The response is coming back invalid, but the request was processed correctly. 返回的响应无效,但请求已正确处理。 And so far the problem only seems to occur when calling PutBucket, because when we delete the bucket it is successfully deleted off of the server and no exceptions are thrown. 到目前为止,问题似乎仅在调用PutBucket时出现,因为当我们删除存储桶时,该存储桶已成功从服务器中删除,并且不会引发任何异常。

So far we're at a loss as to what's happening. 到目前为止,我们对所发生的事情一无所知。 We suspect that there's a problem on Walrus's end. 我们怀疑海象的结局有问题。 Perhaps AWS is expecting one thing and Walrus is doing another. 也许AWS期待一件事,而Walrus期待另一件事。 Maybe we didn't configure Eucalyptus and/or Walrus correctly. 也许我们没有正确配置Eucalyptus和/或Walrus。 We're not sure at all. 我们完全不确定。

That's why I'm posting the question here. 这就是为什么我在这里发布问题。 I was curious if anyone has had any experience with this before, or perhaps can offer some insight. 我很好奇,如果有人以前有过任何经验,或者可以提供一些见识。 What could cause the server to correctly process a request but send back an invalid response? 是什么导致服务器正确处理请求但发送回无效响应? Why would Eucalyptus make the bucket but AWS think that the operation failed? 为什么桉树会成为存储桶,但AWS认为该操作失败了?

The issue is likely that the Walrus PUT bucket response includes a body that element that is no longer included in responses from S3 (it used to be the case, but was removed). 这个问题很可能是Walrus PUT存储桶响应包含一个正文,该元素不再包含在S3的响应中(以前是这种情况,但已被删除)。

So the operation is succeeding on Walrus, but the client is failing to parse the response properly. 因此,该操作在Walrus上成功完成,但是客户端无法正确解析响应。 This is often dependent upon the specific clients as some are more strict than others (some, for instance, will not even try to parse a response body if it isn't expected to exist for a particular response code such as HTTP 200 OK). 这通常取决于特定的客户端,因为某些客户端比其他客户端更严格(例如,某些客户端甚至不尝试解析响应主体,如果它对于特定的响应代码(例如HTTP 200 OK)而言不存在的话)。

I would recommend looking at what is being sent/received over the wire. 我建议您查看通过导线发送/接收的内容。 Wireshark/tcpdump should show the full response coming from Walrus. Wireshark / tcpdump应该显示来自海象的完整响应。 Likely there is an XML difference that is enough that the client is failing. XML差异可能足以使客户端发生故障。 We at Eucalyptus are working to fix these issues as they arise, but because the S3 API (REST in particular) changes without warning or a version bump, sometimes things change and the SDK is updated before we can make the change in Walrus. Eucalyptus的我们正在努力解决这些问题的出现,但是由于S3 API(尤其是REST)在没有警告或版本颠簸的情况下发生了更改,因此有时情况会发生变化,并且在我们可以在Walrus中进行更改之前会更新SDK。

Feel free to ask on engage.eucalyptus.com for help or catch us on IRC on Freenode in #eucalyptus or #eucalyptus-devel 请随时在engage.eucalyptus.com上寻求帮助,或在#eucalyptus或#eucalyptus-devel中的Freenode上的IRC上找到我们

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 创建存储桶(如果尚不存在) - creating bucket if it doesn't exists already 仅当目标中不存在其克隆对象时,如何将其从一个S3存储桶复制到另一个对象 - How do I copy an object from one S3 bucket to another only if its clone doesn't already exist in target 亚马逊称S3存储桶不存在 - Amazon saying S3 bucket doesn't exist 当对象不存在时,headObject 从不抛出错误 - headObject never throws an error when object doesn't exist Rails回形针上传到S3会返回存储桶URL,但存储桶中不存在文件夹 - Rails paperclip upload to S3 returns bucket URL but folder doesn't exist on bucket 是否可以检查存储桶名称是否已存在? - Is it possible to check if a bucket name already exists? Ruby aws-sdk-“ .exists?”表示该文件不存在,即使我在存储桶中看到了该文件 - Ruby aws-sdk - “.exists?” says the file doesn't exist even though I see it in the bucket 当桶中不存在前缀时,aws-sdk-s3 PHP ListObjects 失败 - aws-sdk-s3 PHP ListObjects fails when prefix doesn't exist in bucket AWS S3 存储桶名称已存在 - AWS S3 Bucket name already exists 无服务器错误:部署到 Gitlab 时“存储桶已存在” - serverless error: "bucket already exist" while deploying to Gitlab
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM