1

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

verdverm
  • 329
  • 4
  • 11

4 Answers4

1

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
James K
  • 11
  • 2
  • Have you been able to successfully make calls via curl or another means? I have – verdverm Dec 02 '16 at 22:07
  • nothing successful yet. I'm using SOAP via .net/c#. I'm in the process of VPN'ing in and updating my wsdl, recompiling to see if that fixes anything. – James K Dec 02 '16 at 22:20
  • I think it's related to this: https://github.com/softlayer/softlayer-python/blob/master/SoftLayer/API.py#L252 – verdverm Dec 02 '16 at 22:23
  • ah, notice that is version 2, yes? Can you try this? curl https://:@api.softlayer.com/rest/v3/SoftLayer_Product_Package/getAllObjects.json – verdverm Dec 02 '16 at 22:36
  • It's the v3 version – James K Dec 02 '16 at 22:40
  • fyi, this post, same issue: http://stackoverflow.com/questions/40940374/transport-connect-reset and there are 2+ people reporting in that post. – James K Dec 02 '16 at 22:41
0

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 :)

verdverm
  • 329
  • 4
  • 11
0

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

Regards

  • I am still seeing issues, I can auth now, but unable to order machines. It's not finding the valid VLAN today. – verdverm Dec 05 '16 at 15:32
  • No, it says "VLAN not Found. Perhaps wrong SL Account?" I've verified I'm talking to the right account. – verdverm Dec 05 '16 at 16:00
  • that is possible or maybe your are using a wrong VLAN id, please review if your credentials and VLAN id are the correct, if you think everthing is fine please open another question and do not forget post your code. – Nelson Raul Cabero Mendoza Dec 05 '16 at 16:04
  • In my previous comment, I explicitly noted that I had already verified everything was correct. – verdverm Dec 05 '16 at 17:33
  • Anything going on here? We still have broken clients and are not getting any response about the issue or an estimate for fixing it – verdverm Dec 05 '16 at 20:49
-1

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?
  • I was issuing this exact command last night and it worked, I hit up this morning to order more machines and it is not working today. The issue started sometime between last night and this morning – verdverm Dec 02 '16 at 18:47
  • Could you attach your request please? – Ruber Cuellar Valenzuela Dec 02 '16 at 18:47
  • It's made via python, not really – verdverm Dec 02 '16 at 18:48
  • It's made through the SoftLayer python library at some point, is there a flag to cause more output to be shown? – verdverm Dec 02 '16 at 18:56
  • Yep, I'm able to make api calls using [Python SoftLayer Client](https://github.com/softlayer/softlayer-python), could you provide the code that you are trying? Product_Packages is [SoftLayer_Product_Package](http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package)? Product_Place_Orders is [SoftLayer_Product_Order](http://sldn.softlayer.com/reference/services/SoftLayer_Product_Order)? – Ruber Cuellar Valenzuela Dec 02 '16 at 19:06
  • It looks to be an API key issue, I am able to make the same calls with different credentials. Weird that it worked last night and not today. Trying to regenerate the key, though I don't have the ability to do this in the given account. Will post here if that solves the issue. – verdverm Dec 02 '16 at 19:18
  • Did the API change last night? This is all going through the SoftLayer python client, which hasn't changed, so did the Auth mechanisms change or something? – verdverm Dec 02 '16 at 19:51
  • The issue that you get, it's due to invalid credentials, can you make double check that you are using the correct credentials? or how are you getting your credentials? – Ruber Cuellar Valenzuela Dec 02 '16 at 20:28
  • To get API credentials see **API Access Information** in this link: [User Profile](https://control.softlayer.com/account/user/profile) – Ruber Cuellar Valenzuela Dec 02 '16 at 20:31
  • Verified the credentials are working, added a failing example to the question. – verdverm Dec 02 '16 at 21:15
  • shorter repro case is now posted – verdverm Dec 02 '16 at 22:27
  • I tried the rest endpoint, rather than the xmlrpc, same issue with SoftLayer python client. The same call works with curl. Added more example above – verdverm Dec 02 '16 at 22:41
  • Adding to the confusion, the same call failing with Python and C#, and which works with curl, also works with https://github.com/softlayer/softlayer-go client library – verdverm Dec 02 '16 at 23:06
  • That's right, there was an issue reported about xml endpoint (Python works with this endpoint), unfortunately it was resporded after I answered in this forum. I hope your issues have been fixed. If you continue facing this or any doubt, just let me know please – Ruber Cuellar Valenzuela Dec 05 '16 at 14:11