yum python logger error bad marshal data
Interesting bug encountered today after a fresh install of RHEL5 from 5.3 media.
When attempting to run the command, ‘yum’. The following error was presented:
# yum Traceback (most recent call last): File "/usr/bin/yum", line 4, in ? import yum File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 30, in ? import logging ValueError: bad marshal data
To correct this issue, I first needed to determine if the problem was with yum, or something else. So I created a simple python script:
#!/usr/bin/python import logging
Actually, really simple. This helped me isolate the issue.
When running this program I was presented with the same error message:
Traceback (most recent call last): File "test.py", line 1, in ? import logging ValueError: bad marshal data
So I wondered, what could cause this corruption. Maybe the installation had a corrupt package installed. rpm verification to double check.
# rpm -Va python .M...U.. /usr/lib64/python2.4/aifc.py ..5..... /usr/lib64/python2.4/logging/__init__.pyc
So I though, maybe somehow the .pyc file became corrupt. So lets just delete this file, since it is only a byte-compiled file that will be re-generated on-demand.
And, well, that was the solution:
# rm /usr/lib64/python2.4/logging/__init__.pyc
The problem is now resolved.
The RPM of python that was installed: python-2.4.3-24.el5.x86_64.rpm