Re: database problem update after upgrade to 15.0.2

Marcin Haba <[email protected]> Sat, 18 May 2024 10:37:39 +0200
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Message-ID <CAOqQBvObhOq462ORiTDeNz=ioF_gbW54pKW1yzAts0wiCFpOsQ@mail.gmail.com>
--===============1585443018597765436==
Content-Type: multipart/alternative; boundary="00000000000036b50b0618b662ea"

--00000000000036b50b0618b662ea
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello Ulrich,

I know this problem. I found and reported it a year ago. You can read about
it here:

https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/issue=
s/2684

Best regards,
Marcin Haba (gani)

On Sat, 18 May 2024 at 10:18, Ulrich Leodolter <[email protected]>
wrote:

> hi,
>
> after upgrading to verions 15.0.2 our nightly update stats job failed:
>
> 18-May 06:15 vlbackup.obvsg.at-dir JobId 0: Fatal error: bdb.h:146
> bdb.h:146 query INSERT INTO JobHisto (JobId, Job, Name, Type,
> Level,ClientId, JobStatus,SchedTime, StartTime, EndTime, RealEndTime,
> RealStartTime, JobTDate,VolSessionId, VolSessionTime, JobFiles, JobBytes,
> ReadBytes,JobErrors, JobMissingFiles, PoolId, FileSetId, PriorJobId,
> PriorJob, PurgedFiles, HasBase, HasCache, Reviewed, Comment, FileTable,
> isVirtualFull,CompressRatio,Rate,LastReadStorageId,WriteStorageId,LastRea=
dDevice,WriteDevice,StatusInfo,Encrypted)SELECT
> JobId, Job, Name, Type, Level, ClientId, JobStatus,SchedTime, StartTime,
> EndTime, RealEndTime, RealStartTime, JobTDate,VolSessionId, VolSessionTim=
e,
> JobFiles, JobBytes, ReadBytes,JobErrors, JobMissingFiles, PoolId,
> FileSetId, PriorJobId, PriorJob, PurgedFiles, HasBase, HasCache, Reviewed=
,
> Comment, FileTable,
> isVirtualFull,CompressRatio,Rate,LastReadStorageId,WriteStorageId,LastRea=
dDevice,WriteDevice,StatusInfo,Encrypted
> FROM Job WHERE JobStatus IN ('T','W','f
> ,'A','E')AND NOT EXISTS (SELECT JobHisto.JobId FROM JobHisto WHERE
> JobHisto.Jobid=3DJob.JobId)AND JobTDate < 1715746502  failed:
> Unknown column 'FileTable' in 'field list'
>
> after upgrading to version 15.0.2 i have updated the database using the
> update_mysql_tables which is installed into scripts directory.
>
> the source code of this script is bacula/src/cats/update_mysql_tables.in,
> but there are also scripts to upgrade between specific versions in
> bacula/updatedb.
>
> it seems these update scripts are not in sync because only
>  bacula/src/cats/update_mysql_tables.in contains the FileTable update:
>
> ALTER TABLE Job ADD COLUMN FileTable CHAR(20) default 'File';
> ALTER TABLE JobHisto ADD COLUMN FileTable CHAR(20) default 'File';
>
> there is no such alter FileTable in any of the bacula/updatedb scripts.
>
> it seems it is not a good idea to use scripts from bacula/updatedb after
> version upgrade because of missing changes, is that correct?
>
> i have now added the columns manually und update stats job runs with
> problems, but i need now the check the complete schema because i am unsur=
e
> which scripts i used in the past.
>
> Best regards
> Ulrich
> _______________________________________________
> Bacula-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-devel
>


--=20

"Greater love hath no man than this, that a man lay down his life for
his friends." Jesus Christ

"Wi=C4=99kszej mi=C5=82o=C5=9Bci nikt nie ma nad t=C4=99, jak gdy kto =C5=
=BCycie swoje k=C5=82adzie
za przyjaci=C3=B3=C5=82 swoich." Jezus Chrystus

--00000000000036b50b0618b662ea
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello Ulrich,<br><br>I know this problem. I found and repo=
rted it a year ago. You can read about it here:<br><br><a href=3D"https://g=
itlab.bacula.org/bacula-community-edition/bacula-community/-/issues/2684">h=
ttps://gitlab.bacula.org/bacula-community-edition/bacula-community/-/issues=
/2684</a><br><br>Best regards,<br>Marcin Haba (gani)<br></div><br><div clas=
s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, 18 May 2024=
 at 10:18, Ulrich Leodolter &lt;<a href=3D"mailto:[email protected]=
