Splunk Dev

[Python] ValueError: unsupported hash type

jwoger_splunk
Splunk Employee
Splunk Employee

I have found that on some of my instances and later versions of splunk that have version 2.7 of Python bundled, when trying to execute my python scripts using splunk's bundled python libraries, i get the following error and the script does not execute.

"/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 139, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/Applications/splunk6.2/splunk/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512

How can i fix this error?

1 Solution

RicoSuave
Builder

This is because The python2.7 package is dependent to the libssl1_0_0 package (openssl_1.0 runtime librairies). Your OS is missing these. Install them and it will get rid of this error.

View solution in original post

jeremiahc4
Builder

I marked this as a "me too", however, it seems that while python dumps out these messages, the script continues on and does what it is supposed to do. So, it's just noise rather than broken for me.

0 Karma

RicoSuave
Builder

This is because The python2.7 package is dependent to the libssl1_0_0 package (openssl_1.0 runtime librairies). Your OS is missing these. Install them and it will get rid of this error.

hierros
Explorer

Wouldn't using openssl_1.0, make you vulnerable to "Heartbleed"?

bhawkins1
Communicator

Yes. A better answer would be "just don't do anything ssl-related with splunk's built-in python"

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...