Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 559982 - app-backup/bacula-7.2.0 fails to upgrade SQLite database
Summary: app-backup/bacula-7.2.0 fails to upgrade SQLite database
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Beierlein
URL: http://bugs.bacula.org/view.php?id=2165
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-08 20:26 UTC by Karl-Johan Karlsson
Modified: 2015-12-27 17:39 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl-Johan Karlsson 2015-09-08 20:26:14 UTC
After upgrading from app-backup/bacula-7.0.5-r1 to 7.2.0, I tried to upgrade my existing SQLite database. This failed:

# /usr/libexec/bacula/update_bacula_tables
Altering sqlite3 tables
 
This script will update a Bacula MySQL database from version 12-14 to 15
 
Depending on the current version of your catalog, you may have to run this script
        multiple times
 
Error: near line 7: near "CHANGE": syntax error
Error: near line 9: near ";": syntax error
Error: near line 14: near "CreateTDate": syntax error
Error: near line 25: near "(": syntax error
/usr/libexec/bacula/update_sqlite3_tables: line 112: END-OF-DATA: command not found

One obvious error is that /usr/libexec/bacula/update_sqlite3_tables contains a ; instead of a , in the CREATE TABLE statement on lines 43-57 (line "FileSetId INTEGER UNSIGNED DEFAULT 0;").

I haven't yet investigated whether changing this solves the problem or reported the issue upstream, since this late at night I prioritised downgrading to get working backups.

Reproducible: Always




Portage 2.2.20.1 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.21-r1, 4.1.5-hardened-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.1.5-hardened-r1-x86_64-AMD_Phenom-tm-_II_X4_905e_Processor-with-gentoo-2.2
KiB Mem:     7906648 total,    848428 free
KiB Swap:   16760828 total,  16590384 free
Timestamp of repository gentoo: Mon, 07 Sep 2015 01:00:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.2::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

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

sunrise
    location: /var/lib/layman/sunrise
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/sunrise-reviewed.git
    masters: gentoo
    priority: 50

Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fweb -ftracer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fweb -ftracer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --keep-going --quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.sunet.se/pub/Linux/distributions/gentoo/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--enable-new-dtags"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
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"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow X a52 aac acl amd64 apache apache2 apng bash-completion berkdb bluray bzip2 cjk cli consolekit cracklib crypt cups cvs cxx dbus device-mapper dirac doc dri dts dvd emacs exif flac gdbm gif git glitz gpm gtk hal hardened iconv idn ipv6 jpeg justify kde kdehiddenvisibility kvm mad mmx mmxext mng modules mp3 mpeg multilib musepack mysql ncurses nls nptl offensive ogg opengl openmp orc pam pax_kernel pcre pie png postgres qemu qt qt3 qt3support qt4 raw readline rtmp rtsp schroedinger sdl seccomp semantic-desktop session speex sse sse2 ssl ssp subversion svg tcpd theora tiff truetype unicode urandom usb vhosts vorbis wxwindows x264 xattr xcb xft xinerama xtpax xvid zip zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbd authn_default authn_file authz_default authz_groupfile authz_host authz_owner authz_user autoindex cgi dav dav_fs dav_lock dbd dir env expires include info log_config logio mime mime_magic negotiation rewrite setenvif status userdir authn_core authz_core unixd socache_shmcb" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB sv sv_SE" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

app-backup/bacula-7.2.0::gentoo was built with the following:
USE="X acl -bacula-clientonly -bacula-nodir -bacula-nosd -examples -ipv6 -logwatch -mysql -postgres qt4 readline sqlite ssl -static tcpd -vim-syntax" ABI_X86="64"


app-backup/bacula-7.0.5-r1::gentoo was built with the following:
USE="X acl -bacula-clientonly -bacula-nodir -bacula-nosd -examples -ipv6 -logwatch -mysql -postgres qt4 readline sqlite ssl -static tcpd -vim-syntax" ABI_X86="64"


dev-db/sqlite-3.8.11.1::gentoo was built with the following:
USE="-debug doc -icu readline secure-delete -static-libs tcl -test -tools" ABI_X86="-32 64 -x32"
Comment 1 Thomas Beierlein gentoo-dev 2015-09-09 05:20:23 UTC
Please report upstream. The unified upgrade scripts are very new in bacula 7.2.0.
Maybe they contain errors here.

And be aware of the einfo warning about sqlite not being officially supported - see bug 445540.
Comment 2 Karl-Johan Karlsson 2015-09-09 07:23:07 UTC
Upstream report, with patch: http://bugs.bacula.org/view.php?id=2165
Comment 3 Thomas Beierlein gentoo-dev 2015-09-09 11:57:02 UTC
(In reply to Karl-Johan Karlsson from comment #2)
> Upstream report, with patch: http://bugs.bacula.org/view.php?id=2165

Just seen it. Please keep me informed if the patch gets approved. I will add it then to the ebuild.
Comment 4 Karl-Johan Karlsson 2015-12-27 17:39:31 UTC
A slightly modified version of the patch has been accepted upstream and will be in the 7.2.1 release: http://www.bacula.org/git/cgit.cgi/bacula/commit/?h=Branch-7.2&id=8aca3ab7b9f10d54da12eb6c8ced5f012eb6aa79