/usr/share/apport/whoopsie-upload-all:FileNotFoundError:/usr/share/apport/whoopsie-upload-all@220:main:collect_info:process_report:add_package_info:add_package:get_version:_apt_pkg:_cache:__init__:_check_and_create_required_dirs:makedirs:makedirs

Bug #1999156 reported by errors.ubuntu.com bug bridge
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
New
Undecided
Unassigned

Bug Description

```
Traceback (most recent call last):
  File "/usr/share/apport/whoopsie-upload-all", line 220, in <module>
    main()
  File "/usr/share/apport/whoopsie-upload-all", line 202, in main
    stamps = collect_info()
  File "/usr/share/apport/whoopsie-upload-all", line 150, in collect_info
    res = process_report(r)
  File "/usr/share/apport/whoopsie-upload-all", line 90, in process_report
    r.add_package_info()
  File "/usr/lib/python3/dist-packages/apport/report.py", line 351, in add_package_info
    version = self.add_package(package)
  File "/usr/lib/python3/dist-packages/apport/report.py", line 320, in add_package
    version = packaging.get_version(package)
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 163, in get_version
    pkg = self._apt_pkg(package)
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 156, in _apt_pkg
    return self._cache()[package]
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 121, in _cache
    self._apt_cache = apt.Cache(progress, rootdir='/')
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 143, in __init__
    self._check_and_create_required_dirs(rootdir)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 183, in _check_and_create_required_dirs
    os.makedirs(rootdir + d)
  File "/usr/lib/python3.10/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: '//var/cache/apt/archives'
```

The Ubuntu Error Tracker has been receiving reports about a problem regarding apport. This problem was most recently seen with package version 2.20.11-0ubuntu82.2, the problem page at https://errors.ubuntu.com/problem/e3a000aa8a314f9ae9303dcd52a119799a00496f contains more details, including versions of packages affected, stacktrace or traceback, and individual crash reports.
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://forms.canonical.com/reports/.

Tags: focal jammy
Benjamin Drung (bdrung)
description: updated
Benjamin Drung (bdrung)
tags: added: focal
Revision history for this message
Benjamin Drung (bdrung) wrote :

`apt.Cache(progress, rootdir='/')` fails with `FileNotFoundError`. I consider it a bug in python-apt. If the caller should catch that failure, please document that in python-apt and assign back to apport.

affects: apport (Ubuntu) → python-apt (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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