SoftLayerAPIError(SoftLayer_Exception_Public):添加用户时发生超时

时间:2017-04-20 18:26:53

标签: ibm-cloud ibm-cloud-infrastructure

我正在尝试使用SoftLayer python API在我们的SoftLayer帐户中创建一个新用户。这是我在python解释器中运行的代码:

import SoftLayer

client = SoftLayer.create_client_from_env("<user-id>", "<api -key>",SoftLayer.API_PUBLIC_ENDPOINT,240)

client['Account'].getCurrentUser() # This returns some info about the user, showing that I've successfully connected to the SoftLayer public API endpoint.

username="april19csctest1"
first="april19csc"
last="test1"
email="<my-email>"
user_template = {'username': username,'firstName': first,'lastName': last,'email': email,'companyName': '<companyName>','address1': 'my-address','city': '<city>','state': 'ON','country': 'CA','postalCode': '<my-postal-code>','userStatusId': 1001,'timezoneId': 120,'sslVpnAllowedFlag': True,'vpnManualConfig': False,'secondaryPasswordTimeoutDays' : 90}
password="<some-random-password>"

newUser = client['User_Customer'].createObject(user_template,password,password)

60秒后(比我在SoftLayer.create_client_from_env(...)中设置的超时时间短),最后一行会输出错误:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 363, in call_handler
    return self(name, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 331, in call
    return self.client.call(self.name, name, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 227, in call
    return self.transport(request)
  File "/usr/local/lib/python2.7/dist-packages/SoftLayer/transports.py", line 160, in __call__
    raise _ex(ex.faultCode, ex.faultString)
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): Time out occurred while adding user

这是我运行client['User_Customer'].createObject(user_template,password,password)时的tcpdump输出。看起来在60秒后,SoftLayer服务器回复我的计算机,说有超时。所以,在我看来,我与SoftLayer的api端点的连接很好,我在API客户端设置的240秒超时很好,但SoftLayer的服务器内部抛出了这个超时错误:

16:53:02.554555 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [S], seq 1152464108, win 28200, options [mss 1410,sackOK,TS val 755142197 ecr 0,nop,wscale 7], length 0
16:53:02.587518 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [S.], seq 2170195113, ack 1152464109, win 8190, options [mss 1360,nop,wscale 4,nop,nop,sackOK], length 0
16:53:02.587618 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [.], ack 1, win 221, length 0
16:53:02.602741 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [P.], seq 1:310, ack 1, win 221, length 309
16:53:02.635693 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [P.], seq 1:1361, ack 310, win 2191, length 1360
16:53:02.635730 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [.], ack 1361, win 243, length 0
16:53:02.635743 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [P.], seq 1361:2717, ack 310, win 2191, length 1356
16:53:02.635753 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [.], ack 2717, win 265, length 0
16:53:02.655966 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [P.], seq 2717:3059, ack 310, win 2191, length 342
16:53:02.656022 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [.], ack 3059, win 286, length 0
16:53:02.657166 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [P.], seq 310:436, ack 3059, win 286, length 126
16:53:02.689966 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [.], ack 436, win 2184, length 0
16:53:02.710273 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [P.], seq 3059:3110, ack 436, win 2184, length 51
16:53:02.711410 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [P.], seq 436:2672, ack 3110, win 286, length 2236
16:53:02.744620 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [.], ack 2672, win 2044, length 0

## nothing printed for a while. 60 seconds later, the following is printed:

16:54:10.162548 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [P.], seq 3110:3626, ack 2672, win 65535, length 516
16:54:10.165530 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [P.], seq 2672:2703, ack 3626, win 307, length 31
16:54:10.167088 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [F.], seq 2703, ack 3626, win 307, length 0
16:54:10.198582 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [.], ack 2703, win 2559, length 0
16:54:10.198675 IP 78.77.e442.ip4.static.sl-reverse.com.https > 10.10.8.121.59366: Flags [F.], seq 3626:3657, ack 2703, win 2559, length 31
16:54:10.198723 IP 10.10.8.121.59366 > 78.77.e442.ip4.static.sl-reverse.com.https: Flags [R], seq 1152466811, win 0, length 0

问题:

  • 这确实是SoftLayer方面的一个问题吗?或者,我有什么办法可以解决这个问题吗?
  • SoftLayer正在调查此问题吗?

1 个答案:

答案 0 :(得分:0)

目前,API服务器存在一个问题,即客户收到超时错误。这个问题正在调查中,但是没有时间来解决它。我只能建议您抓住错误并重试。