PermissionError on upgrading from 16.04 to 16.10

Bug #1633545 reported by Simon Kjellberg
80
This bug affects 15 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Expired
Critical
Unassigned

Bug Description

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-qtle43hs/yakkety", line 8, in <module>
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeMain.py", line 242, in main
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1880, in run
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1845, in fullUpgrade
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1263, in doDistUpgrade
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1385, in abort
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/sourceslist.py", line 366, in restore_backup
  File "/usr/lib/python3.5/shutil.py", line 236, in copy
    copymode(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.5/shutil.py", line 138, in copymode
    chmod_func(dst, stat.S_IMODE(st.st_mode))
PermissionError: [Errno 1] Operation not permitted: '/etc/apt/sources.list'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 109, in apport_excepthook
    pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME'])
  File "/usr/lib/python3/dist-packages/apport/report.py", line 544, in add_proc_info
    self['ExecutableTimestamp'] = str(int(os.stat(self['ExecutablePath']).st_mtime))
PermissionError: [Errno 13] Permission denied: '/tmp/ubuntu-release-upgrader-qtle43hs/yakkety'

Original exception was:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-qtle43hs/yakkety", line 8, in <module>
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeMain.py", line 242, in main
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1880, in run
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1845, in fullUpgrade
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1263, in doDistUpgrade
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/DistUpgradeController.py", line 1385, in abort
  File "/tmp/ubuntu-release-upgrader-qtle43hs/DistUpgrade/sourceslist.py", line 366, in restore_backup
  File "/usr/lib/python3.5/shutil.py", line 236, in copy
    copymode(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.5/shutil.py", line 138, in copymode
    chmod_func(dst, stat.S_IMODE(st.st_mode))
PermissionError: [Errno 1] Operation not permitted: '/etc/apt/sources.list'

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: ubuntu-release-upgrader-core 1:16.04.16
ProcVersionSignature: Ubuntu 4.4.0-43.63-generic 4.4.21
Uname: Linux 4.4.0-43-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CrashDB: ubuntu
Date: Fri Oct 14 18:08:29 2016
InstallationDate: Installed on 2016-04-23 (173 days ago)
InstallationMedia: Ubuntu-GNOME 16.04 LTS "Xenial Xerus" - Release amd64 (20160421)
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: ubuntu-release-upgrader
UpgradeStatus: Upgraded to xenial on 2016-10-14 (0 days ago)
mtime.conffile..etc.update-manager.release-upgrades: 2016-04-25T21:29:20.463739

Revision history for this message
Simon Kjellberg (simonkberg) wrote :
tags: added: xenial2yakkety
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

Was there another package management application running when you were trying to upgrade? From Mainlog.txt we can see a failure to get lock.

2016-10-14 18:00:04,012 DEBUG apt btrfs snapshots supported: False
2016-10-14 18:00:04,012 INFO cache.commit()
2016-10-14 18:00:04,012 DEBUG failed to SystemUnLock() (E:Not locked)
2016-10-14 18:00:04,013 ERROR IOError in cache.commit(): 'Failed to lock /var/cache/apt/archives/lock'. Retrying (currentTry: 0)
2016-10-14 18:00:04,013 INFO cache.commit()
2016-10-14 18:00:04,013 DEBUG failed to SystemUnLock() (E:Not locked)
2016-10-14 18:00:04,014 ERROR IOError in cache.commit(): 'Failed to lock /var/cache/apt/archives/lock'. Retrying (currentTry: 1)
2016-10-14 18:00:04,015 INFO cache.commit()
2016-10-14 18:00:04,015 DEBUG failed to SystemUnLock() (E:Not locked)
2016-10-14 18:00:04,015 ERROR IOError in cache.commit(): 'Failed to lock /var/cache/apt/archives/lock'. Retrying (currentTry: 2)
2016-10-14 18:00:04,016 ERROR giving up on fetching after maximum retries
2016-10-14 18:00:04,016 DEBUG abort called

Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Simon Kjellberg (simonkberg) wrote :

No, no other package management application running at the same time.

I'm not sure what is causing that error since the lock seems to be created by the upgrade process.
Eg. if i start the upgrade via "do-release-upgrade" and try to run apt simultaneously, apt will exit out because there's already a lock.

If i run apt alone, it works fine and doesn't complain about any lock.

If i try run "do-release-update" simultaneously as running apt manually, the upgrade exits out much earlier because of the pre-existing lock.

Revision history for this message
Sergio (serg1990io) wrote :

I'm experiencing the exact same issue as Simon. No package manager active other than do-release-update and updating process fails in the same way. Yesterday I also tried to update using the update GUI but it failed as well.

Revision history for this message
Sergio (serg1990io) wrote :

I've noticed that do-release-update made an half disaster: system now thinks that update is completed (it thinks it moved to 16.10) and software sources are modified to the new version. Apt upgrade tried to update all packages missing but it leaved system in a totally unusable and instable state. So I suggest to absolutely don't try to update packets after a failed try with do-release-upgrade...

Revision history for this message
Simon Kjellberg (simonkberg) wrote :

@Brian: Since this issue is still marked as "incomplete", is there any additional information we can provide to help triage the bug? Apart from answering the question about additional package managers, which we already did.

Thanks.

Changed in ubuntu-release-upgrader (Ubuntu):
status: Incomplete → Opinion
status: Opinion → Confirmed
Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Onno Steenbergen (osteenbergen) wrote :

I have the same issue, even if i'm logged in as root I can't do an upgrade.

Has anyone found a workaround?

Revision history for this message
Onno Steenbergen (osteenbergen) wrote :

Running 'update-manager' showed I needed to reboot the system, after reboot 'update-manager -d' started the upgrade, didn't try 'do-release-upgrade' command.

Revision history for this message
Lubos Baja (lubos-baja) wrote :

I had the very same problem.
I was succesfull to updgrade to 16.10 by setting runlevel 2.
So just open terminal and type
sudo init 2
Then GDM will close and only text terminal will remain
login and type
sudo do-release upgrade
It outputs some errors about unknown characters, but actually upgrade works.

Revision history for this message
Simon Kjellberg (simonkberg) wrote :

@Lubos: Thank you for providing a workaround, just tried it an I was finally able to upgrade without any issues.

Revision history for this message
Jakub Chatrný (jakub-chatrny) wrote :

I've experienced same problem. I assume problem is with some PPA applications running in python.

I tried @Lubos solution, but result was still same. I've noticed that after init 2 there was still running some proceses of my-weather-indicator. (PPA https://launchpad.net/my-weather-indicator ).
After I kill them I was able to finally run upgrade without errors.
sudo do-realease-upgrade
Unfortunatly upgrade stoped at installing python3-minimal package. After restart I was able to finish upgrade by
sudo apt-get install -f #to finish python3-minimal
sudo apt-get dist-upgrade #continue upgrade
Now it seems 16.10 upgrade is complete.

Revision history for this message
Chris Guiver (guiverc) wrote :

Thank you for reporting this bug to Ubuntu.

Ubuntu 16.10 (yakkety) reached end-of-life on July 20, 2017.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in.

Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for ubuntu-release-upgrader (Ubuntu) because there has been no activity for 60 days.]

Changed in ubuntu-release-upgrader (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.