Security

Bucketmover error when executing coldtofrozen script: SSL not defined

mcoombs2027
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.upload_file(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 upload_file
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript self.put_object(filename, bucket, key, callback, extra_args)
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 _put_object
08-22-2017 16:14:02.610 +0000 ERROR BucketMover - coldToFrozenScript extra_args)
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._make_api_call(operation_name, 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 _make_api_call
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript operation_model, request_dict)
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._send_request(request_dict, operation_model)
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 _send_request
08-22-2017 16:14:02.611 +0000 ERROR BucketMover - coldToFrozenScript success_response, 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 caught_exception=caught_exception, request_dict=request_dict)
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(event_name, 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, caught_exception):
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 caught_exception)
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(attempt_number, response, caught_exception)
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 caught_exception)
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 attempt_number, caught_exception)
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 _check_caught_exception
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

jkat54
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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...