Yum update failing with Python error?

Hey all,
Having a strange issue trying to update my FreePBX system.
Noticed my updates having run in a while, in the UI its saying

Unable to run ‘yum check-updates’, can’t check for updates

I figured no big deal, ill just go try to run yum update manually, but I’m presenting with a strange python error that I’ve never seen before.

[[email protected] ~]# yum update
Traceback (most recent call last):
File “/usr/bin/yum”, line 4, in
import yum
File “/usr/lib/python2.7/site-packages/yum/init.py”, line 59, in
import config
File “/usr/lib/python2.7/site-packages/yum/config.py”, line 30, in
from parser import ConfigPreProcessor, varReplace
File “/usr/lib/python2.7/site-packages/yum/parser.py”, line 4, in
import urlgrabber
File “/usr/lib/python2.7/site-packages/urlgrabber/init.py”, line 55, in
from grabber import urlgrab, urlopen, urlread
File “/usr/lib/python2.7/site-packages/urlgrabber/grabber.py”, line 2291
SyntaxError: Non-ASCII character ‘\x96’ in file /usr/lib/python2.7/site-packages/urlgrabber/grabber.py on line 2291, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

I’ve tried running yum clean all but also a python error. Not sure what’s going on, tried searching the errors and found nothing related to FreePBX… any thoughts?

EDIT: I also cant run a backup, it fails with a mysql connect error. The scheduled backups also have not been running, presumably because of whatever is causing these errors - so I’m paranoid about rebooting the system now (I do have very old backups, but its in a live environment so an up to date backup would be nice)

Possibly the file was corrupted by a hardware error or failed update.

My system shows:
-rw-r--r-- 1 root root 96523 Mar 31 2020 grabber.py
The lines 2290-2292 are:

            if opts.tries < retry and ug_err.errno in opts.retrycodes:
                if ug_err.errno < 0 and opts.retry_no_cache:
                    opts.no_cache = True

Hmm ok ive definitely got a different size and much older version

-rw-r–r-- 1 root root 96520 Oct 30 2018 grabber.py

