2013-10-23 46 views
2

雖然使用本地機器上的CreateObjectFromFile方法將文件上傳到rackspace雲,但它仍然很好。但是當我從客戶機執行它時,我得到net.openstack.Core.Exceptions.Response.BadServiceRequestException。雖然使用openstack.net在rackspace雲中上傳雲文件我得到net.openstack.Core.Exceptions.Response.BadServiceRequestException

ContainerID: 1644 
srcfileName: \\10.5.48.2\XMLGateway\BOOutBox\PJR340131023160359529217.xml 
desfileName: 1644_PJR340131023160359529217.xml 

cloudFilesProvider.CreateObjectFromFile(inStrContainerID, inStrSrcFilePath, strDesFileName); 

我檢查了這個異常的文檔,我找不到任何有用的東西。

編輯: 這裏是錯誤堆棧

net.openstack.Core.Exceptions.Response.BadServiceRequestException: Invalid request body: unable to parse Auth data. Please review XML or JSON formatting. 
at net.openstack.Providers.Rackspace.Validators.HttpResponseCodeValidator.Validate(Response response) 
at net.openstack.Providers.Rackspace.GeographicalCloudIdentityProvider.ExecuteRESTRequest[T](CloudIdentity identity, String urlPath, HttpMethod method, Object body, Dictionary`2 queryStringParameter, Boolean isRetry, Boolean isTokenRequest, String token, Int32 retryCount, Int32 retryDelay, Func`7 callback) 
at net.openstack.Providers.Rackspace.GeographicalCloudIdentityProvider.ExecuteRESTRequest[T](CloudIdentity identity, String urlPath, HttpMethod method, Object body, Dictionary`2 queryStringParameter, Boolean isRetry, Boolean isTokenRequest, String token, Int32 retryCount, Int32 retryDelay) 
at net.openstack.Providers.Rackspace.GeographicalCloudIdentityProvider.<>c__DisplayClassc.<GetUserAccess>b__b() 
at net.openstack.Core.Caching.UserAccessCache.<>c__DisplayClassc.<Get>b__4(String k) 
at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory) 
at net.openstack.Core.Caching.UserAccessCache.Get(String key, Func`1 refreshCallback, Boolean forceCacheRefresh) 
at net.openstack.Providers.Rackspace.GeographicalCloudIdentityProvider.GetUserAccess(CloudIdentity identity, Boolean forceCacheRefresh) 
at net.openstack.Providers.Rackspace.CloudIdentityProvider.GetUserAccess(CloudIdentity identity, Boolean forceCacheRefresh) 
at net.openstack.Providers.Rackspace.ProviderBase`1.GetServiceEndpoint(CloudIdentity identity, String serviceName, String region) 
at net.openstack.Providers.Rackspace.ProviderBase`1.GetPublicServiceEndpoint(CloudIdentity identity, String serviceName, String region) 
at net.openstack.Providers.Rackspace.CloudFilesProvider.GetServiceEndpointCloudFiles(CloudIdentity identity, String region, Boolean useInternalUrl) 
at net.openstack.Providers.Rackspace.CloudFilesProvider.CreateObject(String container, Stream stream, String objectName, Int32 chunkSize, Dictionary`2 headers, String region, Action`1 progressUpdated, Boolean useInternalUrl, CloudIdentity identity) 
at net.openstack.Providers.Rackspace.CloudFilesProvider.CreateObjectFromFile(String container, String filePath, String objectName, Int32 chunkSize, Dictionary`2 headers, String region, Action`1 progressUpdated, Boolean useInternalUrl, CloudIdentity identity) 
at ?.?.?(String ?, String ?, String ?, String ?, String ?, String& ?, Boolean& ?, String& ?) 

編輯2: 確定更新的dll到新版本之後,這是堆棧跟蹤:

