-1

Problem:

I'm trying to debug some of my code that uses Softlayer Object Storage however I kept getting some errors from SL itself. Since I was getting the error from SL I went ahead and tried writing some code that reproduces the error. Which can be seen below followed by the stack trace I get.

Question:

Does anyone know why I'm getting the below error besides the possible security prevention from spamming sl so many times?

Source Code:

#!/usr/local/bin/python2.7
import argparse
import object_storage

def main():
    parser = argparse.ArgumentParser(description='Spam multiple sl storage containers.')

    parser.add_argument("--username", type=str, required=True, help="softlayer username")
    parser.add_argument("--apikey", type=str, required=True, help="softlayer api key")
    parser.add_argument("--datacenter", type=str, required=True, help="softlayer datacenter")
    parser.add_argument("--count", type=int, required=True, help="Amount of times to iterate")

    args = parser.parse_args()
    username = args.username
    api_key = args.apikey
    datacenter = args.datacenter
    count = args.count

    for i in range(0, count):
        print "Trying to create sl_storage.containers() #{0}".format(i)
        sl_storage = object_storage.get_client(username, api_key, datacenter=datacenter)
        containers = sl_storage.containers()
        del containers
        del sl_storage

if __name__ == "__main__":
    main()

Stack Trace:

Traceback (most recent call last):
  File "/root/sl_test.py", line 32, in <module>
    main()
  File "/root/sl_test.py", line 27, in main
    containers = sl_storage.containers()
  File "/usr/local/lib/python2.7/site-packages/object_storage/client.py", line 293, in containers
    formatter=_formatter)
  File "/usr/local/lib/python2.7/site-packages/object_storage/client.py", line 354, in make_request
    result = self.conn.make_request(method, url, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/object_storage/transport/httplib2conn.py", line 55, in make_request
    response = _make_request(headers)
  File "/usr/local/lib/python2.7/site-packages/object_storage/transport/httplib2conn.py", line 48, in _make_request
    body=data)
  File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1659, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1399, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1325, in _conn_request
    raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at dal05.objectstorage.softlayer.net

Opened up an issues against softlayer-object_storage python package here https://github.com/softlayer/softlayer-object-storage-python/issues/50

Abraham
  • 220
  • 2
  • 15
  • I'm voting to close this question as off-topic because this seems an error with client network response or with Softlayer's server response, the issue is not reproducible all the time and it only happens sometimes. – Nelson Raul Cabero Mendoza Jun 26 '17 at 19:06
  • I disagree with your statement, if indeed it is a server/client issue then how is it fixed? I see no solution proposed or ways to rule that out? Why would you close it without it? – Abraham Jun 26 '17 at 19:24

2 Answers2

0

First: I think you should have opened the issue here:

https://github.com/softlayer/softlayer-object-storage-python

second: I do not think this is an issue for me this is working fine, the error probably is due to you do not have any storage in dal05, you can verify that in the control portal by going https://control.softlayer.com/storage/objectstorage and make sure that there are containers in the dal05.

third: the client that you are using only works for swift storages, it does not work for S3 containers

  • First point: Yeah you are right about, let me fix that. Second point: just because you are not hitting the issue does not mean it does not exist. It is an intermittent one as I had trouble reproducing it. That aside, your point on there not being containers is not correct as I was able to run this 9/10 times before hitting the issue. Third Point: Not sure what you mean by this one. That being said all of the information you presented could have been phrased in a better way, while I do appreciate the feedback but I do not see any solution here at all. – Abraham Jun 26 '17 at 18:26
  • you did not say that the errors is hapening sometimes, probably is due network conections or a resert from the server in that case I suggest you to catch the error and try again, the thid case is about the softlayer object storages currently there are 2 types swift and S3 That being said all of the information you presented in your issue could have been phrased in a better way. you should have stated that this is happening only sometimes. – Nelson Raul Cabero Mendoza Jun 26 '17 at 18:44
  • I'm pretty sure that I mentioned I had `some errors` as for the intermittent failures I suppose I could add a retry on error but that's more of a band aid fix then a long term solution. Lastly I received confirmation that the storage is Swift-based not S3. – Abraham Jun 26 '17 at 19:00
  • Alright, just circling back to close this issue off. The problem was due to internal proxy server and name resolution. Sometimes we just have to swallow our pride and try what others suggest. Thanks for the pointer. – Abraham Jul 07 '17 at 17:11
0

The storage in this issue is Swift-based not S3.