Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 815493 - app-portage/recover-broken-vdb-0.0.7: dies during fix of vdb (TypeError: data must be str, not NoneType)
Summary: app-portage/recover-broken-vdb-0.0.7: dies during fix of vdb (TypeError: data...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Sam James
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-09-30 20:23 UTC by Aidan Marks
Modified: 2021-10-06 00:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cpuburn db pkg tar (var-db-pkg-app-benchmarks-cpuburn-1.4a-r3.tar,40.00 KB, application/x-tar)
2021-09-30 20:40 UTC, Aidan Marks
Details
recover-broken-vdb --verbose output (recover-broken-vdb-verbose.txt.bz2,70.30 KB, application/x-bzip)
2021-09-30 20:46 UTC, Aidan Marks
Details
recover-broken-vdb-find-broken.sh output (recover-broken-vdb-find-broken.txt,84 bytes, text/plain)
2021-09-30 20:49 UTC, Aidan Marks
Details
0001-recover-broken-vdb-don-t-abort-on-blank-entries.patch (file_815493.txt,2.06 KB, patch)
2021-10-01 03:37 UTC, Sam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aidan Marks 2021-09-30 20:23:16 UTC
Followed steps in eselect news read 2021-09-29-possible-failure-to-preserve-libraries

Get here and dies every time:

# recover-broken-vdb
>>> Scanning system. This may take a few minutes.
>>> Found 1 packages to fix
>>> Writing to output directory: /tmp/tmpas2nxpej
>>> Fixing VDB for app-benchmarks/cpuburn-1.4a-r3
Traceback (most recent call last):
  File "/usr/bin/recover-broken-vdb", line 33, in <module>
    sys.exit(load_entry_point('recover-broken-vdb==0.0.7', 'console_scripts', 'recover-broken-vdb')())
  File "/usr/lib/python3.9/site-packages/recover_broken_vdb/__init__.py", line 361, in start
    fix_vdb(args.vdb, filesystem, package, args.verbose)
  File "/usr/lib/python3.9/site-packages/recover_broken_vdb/__init__.py", line 314, in fix_vdb
    filesystem.add(
  File "/usr/lib/python3.9/site-packages/recover_broken_vdb/__init__.py", line 99, in add
    new_path.write_text(contents)
  File "/usr/lib/python3.9/pathlib.py", line 1283, in write_text
    raise TypeError('data must be str, not %s' %
TypeError: data must be str, not NoneType
 # 

Reproducible: Always




$ emerge --info

    sync-uri: rsync://rsync.au.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes

local_overlay
    location: /usr/local/portage
    masters: gentoo
    priority: 0

qemu-init
    location: /var/lib/layman/qemu-init
    sync-type: laymansync
    sync-uri: git+ssh://git@git.gentoo.org/proj/kvm-tools.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --quiet-build=n --backtrack=30"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_AU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB it"
MAKEOPTS="-j5"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/nas/tmp"
USE="X a52 aac acl acpi amd64 asf bash-completion bzip2 cli crypt cups dbus dri dts dvb dvd ffmpeg flac fortran gdbm iconv ipv6 jpeg libglvnd libtirpc live logrotate matroska mmx mmxext multilib ncurses nls nptl nptlonly ogg opengl openmp pam pcre pdf png readline real seccomp split-usr sse sse2 ssl svg theora tiff truetype type1-fonts unicode win32codecs wmf x264 xattr xinetd xulrunner xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2019" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en-AU" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="mga vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

$
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-30 20:29:14 UTC
Thanks. Could you tar up /var/db/pkg/app-benchmarks/cpuburn-1.4a-r3 and upload it here?

May be useful to see the recover-broken-vdb --verbose output too, and maybe the scan tool (-find-broken.sh) output for completeness.
Comment 2 Aidan Marks 2021-09-30 20:40:49 UTC
Created attachment 742242 [details]
cpuburn db pkg tar
Comment 3 Aidan Marks 2021-09-30 20:46:23 UTC
Created attachment 742245 [details]
recover-broken-vdb --verbose output
Comment 4 Aidan Marks 2021-09-30 20:49:08 UTC
Created attachment 742248 [details]
recover-broken-vdb-find-broken.sh output
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-01 03:37:14 UTC
Created attachment 742254 [details, diff]
0001-recover-broken-vdb-don-t-abort-on-blank-entries.patch

Could you try this via /etc/portage/patches please? Thanks!
Comment 6 Aidan Marks 2021-10-01 20:07:51 UTC
Patch seems to work.

# recover-broken-vdb
>>> Scanning system. This may take a few minutes.
>>> Found 1 packages to fix
>>> Writing to output directory: /tmp/tmpkhjh90gf
>>> Fixing VDB for app-benchmarks/cpuburn-1.4a-r3
??? Tried to write blank entry=REQUIRES for pkg=app-benchmarks/cpuburn-1.4a-r3. Likely harmless. Skipping entry.
>>> Generated fixed VDB files for app-benchmarks/cpuburn-1.4a-r3

>>> Written to output directory: /tmp/tmpkhjh90gf
# 

I then continued to complete the process per the news article.

I also re-ran the process and it did not identify any broken packages.

Please commit the change.

One query - given cpuburn is a binary only package, surely an emerge world is not required afterwards as the article suggests?
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-02 21:56:32 UTC
(In reply to Aidan Marks from comment #6)
> Patch seems to work.
> 
> # recover-broken-vdb
> >>> Scanning system. This may take a few minutes.
> >>> Found 1 packages to fix
> >>> Writing to output directory: /tmp/tmpkhjh90gf
> >>> Fixing VDB for app-benchmarks/cpuburn-1.4a-r3
> ??? Tried to write blank entry=REQUIRES for
> pkg=app-benchmarks/cpuburn-1.4a-r3. Likely harmless. Skipping entry.
> >>> Generated fixed VDB files for app-benchmarks/cpuburn-1.4a-r3
> 
> >>> Written to output directory: /tmp/tmpkhjh90gf
> # 
> 
> I then continued to complete the process per the news article.
> 
> I also re-ran the process and it did not identify any broken packages.
> 
> Please commit the change.

Thanks for testing, and of course, I will.

> 
> One query - given cpuburn is a binary only package, surely an emerge world
> is not required afterwards as the article suggests?


Correct, yeah.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-03 23:36:16 UTC
Done in 0.0.9, thanks!
Comment 9 Aidan Marks 2021-10-06 00:35:18 UTC
Thank you Sam :)