">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex"><div class=3D"msg3723570689341726283">




<div dir=3D"ltr">
<div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali=
bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
hi,</div>
<div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali=
bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali=
bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
after upgrading to verions 15.0.2 our nightly update stats job failed:</div=
>
<div style=3D"font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Cali=
bri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">18-May 06:15 vlbackup.obv=
sg.at-dir JobId 0: Fatal error: bdb.h:146 bdb.h:146 query INSERT INTO JobHi=
sto (JobId, Job, Name, Type, Level,ClientId, JobStatus,SchedTime, StartTime=
, EndTime, RealEndTime, RealStartTime,
 JobTDate,VolSessionId, VolSessionTime, JobFiles, JobBytes, ReadBytes,JobEr=
rors, JobMissingFiles, PoolId, FileSetId, PriorJobId, PriorJob, PurgedFiles=
, HasBase, HasCache, Reviewed, Comment, FileTable, isVirtualFull,CompressRa=
tio,Rate,LastReadStorageId,WriteStorageId,LastReadDevice,WriteDevice,Status=
Info,Encrypted)SELECT
 JobId, Job, Name, Type, Level, ClientId, JobStatus,SchedTime, StartTime, E=
ndTime, RealEndTime, RealStartTime, JobTDate,VolSessionId, VolSessionTime, =
JobFiles, JobBytes, ReadBytes,JobErrors, JobMissingFiles, PoolId, FileSetId=
, PriorJobId, PriorJob, PurgedFiles,
 HasBase, HasCache, Reviewed, Comment, FileTable, isVirtualFull,CompressRat=
io,Rate,LastReadStorageId,WriteStorageId,LastReadDevice,WriteDevice,StatusI=
nfo,Encrypted FROM Job WHERE JobStatus IN (&#39;T&#39;,&#39;W&#39;,&#39;f</=
span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">,&#39;A&#39;,&#39;E&#39;)=
AND NOT EXISTS (SELECT JobHisto.JobId FROM JobHisto WHERE JobHisto.Jobid=3D=
Job.JobId)AND JobTDate &lt; 1715746502=C2=A0 failed:</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">Unknown column &#39;FileT=
able&#39; in &#39;field list&#39;</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">after upgrading to versio=
n 15.0.2 i have updated the database using the update_mysql_tables which is=
 installed into scripts directory.</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">the source code of this s=
cript is bacula/src/cats/<a href=3D"http://update_mysql_tables.in" target=
=3D"_blank">update_mysql_tables.in</a>,=C2=A0 but there are also scripts to=
 upgrade between specific versions in bacula/updatedb.</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">it seems these update scr=
ipts are not in sync because only =C2=A0bacula/src/cats/<a href=3D"http://u=
pdate_mysql_tables.in" target=3D"_blank">update_mysql_tables.in</a> contain=
s the FileTable update:</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">ALTER TABLE Job ADD COLUM=
N FileTable CHAR(20) default &#39;File&#39;;<br>
ALTER TABLE JobHisto ADD COLUMN FileTable CHAR(20) default &#39;File&#39;;<=
/span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">there is no such alter Fi=
leTable in any of the bacula/updatedb scripts.</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">it seems it is not a good=
 idea to use scripts from bacula/updatedb after version upgrade because of =
missing changes, is that correct?</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">i have now added the colu=
mns manually und update stats job runs with problems, but i need now the ch=
eck the complete schema because i am unsure which scripts i used in the pas=
t.</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)"><br>
</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">Best regards</span></div>
<div style=3D"font-size:14.6667px;color:rgb(0,0,0)">
<span style=3D"background-color:rgb(255,255,255)">Ulrich</span></div>
</div>

_______________________________________________<br>
Bacula-devel mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Bac=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/bacula-devel" rel=
=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi=
nfo/bacula-devel</a><br>
</div></blockquote></div><br clear=3D"all"><div><br></div><span class=3D"gm=
ail_signature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signatu=
re"><div dir=3D"ltr"><pre>&quot;Greater love hath no man than this, that a =
man lay down his life for his friends.&quot; Jesus Christ

&quot;Wi=C4=99kszej mi=C5=82o=C5=9Bci nikt nie ma nad t=C4=99, jak gdy kto =
=C5=BCycie swoje k=C5=82adzie za przyjaci=C3=B3=C5=82 swoich.&quot; Jezus C=
hrystus</pre></div></div>

--00000000000036b50b0618b662ea--


--===============1585443018597765436==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1585443018597765436==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

--===============1585443018597765436==--