Unable to connect to the remote server 
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 173.203.3.30:443 
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) 
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) 
--- End of inner exception stack trace --- 
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) 
at System.Net.HttpWebRequest.GetRequestStream() 
at JSIStudios.SimpleRESTServices.Client.RestServiceBase.<>c__DisplayClass6.<Stream>b__5(HttpWebRequest req) 
at JSIStudios.SimpleRESTServices.Client.RestServiceBase.<>c__DisplayClass9.<ExecuteRequest>b__8() 
at JSIStudios.SimpleRESTServices.Client.RequestRetryLogic.Execute(Func`1 callback, IEnumerable`1 non200SuccessCodes, Int32 retryCount, Nullable`1 retryDelay) 
at JSIStudios.SimpleRESTServices.Client.RestServiceBase.ExecuteRequest(Uri url, HttpMethod method, Func`3 responseBuilderCallback, Dictionary`2 headers, Dictionary`2 queryStringParameters, RequestSettings settings, Func`2 executeCallback) 
at JSIStudios.SimpleRESTServices.Client.RestServiceBase.Stream(Uri url, HttpMethod method, Func`3 responseBuilderCallback, Stream content, Int32 bufferSize, Int64 maxReadLength, Dictionary`2 headers, Dictionary`2 queryStringParameters, RequestSettings settings, Action`1 progressUpdated) 
at JSIStudios.SimpleRESTServices.Client.RestServiceBase.Stream(Uri url, HttpMethod method, Stream content, Int32 bufferSize, Int64 maxReadLength, Dictionary`2 headers, Dictionary`2 queryStringParameters, RequestSettings settings, Action`1 progressUpdated) 
at net.openstack.Providers.Rackspace.ProviderBase`1.StreamRESTRequest(CloudIdentity identity, Uri absoluteUri, HttpMethod method, Stream stream, Int32 chunkSize, Int64 maxReadLength, Dictionary`2 queryStringParameter, Dictionary`2 headers, Boolean isRetry, RequestSettings requestSettings, Action`1 progressUpdated) 
at net.openstack.Providers.Rackspace.CloudFilesProvider.CreateObject(String container, Stream stream, String objectName, String contentType, Int32 chunkSize, Dictionary`2 headers, String region, Action`1 progressUpdated, Boolean useInternalUrl, CloudIdentity identity) 
at net.openstack.Providers.Rackspace.CloudFilesProvider.CreateObjectFromFile(String container, String filePath, String objectName, String contentType, Int32 chunkSize, Dictionary`2 headers, String region, Action`1 progressUpdated, Boolean useInternalUrl, CloudIdentity identity) 
at ?.?.?(String ?, String ?, String ?, String ?, String ?, String& ?, Boolean& ?, String& ? 

所以也要做與客戶機上的防火牆設置?

+0

要確認,這是針對我們的API還是使用其中一個SDK的自定義代碼? –

+0

正在使用openstack.net sdk – gopstar

+0

OP - 我正在跟進編寫.NET SDK的人員以查看是否有更詳細的錯誤消息可供您使用。 –

回答

3

SDK的一個較新版本可通過的NuGet。包括在該版本的許多變化兩個如下:

  1. 刪除GeographicalCloudIdentityProvider(僅SDK本身中的一類,不過這是表示你正在使用舊版本的您的堆棧跟蹤的一部分SDK)
  2. 增加了ResponseException包括有關該問題的原因爲異常的部分詳細信息的能力(基類的BadServiceRequestException和其他幾個人)。

(僅適用於openstack.net 1.2.x):由於我們正在努力解決ASAP的SDK依賴性方面的限制,因此您需要在安裝SDK之前明確安裝SDK依賴項之一。對此的說明包含在更新的註釋中,如下所示:openstacknetsdk/openstack.net#203

+0

好吧,我已經更新了SDK,我現在收到的錯誤是「無法連接到遠程服務器」。爲什麼它能夠連接並從本地機器上傳,而不是從客戶機上傳?與客戶機上的一些防火牆設置有關嗎? – gopstar

+0

更新:來自堆棧跟蹤的ipaddress 173.203.3.30,我能夠從我的本地機器ping通。我禁用了所有的防火牆,並從客戶端機器ping通,並且我的連接超時,沒有響應。 – gopstar

+0

@gopstar - 加入這個聊天室,我們可以實時工作:http://chat.stackoverflow.com/rooms/39944/rackspace –

相關問題