[pacman-dev] error handling in libdownlad / libalpm

Roman Kyrylych roman.kyrylych at gmail.com
Sat Apr 28 07:00:55 EDT 2007


Hi!

This is what I've encountered today:

[root at home ~]# pacman -Syuw
:: Synchronizing package databases...
 current                   73,3K   14,6K/s 00:00:05 [#####################] 100%
 extra                    283,0K    8,2K/s 00:00:35 [#####################] 100%
error: could not open /var/lib/pacman/community.db.tar.gz: Empty input
file: Invalid or incomplete multibyte or wide character

error:
         failed to update community (unexpected system error)
error: failed retrieving file 'unstable.db.tar.gz' from
ftp.archlinux.org : Unknown FTP error
error:
         failed to synchronize unstable: Unknown FTP error


then I just Ctrl-C as it was clear my connection suddenly died
Ugly error reporting about unstable.db.tar.gz is not a big deal, but
what is baf is community.db.tar.gz - it is created with 0 bytes size.

[root at home ~]# ls -l /var/lib/pacman/
total 212
drwxr-xr-x    2 root root 61440 2007-04-28 13:43 community
-rw-r--r--    1 root root     0 2007-04-28 13:42 community.db.tar.gz
drwxr-xr-x  567 root root 28672 2007-04-28 13:40 current
drwxr-xr-x 2020 root root 81920 2007-04-28 13:40 extra
drwxr-xr-x  531 root root 24576 2007-04-25 00:27 local
drwxr-xr-x    4 root root  4096 2007-04-09 14:55 romashka
drwxr-xr-x    9 root root  4096 2007-04-25 00:24 testing
drwxr-xr-x   61 root root  4096 2007-04-25 00:22 unstable

And then:

[root at home ~]# pacman -Syuw
:: Synchronizing package databases...
 current is up to date
 extra is up to date
 community is up to date
 unstable                   8,9K   43,4K/s 00:00:00 [#####################] 100%
 testing                    1,7K   14,2M/s 00:00:00 [#####################] 100%

Of course 0-byte community.db.tar.gz passes datetime check here :-)

When connection dies libdownload/libalpm should _not_ create broken db.tar.gz
Either it should be valid or not existing (deleted, or better - not
created at all).

-- 
Roman Kyrylych (Роман Кирилич)


More information about the pacman-dev mailing list