Re: [Bacula-users] [SOLVED] sqlite crash in bacula-dir-1.36.2-1mdk
Hello, You need to be a bit more explicit about what is going on here. To the best of my knowledge Bacula does not use any temporary files other than what it writes the Working Directory. When Bacula is pruning, and during certain other operations, it will create temporary tables. It is my understanding that those temporary tables should go in the same file/directory as the catalog database itself. It is possible that SQLite tries to write in some files, but if that is the case, you should specify which file/files. Bacula should *never* attempt to write in the directory from which it is started unless it is incorrectly configured, so making that directory writable is not a good idea. Now, if the user or the package creator makes the serious error of pointing the Working Directory to the same place where Bacula is stored, then you will definitely have a problem. On Wednesday 18 May 2005 11:26, [EMAIL PROTECTED] wrote: Hello all, I experienced a crash (described hereafter) after editing the bacula-dir.conf file. It seems that bacula-dir needs to write some temporary files when examining/modifying its (sqlite) database . It tries to do so in the directory that was the current directory when the bacula-dir daemon started. If that directory is not writable by Bacula, a crash results. The scripts in my configuration (Mandrake) do not make sure that this is the case : so if I start bacula-dir with the usual service bacula-dir start when I am in my home directory (not writable by Bacula), it won't work. cd'ing to a directory writable by bacula and restarting the bacula-dir solves the problem. It would probably be a good idea to ensure that the temporary files bacula-dir needs are written in the same directory as the sqlite bacula.db itself. Should I submit a bug-report ? Cheers -- Jean Marc Message original Objet: [Bacula-users] sqlite crash in bacula-dir-1.36.2-1mdk De: [EMAIL PROTECTED] [EMAIL PROTECTED] Date:Mar 17 mai 2005 16:30 À: bacula-users@lists.sourceforge.net -- Hello all, On a fresh install of bacula, the following leads to a crash : - do some backup - edit bacula-dir.conf to add some files - restart bacula-dir results in this error (seen from bconsole): *status dir Using default Catalog name=MyCatalog DB=bacula Could not open database bacula. sqlite.c:151 Unable to open Database=/var/lib/bacula/bacula.db. ERR=malformed database schema - unable to open a temporary database file for storing temporary tables The only way out is to recreate the database. I don't see any permissions problems. The directory /var/lib/bacula belongs to the user bacula. /tmp and /var/tmp are writable by bacula. I cannot setdebug without getting that same error. If I use sqlite to see what's in the bacula.db, I see the database main which is in the normal place (/var/lib/bacula) and 1temp /var/tmp/sqlite_qVfam9PKLi9Sfu1 /var/tmp has this permissions (same as /tmp) drwxrwx-wt 2 root adm and there is no file /var/tmp/sqlite_qVfam9PKLi9Sfu1 Where on earth is bacula trying to create this temporary database ? And which one ? My install : Linux Mandrake 10.1 Bacula 1.36.2-1mdk from cooker What beats me is that as long as I do not change bacula-dir.conf, I can do as many backups as I want. I can stop/restart bacula-dir, all is OK. As soon as I change bacula-dir.conf, kaboom. Any hints ? Thanks in advance -- Jean-Marc --- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_idt12alloc_id344op=click ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users --- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_idt12alloc_id344opÌk ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users -- Best regards, Kern ( /\ V_V --- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_idt12alloc_id344op=click ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] [SOLVED] sqlite crash in bacula-dir-1.36.2-1mdk
Kern Sibbald wrote: Now, if the user or the package creator makes the serious error of pointing the Working Directory to the same place where Bacula is stored, then you will definitely have a problem. the working directory points to /var/lib/bacula on default installs --- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412alloc_id=16344op=click ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] [SOLVED] sqlite crash in bacula-dir-1.36.2-1mdk
Hello, (details at the end) I did an strace on bacula-dir, both from a directory not writable by bacula and from a directory writable by bacula, (I join the results) and bacula/sqlite does try to write a temp file in the current dir. I don't know whether this is a packaging pb, a Bacula pb, or a sqlite pb... Here is part of the diff between the strace results. open(./sqlite_OtfWKTMWWYwQT2u, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 8 open(./sqlite_DL1LQlVjc3m7Mtm, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = -1 EACCES (Permission denied) Then it seems (I'm not an expert) that bacula/sqlite tries successively /var/tmp /usr/tmp /tmp but for some reason thinks they are not writable (they are), I guess, and then it ends. stat64(/var/tmp, {st_mode=S_IFDIR|S_ISVTX|0773, st_size=4096, ...}) = 0 access(/var/tmp, R_OK|W_OK|X_OK) = -1 EACCES (Permission denied) stat64(/usr/tmp, {st_mode=S_IFDIR|S_ISVTX|0773, st_size=4096, ...}) = 0 access(/usr/tmp, R_OK|W_OK|X_OK) = -1 EACCES (Permission denied) stat64(/tmp, {st_mode=S_IFDIR|S_ISVTX|0773, st_size=176128, ...}) = 0 access(/tmp, R_OK|W_OK|X_OK)= -1 EACCES (Permission denied) stat64(., {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 access(., R_OK|W_OK|X_OK) = -1 EACCES (Permission denied) access(./sqlite_jF1otGrWX1AOsYg, F_OK) = -1 ENOENT (No such file or directory) access(./sqlite_jF1otGrWX1AOsYg, F_OK) = -1 ENOENT (No such file or directory) open(./sqlite_jF1otGrWX1AOsYg, O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = -1 EACCES (Permission denied) I see at the beginning if the trace diff that : getcwd(/var/lib/bacula, 1024) = 16 --- getcwd(/etc/bacula, 1024) = 12 I don't know whether this comes from Bacula or sqlite, but one of them seems to need some info about the current directory. Well, I have a workaround, so it's OK for me, but I guess that some others may have the problem too. I guess it's good to at least know it's here, so they don't' spend the time to understand it again. Hope this helps. Thanks anyway for all the work you put into Bacula ! -- Jean Marc More details - I removed all the packages I had installed from Cooker, removed /var/lib/bacula and /usr/lib/bacula so that I had no database. - I reinstalled them from LimitedEdition2005 (contrib). That made no difference, since they were binary equal anyway (I don't know why Cooker and official packages are the same) : bacula-common-1.36.2-1mdk.i586 bacula-console-1.36.2-1mdk.i586 bacula-dir-1.36.2-1mdk.i586 bacula-fd-1.36.2-1mdk.i586 bacula-sd-1.36.2-1mdk.i586 libsqlite0-2.8.16-1mdk.i586 sqlite-tools-2.8.16-1mdk.i586 - I made a change in the bacula-dir.conf file (added a file) to force bacula to modify its catalog database - I started bacula-fd and bacula-sd - I cd'ed to a directory not writable by the user bacula and started strace strace -f -e trace=file -o bacula_trace_not_writeble_current_dir.txt bacula-dir -f -u bacula -g bacula -c /etc/bacula/bacula-dir.conf - I started bconsole in an other console and typed status monitor and got the error. - I stopped the strace, cd'ed to a directory writable by bacula and did the same, and this time I got no error. To make sure that /var/tmp, /usr/tmp and /tmp are readable/writable by the user bacula, I did this : [EMAIL PROTECTED] bacula]# ls -lad /var/tmp drwxrwx-wt 2 root adm 4096 mai 18 14:21 /var/tmp/ [EMAIL PROTECTED] bacula]# ls -lad /usr/tmp lrwxrwxrwx 1 root root 10 jun 13 2004 /usr/tmp - ../var/tmp/ [EMAIL PROTECTED] bacula]# ls -lad /tmp drwxrwx-wt 6 root adm 176128 mai 18 14:58 /tmp/ [EMAIL PROTECTED] bacula]# su - bacula -bash-2.05b$ echo this is a test /var/tmp/test.txt -bash-2.05b$ cat /var/tmp/test.txt this is a test -bash-2.05b$ echo this is an other test /tmp/test.txt -bash-2.05b$ cat /tmp/test.txt this is an other test execve(/usr/sbin/bacula-dir, [bacula-dir, -f, -u, bacula, -g, bacula, -c, /etc/bacula/bacula-dir.conf], [/* 46 vars */]) = 0 open(/etc/ld.so.preload, O_RDONLY) = -1 ENOENT (No such file or directory) open(/etc/ld.so.cache, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=23119, ...}) = 0 open(/usr/lib/libsqlite.so.0, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0755, st_size=282272, ...}) = 0 open(/lib/tls/libpthread.so.0, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0755, st_size=83255, ...}) = 0 open(/lib/libnsl.so.1, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0755, st_size=69216, ...}) = 0 open(/usr/lib/libstdc++.so.6, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0755, st_size=833176, ...}) = 0 open(/lib/tls/libm.so.6, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0755, st_size=139908, ...}) = 0 open(/lib/libgcc_s.so.1, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0755, st_size=31396, ...}) = 0 open(/lib/tls/libc.so.6, O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0755, st_size=1165108, ...}) = 0 getcwd(/etc/bacula, 1024) = 12 open(/dev/null, O_RDONLY|O_LARGEFILE) = 3 open(/etc/bacula/bacula-dir.conf, O_RDONLY|O_LARGEFILE) = 3 fstat64(3,