Can't update python3-libs@3.6.8-13.el7 from ce-base

NethServer Version: 7.8.2003

Cockpit tells me that I have an update, I choose update all, all seems to go well but after the install it still says I have an update. I can choose to update it again but the same thing happens. Reboot and still says I have an update.

Andrew

hi @arohl,

What happens if you run the update after clicking the reload button in the software center?

(right-side under corner in pic below)

If this does not help;
Does a manual update from the (cockpit) terminal give you some clues about what went wrong?
(in terminal) run: yum update

reload didn’t help but yum update failed with what I hope is an error message that means something to someone :slight_smile:

[root@nethserver andrew]#  yum update
Loaded plugins: changelog, fastestmirror, nethserver_events
Determining fastest mirrors
 * ce-base: mirror.internode.on.net
 * ce-extras: mirror.internode.on.net
 * ce-sclo-rh: mirror.internode.on.net
 * ce-sclo-sclo: mirror.internode.on.net
 * ce-updates: mirror.internode.on.net
 * epel: mirror.aarnet.edu.au
 * nethforge: mirror.nethserver.org
 * nethserver-base: mirror.nethserver.org
 * nethserver-updates: mirror.nethserver.org
Resolving Dependencies
--> Running transaction check
---> Package python3-libs.x86_64 0:3.6.8-10.el7 will be updated
---> Package python3-libs.x86_64 0:3.6.8-13.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================
 Package                                          Arch                                       Version                                           Repository                                   Size
=================================================================================================================================================================================================
Updating:
 python3-libs                                     x86_64                                     3.6.8-13.el7                                      ce-base                                     7.0 M

Transaction Summary
=================================================================================================================================================================================================
Upgrade  1 Package

Total download size: 7.0 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ce-base
python3-libs-3.6.8-13.el7.x86_64.rpm                                                                                                                                      | 7.0 MB  00:00:10     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : python3-libs-3.6.8-13.el7.x86_64                                                                                                                                              1/2 
Error unpacking rpm package python3-libs-3.6.8-13.el7.x86_64
error: unpacking of archive failed on file /usr/lib64/python3.6/ctypes/__pycache__/wintypes.cpython-36.opt-1.pyc: cpio: rename
  Verifying  : python3-libs-3.6.8-13.el7.x86_64                                                                                                                                              1/2 
python3-libs-3.6.8-10.el7.x86_64 was supposed to be removed but is not!
  Verifying  : python3-libs-3.6.8-10.el7.x86_64                                                                                                                                              2/2 

Failed:
  python3-libs.x86_64 0:3.6.8-10.el7                                                              python3-libs.x86_64 0:3.6.8-13.el7    

Me too :hushed: It is very unusual, in other words: I can not give a conclusive answer.

I have some clue’s what is happening here: before installing the new package version rpm tries to remove

/usr/lib64/python3.6/ctypes/__pycache__/wintypes.cpython-36.opt-1.pyc

but fails…

Solution on the net suggest a quite intrusive solution: move the offending file out off of the way and run the update. However because I can not reproduce this, i hesitate to give you this advise.

python3-libs-3.6.8-10.el7.x86_64

Is a left over from centos 7.7.1908.

I think it is save to try to reinstall this particular version of the package before updating:

yum reinstall http://vault.centos.org/centos/7.7.1908/os/x86_64/Packages/python3-libs-3.6.8-10.el7.x86_64.rpm

if this succeeds run the update again.

EDIT:
on my updated system the contents of the directory offending file looks like this:

 ls -ltr /usr/lib64/python3.6/ctypes/__pycache__/
total 108
-rw-r--r-- 1 root root  5097 Apr  2 15:36 wintypes.cpython-36.opt-2.pyc
-rw-r--r-- 1 root root  6980 Apr  2 15:36 util.cpython-36.opt-2.pyc
-rw-r--r-- 1 root root 13657 Apr  2 15:36 __init__.cpython-36.opt-2.pyc
-rw-r--r-- 1 root root  1580 Apr  2 15:36 _endian.cpython-36.opt-2.pyc
-rw-r--r-- 1 root root  5090 Apr  2 15:37 wintypes.cpython-36.pyc
-rw-r--r-- 1 root root  7221 Apr  2 15:37 util.cpython-36.pyc
-rw-r--r-- 1 root root 15918 Apr  2 15:37 __init__.cpython-36.pyc
-rw-r--r-- 1 root root  1919 Apr  2 15:37 _endian.cpython-36.pyc
-rw-r--r-- 1 root root  5090 Apr  2 15:37 wintypes.cpython-36.opt-1.pyc
-rw-r--r-- 1 root root  7221 Apr  2 15:37 util.cpython-36.opt-1.pyc
-rw-r--r-- 1 root root 15918 Apr  2 15:37 __init__.cpython-36.opt-1.pyc
-rw-r--r-- 1 root root  1919 Apr  2 15:37 _endian.cpython-36.opt-1.pyc

Note the date Apr 2, the older python3-libs-3.6.8-10 is probably dated Aug 7 2019

Same error

