Security

Bucketmover error when executing coldtofrozen script: SSL not defined

New Member

The script works perfectly when I execute it as root or as the splunk user on the command line. This is on Ubuntu 16.04.

08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript Traceback (most recent call last):
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript File "/opt/splunk/bin/ColdToS3Archive.py", line 74, in
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript main()
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript File "/opt/splunk/bin/ColdToS3Archive.py", line 69, in main
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript transfer.uploadfile(rawpath, s3bucket, destdir)
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/s3transfer/
init.py", line 644, in uploadfile
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript self.putobject(filename, bucket, key, callback, extraargs)
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/s3transfer/
init.py", line 654, in _putobject
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript extraargs)
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 312, in _api
call
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript return self.makeapicall(operationname, kwargs)
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 588, in makeapicall
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript operation
model, requestdict)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/endpoint.py", line 141, in make
request
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript return self.sendrequest(requestdict, operationmodel)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/endpoint.py", line 170, in sendrequest
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript successresponse, exception):
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/endpoint.py", line 249, in _needs
retry
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript caughtexception=caughtexception, requestdict=requestdict)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/hooks.py", line 227, in emit
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript return self.emit(eventname, kwargs)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/hooks.py", line 210, in _emit
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript response = handler(
kwargs)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/retryhandler.py", line 183, in call
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript if self.checker(attempts, response, caughtexception):
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/retryhandler.py", line 251, in call
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript caughtexception)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/retryhandler.py", line 269, in _should
retry
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript return self.checker(attemptnumber, response, caughtexception)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/retryhandler.py", line 317, in _
call__
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript caughtexception)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/retryhandler.py", line 223, in _
call__
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript attemptnumber, caughtexception)
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript File "/usr/local/lib/python2.7/dist-packages/botocore/retryhandler.py", line 359, in checkcaughtexception
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript raise caught
exception
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript NameError: global name 'ssl' is not defined

0 Karma

SplunkTrust
SplunkTrust

This is telling you the coldToFrozenScript is referencing something that hasnt been defined.

You'll have to post the contents of the script (minus any sensitive info) if you still need help with this.

Basically you're missing something like an import statement

 from sslLibrary import ssl

Or you're not populating a variable called 'ssl' but then you're calling it like this:

if "abc" in ssl:
   #do something

The above will error unless you've defined 'ssl' previously like below:

ssl = 'a string containing abc somewhere"

if "abc" in ssl:
     # do something
0 Karma