SoftLayer (multiple) client responding with errors

2019-07-31 06:30发布

I am having issues connecting to the SoftLayer Product/Orders APIs.

Endpoints: Product_Packages is dropping the connection, Product_Place_Orders is returning invalid auth. Hardware and VirtualGuests are accepting the credentials and returning the information I expect.

Either:

  • Invalid credentials
  • Connection reset by peer

I am, however, able to use the same credentials to see what machines and vlans are in the account.

Looking into this more, curl works, another client I have works still, however the SoftLayer python client stopped working overnight.

Did the API change Auth mechanisms change last night?

import SoftLayer

client = SoftLayer.create_client_from_env()  # or
client = SoftLayer.create_client_from_env(endpoint_url="https://api.softlayer.com/rest/v3/")
location_groups = client.call('Location_Group_Pricing', 'getAllObjects')

Output:

Unexpected error: <class 'SoftLayer.exceptions.TransportError'>
Traceback (most recent call last):
  File "list_product_options.py", line 28, in <module>
location_groups = client.call('Location_Group_Pricing', 'getAllObjects')
  File "/Users/tony/alchemy/ibm-krobots/sl-tools/slcli/lib/python2.7/site-packages/SoftLayer/API.py", line 263, in call
return self.transport(request)
  File "/Users/tony/alchemy/ibm-krobots/sl-tools/slcli/lib/python2.7/site-packages/SoftLayer/transports.py", line 199, in __call__
raise exceptions.TransportError(0, str(ex))
SoftLayer.exceptions.TransportError: TransportError(0): ('Connection aborted.', error(54, 'Connection reset by peer'))

catching the exception shows the following:

Unexpected error: <class 'SoftLayer.exceptions.TransportError'>

A working curl for the same endpoint:

curl https://<username>:<api_key>@api.softlayer.com/rest/v3/SoftLayer_Location_Group_Pricing/getAllObjects.json

Also verified that the Golang client works.

https://github.com/softlayer/softlayer-go

4条回答
叼着烟拽天下
2楼-- · 2019-07-31 06:36

Just to point out that I am experiencing the same issue and I believe there is another post from someone else also mentioning the same transport/connection forcibly closed issue.

Worked last night, not working today. I'm changing my api key and user_name to see if it gets fixed. Note I too have multiple SL accounts. I'm swapping to my primary account API credentials to see what happens.

Here is the error

Unable to read data from the transport connection: An existing connection was fo rcibly closed by the remote host.
System.Net.WebException: The underlying connection was closed: An unexpected err or occurred on a send. ---> 
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the 
remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
   at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.ConnectStream.WriteHeaders(Boolean async)
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequestrequest)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at SoftlayerAPIV2.Softlayer.Account.SoftLayer_AccountService.getAdcLoadBalancers
查看更多
疯言疯语
3楼-- · 2019-07-31 06:47

After talking with SoftLayer support, there was a service issue which has now been resolved.

Future Mitigation: More extensive testing for older clients and related systems will be implemented into our Change Management guidelines to prevent this type of issue in the future.

(I like that part :)

查看更多
在下西门庆
4楼-- · 2019-07-31 06:48

We don't have any report about issues for that, and I'm able to use SoftLayer_Product_Order service, could you provide your request(s)? for further assistance

  • How often have you been getting this issue?
  • Did you have success with those request before?
查看更多
不美不萌又怎样
5楼-- · 2019-07-31 07:02

This was an issue in Softlayer side, please try again it should be fixed now.

Regards

查看更多
登录 后发表回答