If I go to line 2290 I get jibberish!

        if opts.tries < retry and ug_err.errno in opts.retrycodes:
            ��ߊ�����Y���^Y+1x^S^R�anF Mpt���ފފ�� ģN^E�^Ehޣԓd�F^B �� ^BF��ߓ���1uu�����.]���4����[�2^T��דu�  Γ^SΛF�ߛߛFu�ߌ��A�9MR^C���Ō^Vts��AK�s1�dd�F�^Bs�$

��^Bdu^B^BΊ ιιΛ^Q�Û}�ߛ^NЛϗ^HW^×F̗R^O�^Cu��ޗ9^^CµF�O�+^B^S��W��ߵ�u�^S^Sε߹ιΛ����Y�irP�6�����^_�� dW�ߛWWWιι�^B1��eQ�^Riع0��ҹM����^B^Al cP9FF߹uW�^B߹d�ιd^S F�c��$
^B�e_�4^[�@ھ�\� ���^S�^SF dξ^S���1^S�W^S�p s^]�ɾ-�@ h����lt’�~ɾ&O9��u ��u�d^S ξ11^B�^S�d^B�cei ^Yξ�^Sξ<P0ƾ�6 ң�1gߣ1�^Sڣ^RG�\L}[^Be��^B�+C,}���ߣΣΨ^BΛ� ^SF ��$
[email protected]���_5u^Cd���4���^S_���^U��^S�W�1�uW��u���F��W����^?�ÀFހN^Su߹�F߹ ι ��߹߹Wv߹ݹ^Vҹ9h����~�ߜ�������}ߜߜ�Wd1d^S^B� ^B ^B u�Ƌɋئ��أc^U�[ ޜ�+ɜ^U(
�� ^BF������1vu�����aQ왞<����F�FF�ߙ�u� Ι\�ϙ^U���^E0�����^S�1WE(�� F �젞^S^B� 1젞d
�^S�}c���s��/(M�^R�{U^Gx��d^HP�F�%!7�
N�1F��A�o^[Λ�Λ1 �ux�Z�,ߛϛ�ߛuWWd1ߛ1��àV�2c��M�^B^B1 ^B� �WWF^S�3촨ZdIӹ^[�Lƹ^[�� �A乨^W��W^C^K: ��^S��߹^S�߹�ud� F^Sgu^C�t 蹨d^C�0W-ȹF!|4�� W���ι�11ι1�^SdF�^O^@$
� �F�=i·�l����·1�1߇d1d�^B�1~yu��N^SdF1uι�ߊ ߊE1�=�r^M�^A^[�ba�u^[�Oҩ�F� ���^S�^SFߩd�[à�1_�^Y^[�l�rF� -�T)u��ߨ!w4�}Ϩ
^AA��7eɕ:ڕ[email protected]уpi}Ƀ\Ճ*G�txo^H^Dԃƃ^S�u^SdΨu����ߨ1dߨ4�^Eݨ P�^[^K^[^B^B1Ψ^B�d^SuW�Ҩݨߪ�ʪw��ƪ ^SF ��ߪ^B�W�1 d^B��#�D��Z^H��lA����^TM�^Y�ت^C�+��~ߪ^VF^\˪^Bcª1(G�_1�$

�^SΛF�ߛߛFu�ߛߛߛΛ^S�1^B^BTߩ٩ީ^Omaϩ^SO�rc�6u�^V�Gdשߩ�1Λd ^B�F�u^SF1��1F^Sț^V�01h�f%қ}F��l�^]?�ț��|a�09�G�8�ߛߛߛuWWd1ߛ1ߛߊ�^S�F1ι^D�GGu ^M� �W\F[�&���MY��^CƹI�=ӹΩ�$
�4^D0�^@%x(���^D������pe�1�_%^A�F^D�^U^R��^V�����WWFWu1�^B�1d�du���� #��E
:PG p����ύ^R��w�ڍ2�Èu^C�^C؈VF�^Cc���ˈx^[^SɈ�^U�F� ^B^BΈ�W��߈�u�^S^SΈ߹Ξɥ���^RΥ= L�0�$
���^B�W�1 d^B��F�1��UF��7^Rߖ�Ζ9M�^R��Wߖdιd߹^S^B^SιFdι1d^B�Wu���٦GþV˾�^^���y�ne^Ep7�ɞɞ��9^P�����^[؞�^XW�Ԟc�Ξ^^^r��[email protected]�yH뒒(�쒒d�^B 쒒dߒ�W^SF�d��^B1^S璒�풒$
�� �,u2ɺ����r^]���&ѹ�ɹ^O ^CN�տ0�t.�V��A���^T2�ؿӿߕN�8((Wߕ슊F �슊^S^B� 1슊gu슊^V슊Ct�ߩy��’uPة^C�!^S^Kx��~^T^Sک^H�u9-婊i0�1F��^S�u1Λ�Λ1 �uz�[�,ߝ��!,P)x�c����9$
�1F�uWd�Fd1d���W������bh�r�^Nd^M�^_J�
^O��^Rױ��WWFWu1�^B߱1d�dv����atϹw^V^Y^BC�ι �끖^Á}��1쁖�u�� uW߁F�^SF�^T}���ǁvY9с�^OՁ9߁rN
��^N�쐼!�^]A������쩼�^[ǩ
^B�d�����F�� dW��^E^[[�����Q1��~R�^D?�’���P�ϯ�^G^GAȯt
F^T
�u^X�V��N��d^S F� ��u�u�^S� pތь^@�ĨƞcŞi�ld6�J�a46!٤tnml1uι�ߊ ߊF1�uߊ1F�^V^C�.u�9W�^BίƯl� ���^S�^SF߯dί^S���yV�^^S�oٯt^S�ү)�G,uϤ��db!�cϤ_F^S��u ��u�d^S��h=^$
F웛^B�웛d�^B 웛dߛ�Ww#蛛^Q��K^?U盛䛛�^K�����n��rޛ-~�� �O+ߏڏ��^V�Ayu>!�,�= 7�9�;Y��Vl�ϵ=1tֵ=^B9i)^^!ǂ��uߛW^S�ΛΛF��&�p뛛ޛכMp^[email protected]^Nd웛^KN^Sߛ ^BV^^'훛˛Vukm�$
for meter in meters:

Could you post your grabber.py up to “meter.end()” and ill just try replacing, or better yet, post your whole grabber.py and ill just backup and replace my version :slight_smile:

AHA! I was able to fix this, thanks to you pointing out about the file corruption!
Replaced the corrupt grabber.py with the latest version on github, which then present with a missing dependency for “six”.
Installed pip to install the six module and now yum update is running!
Thanks so much for your help!

My (older) version, if you need it:
grabber.tgz (26.0 KB)

I noticed that the first corrupted character in the file is at index 0x15000, likely the start of a cluster.
Run fsck on this file system!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.