SOLVED Cannot update 11.3-U2 -> 11.3-U4.1: Cannot remove file /usr/local/lib/python3.7/site-packages/acme/__pycache__/challenges.cpython-37.pyc

zirophyz

Dabbler
Joined
Apr 11, 2016
Messages
26
Hi all,

As the title suggests, I am having trouble updating from 11.3-U2 to U4.1.

See the output below from CLI update;

Code:
[freenasOS.Installer:1083] Installing package {'base-os': <_io.BufferedReader name='/var/db/system/update/base-os-11.3-U4.1-25f4b91af6102a144a45003f37de92e0.tgz'>}
[freenasOS.Installer:711] base-os-11.3-U4.1-25f4b91af6102a144a45003f37de92e0
[freenasOS.Installer:745] upgrade_aware = True
[freenasOS.Update:1594] Update got exception during update: Cannot remove file /usr/local/lib/python3.7/site-packages/acme/__pycache__/challenges.cpython-37.pyc
Traceback (most recent call last):
  File "/usr/local/lib/freenasOS/Update.py", line 1559, in ApplyUpdate
    if installer.InstallPackages(progressFunc=progressFunc, handler=install_handler) is False:
  File "/usr/local/lib/freenasOS/Installer.py", line 1088, in InstallPackages
    trampoline=self.trampoline) is False:
  File "/usr/local/lib/freenasOS/Installer.py", line 823, in install_file
    if pkgdb.RemovePackageFiles(pkgName) == False:
  File "/usr/local/lib/freenasOS/Configuration.py", line 347, in RemovePackageFiles
    raise Exception("Cannot remove file %s" % path)
Exception: Cannot remove file /usr/local/lib/python3.7/site-packages/acme/__pycache__/challenges.cpython-37.pyc


Any suggestions on how I can fix this up?

This is a new install of 11.3-U2. I recently moved to a new server (backup was taken from old server and restored on new hardware using same version of FreeNAS).

Thanks in advance,
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Seems like you previously installed ACME or Letsencrypt and the file used for site/domain validation has been set to a permission the installer doesn't have authority.
You could change the ownership and permission of the files or move them somewhere they won't cause any problem not being destroyed as part of the update.
 

zirophyz

Dabbler
Joined
Apr 11, 2016
Messages
26
Seems like you previously installed ACME or Letsencrypt and the file used for site/domain validation has been set to a permission the installer doesn't have authority.
You could change the ownership and permission of the files or move them somewhere they won't cause any problem not being destroyed as part of the update.

Hi Apollo,

I haven't installed any CA stuff. Just a home server so I don't use any SSL/TLS at all (apart from Plex, which runs inside a jail and uses a self-signed cert for it's https interface).

Something else I found odd, was when I attempt to list the directory contents from the error;

Code:
ls: challenges.cpython-37.pyc: Unknown error: 122
ls: fields.cpython-37.pyc: Unknown error: 122
ls: jws.cpython-37.pyc: Unknown error: 122
ls: messages.cpython-37.pyc: Unknown error: 122
ls: util.cpython-37.pyc: Unknown error: 122
total 278
-rw-r--r--  1 root  wheel   1820 Aug  5 07:19 __init__.cpython-37.opt-1.pyc
-rw-r--r--  1 root  wheel   1820 Aug  5 07:21 __init__.cpython-37.pyc
drwxr-xr-x  2 root  wheel     48 Aug  7 10:59 .
drwxr-xr-x  4 root  wheel     27 Aug  5 07:19 ..
-rw-r--r--  1 root  wheel  25624 Aug  5 07:19 challenges_test.cpython-37.opt-1.pyc
-rw-r--r--  1 root  wheel  25624 Aug  5 07:19 challenges_test.cpython-37.pyc
-rw-r--r--  1 root  wheel  18727 Aug  5 07:19 challenges.cpython-37.opt-1.pyc
-rw-r--r--  1 root  wheel  48824 Aug  5 07:19 client_test.cpython-37.opt-1.pyc


Can also see that root has rw on all the other files in the directory. And, I am running the upgrade script as root.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Are you running your boot pool on a thumb drive? Usually these error 122s and failures to remove files are indicators the thumb drive is soon to fail.
 

zirophyz

Dabbler
Joined
Apr 11, 2016
Messages
26
Are you running your boot pool on a thumb drive? Usually these error 122s and failures to remove files are indicators the thumb drive is soon to fail.

Hi Samuel,

I was running on a USB thumb drive on the old system. Which definitely had problems - especially that thumb drives aren't supported (it was hit and miss to even get everything to boot, always middlewared problems). The new system uses an M.2 NVMe SSD to boot from.

Could this be some leftover issue from the thumb drive introduced to the new install when I restored the backup?

My process was that I installed a fresh copy of FreeNAS, and then restored a backup from the old system. I didn't clone the old thumb drive onto the SSD.

Thanks.
 

zirophyz

Dabbler
Joined
Apr 11, 2016
Messages
26
I went ahead and just took a backup and did a fresh install of U4.1 ...

Won't know if those files are still going to be problematic until the next upgrade - but that's future me's problem. However, on U2 I was having a hard time with bhyve crashing when a VM attempted to access its virtual disk which isn't happening now. Can't be sure if this was a problem fixed in the update or if this was related to my update problems above.
 
Top