yum reinstall http://vault.centos.org/centos/7.7.1908/os/x86_64/Packages/python3-libs-3.6.8-10.el7.x86_64.rpm
Loaded plugins: changelog, fastestmirror, nethserver_events
python3-libs-3.6.8-10.el7.x86_64.rpm                                                                                                                                      | 7.0 MB  00:00:07     
Examining /var/tmp/yum-root-45_Y3H/python3-libs-3.6.8-10.el7.x86_64.rpm: python3-libs-3.6.8-10.el7.x86_64
Resolving Dependencies
--> Running transaction check
---> Package python3-libs.x86_64 0:3.6.8-10.el7 will be reinstalled
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================================
 Package                                   Arch                                Version                                      Repository                                                      Size
=================================================================================================================================================================================================
Reinstalling:
 python3-libs                              x86_64                              3.6.8-10.el7                                 /python3-libs-3.6.8-10.el7.x86_64                               35 M

Transaction Summary
=================================================================================================================================================================================================
Reinstall  1 Package

Total size: 35 M
Installed size: 35 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python3-libs-3.6.8-10.el7.x86_64                                                                                                                                              1/1 
Error unpacking rpm package python3-libs-3.6.8-10.el7.x86_64
error: unpacking of archive failed on file /usr/lib64/python3.6/ctypes/__pycache__/wintypes.cpython-36.opt-1.pyc: cpio: rename
  Verifying  : python3-libs-3.6.8-10.el7.x86_64                                                                                                                                              1/1 

Failed:
  python3-libs.x86_64 0:3.6.8-10.el7                                                                                                                                                             

Complete!

Woah!

[root@nethserver ~]# ls -l /usr/lib64/python3.6/ctypes/__pycache__
ls: cannot access /usr/lib64/python3.6/ctypes/__pycache__/wintypes.cpython-36.opt-1.pyc: Structure needs cleaning
total 196
-rw-r--r--  1 root root  1919 Aug  8  2019 _endian.cpython-36.opt-1.pyc
-rw-r--r--  1 root root  1580 Aug  8  2019 _endian.cpython-36.opt-2.pyc
-rw-r--r--  1 root root  1919 Aug  8  2019 _endian.cpython-36.pyc
-rw-r--r--  1 root root 15918 Aug  8  2019 __init__.cpython-36.opt-1.pyc
-rw-r--r--  1 root root 13657 Aug  8  2019 __init__.cpython-36.opt-2.pyc
-rw-r--r--  1 root root 15918 Aug  8  2019 __init__.cpython-36.pyc
-rw-r--r--  1 root root  7221 Aug  8  2019 util.cpython-36.opt-1.pyc
-rw-r--r--  1 root root  6980 Aug  8  2019 util.cpython-36.opt-2.pyc
-rw-r--r--  1 root root  7221 Aug  8  2019 util.cpython-36.pyc
-?????????? ? ?    ?        ?            ? wintypes.cpython-36.opt-1.pyc
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5ec2652d
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5ec27f10
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5ec27f34
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5ec938e7
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5ec9398b
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5ec9d9c8
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5eca8dc0
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5eccc0bb
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5eccc23f
-rw-r--r--  1 root root  5090 Apr  2 21:37 wintypes.cpython-36.opt-1.pyc;5eccd1a0
-rw-r--r--  1 root root  5090 Aug  8  2019 wintypes.cpython-36.opt-1.pyc;5eccdf92
-rw-r--r--  1 root root  5090 Aug  8  2019 wintypes.cpython-36.opt-1.pyc;5eccdfb7
-rw-r--r--. 1 root root  5097 Aug  8  2019 wintypes.cpython-36.opt-2.pyc
-rw-r--r--. 1 root root  5090 Aug  8  2019 wintypes.cpython-36.pyc

Do you know how I can run a fsck via web interface. I guess option b is to remove the directory as it appears only to be cache files.

Andrew

This file is corrupted! try to move it:

mv /usr/lib64/python3.6/ctypes/pycache/wintypes.cpython-36.opt-1.pyc .

then reinstall the old package , then update

Its really sick :frowning:

The file is there but not there - I can’t delete it or move it. I tried deleting the directory surrounding it; it deleted all the files in the directory but not this file. Seems I have to run xfs_repair but the drive has to be unmounted. It a headless server so rebooting via an external USB will be a real pain…

Yes, there is a serious problem with the file system…

AFAIK (and as you mentioned) to check / repair a root file system it has to be unmounted,
however had not have to deal with this since decades.
IIRC there was a boot flag for it, but one can never be sure of the outcome…

EDIT:
Probably a no go, did you try chmod 644 wintypes.cpython-36.opt-1.pyc and chown root:root wintypes.cpython-36.opt-1.pyc ? or even touch wintypes.cpython-36.opt-1.pyc

Maybe someone else has an idea to fix / remove a corrupt file?

I booted into recovery mode and did an xfs repair on a mounted but readonly filesystem. Warned me not to do it but went ahead and all good (there was a bad inode for that file). Update installed fine and all is working now. Many thanks for your help.

Andrew

Glad you are sorted out!

I’ll gues you can mark your own resume above as the solution :grinning: