Received: from primeraholten.nl (235-230-138-45.connected.by.freedominter.net [45.138.230.235]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTP id 3900F2264C6 for <~alpine/apk-tools@lists.alpinelinux.org>; Tue, 7 Jan 2025 10:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=primeraholten.nl; s=default; t=1736245949; bh=Axq9VkWlLiRBkGiOJe1ctsioPs7QRJVDWDfT5FnrcVg=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=mdl4yx/iUYEVNfvp0hm755hPE4DSsFk4WJx6x5t+b4BHQJWu2YDg7F840uiO+FKy4 eKP+eSEM4DSbgTLVEY2UcraaLpd5mQVjEnd3rduUkHkHdxi9YpydJlxX01LQCkN3vK TBMeCGituzhxxsj7EMNZlKACZZ9UisEGgBqWxM9bV8yCX1/1/Uzs0n0QvOpSfi4g7l d12gna4qcK6+3LyDNfXGQGmfhJpGXUC+yd3K5+rFTAL7jYcdgvOmWoEhoSYCucuvGl Wwfg8yIq5JzsAk9qNZ3hj239V2TKXh5OPvcxSnruzTB+WvQxmpj6UtBb0m4ucUjgXV 4dsVSDPTClKCA== Date: Tue, 07 Jan 2025 10:32:28 +0000 From: Arjan Bouter To: Timo Teras CC: ~alpine/apk-tools@lists.alpinelinux.org Subject: Re: apk rebuild database? In-Reply-To: <20250107104248.46cd4cee@onyx.my.domain> References: <20250106185651.69029a37@tonberry> <20250107104248.46cd4cee@onyx.my.domain> Message-ID: <00284195-411C-4364-8D42-66F51B7E53E8@primeraholten.nl> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----ZZWYKLR7ZTYSUKWCS1BVEPCZ5EHC30 Content-Transfer-Encoding: 7bit ------ZZWYKLR7ZTYSUKWCS1BVEPCZ5EHC30 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Not what I wanted to hear, lol=2E after a bit of digging it looks like apk fails to read scripts=2Etar=2E Removing the offending entry mentioned by strace, the first entry, makes i= t complain about the next entry Renaming lets me "apk update" again, but apk throws "error: unabe to selec= t packages", which makes sense=2E from the looks of it, there is nothing strange about the contents of scrip= ts=2Etar=2E Is there any way to learn why and on what it trips? As for the cause, an empty battery in my laptop during an update=2E One of these I-m-sure-it's-plugged-in moments=2E=2E=2E Thanks for the help, Arjan Timo Teras schreef op 7 januari 2025 08:42:48 UTC: >On Mon, 6 Jan 2025 18:56:51 +0100 >Arjan Bouter wrote: > >> when I try to use apk to update, add or remove applications I get the >> following error: >>=20 >> ERROR: Unable to read database state: package file format error >> ERROR: Failed to open apk database: package file format error >>=20 >> Strace shows a bit more info: >>=20 >> read(7, "C:Q1DAq8+0eVL2Ce+rsHzYHUPCmuEy8=3D"=2E=2E=2E, 131072) =3D 1310= 72 >> close(7) =3D 0 >> munmap(0x7f5d4fdd3000, 135168) =3D 0 >> writev(2, [{iov_base=3D"", iov_len=3D0}, {iov_base=3D"ERROR: ", iov_len= =3D7}], >> 2) =3D 7 writev(2, [{iov_base=3D"Unable to read database state: p"=2E= =2E=2E, >> iov_len=3D56}, {iov_base=3DNULL, iov_len=3D0}], 2) =3D 56 writev(2, >> [{iov_base=3D"", iov_len=3D0}, {iov_base=3D"\n", iov_len=3D1}], 2) =3D = 1 >>=20 >> Is there a way to recreate the database state file? > >Generally only by reinstalling the system=2E Any idea how it went to this >state? Maybe its possible to fix it manually=2E > >Timo > ------ZZWYKLR7ZTYSUKWCS1BVEPCZ5EHC30 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Not what I wanted to hear, lol= =2E

after a bit of digging it looks like apk fails to read scripts= =2Etar=2E
Removing the offending entry mentioned by strace, the first en= try, makes it complain about the next entry
Renaming lets me "apk update= " again, but apk throws "error: unabe to select packages", which makes sens= e=2E

from the looks of it, there is nothing strange about the conten= ts of scripts=2Etar=2E
Is there any way to learn why and on what it trip= s?

As for the cause, an empty battery in my laptop during an update= =2E
One of these I-m-sure-it's-plugged-in moments=2E=2E=2E

Thanks= for the help,
Arjan


Timo Teras <timo=2Eteras@iki=2Efi> schreef op 7 januari 20= 25 08:42:48 UTC:
On Mon, 6 Jan 2025 18:56:51 +0100<= br>Arjan Bouter <arjan@primeraholten=2Enl> wrote:

when I try to = use apk to update, add or remove applications I get the
following error:=

ERROR: Unable to read database state: package file format error
= ERROR: Failed to open apk database: package file format error

Strace= shows a bit more info:

read(7, "C:Q1DAq8+0eVL2Ce+rsHzYHUPCmuEy8=3D"= =2E=2E=2E, 131072) =3D 131072
close(7) = =3D 0
munmap(0x7f5d4fdd3000, 135168) =3D 0
writev(2, [{iov_b= ase=3D"", iov_len=3D0}, {iov_base=3D"ERROR: ", iov_len=3D7}],
2) =3D 7 w= ritev(2, [{iov_base=3D"Unable to read database state: p"=2E=2E=2E,
iov_l= en=3D56}, {iov_base=3DNULL, iov_len=3D0}], 2) =3D 56 writev(2,
[{iov_bas= e=3D"", iov_len=3D0}, {iov_base=3D"\n", iov_len=3D1}], 2) =3D 1

Is t= here a way to recreate the database state file?

Generally only by reinstalling the system=2E Any idea how = it went to this
state? Maybe its possible to fix it manually=2E

T= imo

------ZZWYKLR7ZTYSUKWCS1BVEPCZ5EHC30--