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
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...