database problem update after upgrade to 15.0.2

Ulrich Leodolter <[email protected]> Sat, 18 May 2024 06:41:49 +0000
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Message-ID <PAXPR09MB65299EEADAD0E22B03E5388BEBEF2@PAXPR09MB6529.eurprd09.prod.outlook.com>
--===============0160283116583647385==
Content-Language: de-AT
Content-Type: multipart/alternative;
	boundary="_000_PAXPR09MB65299EEADAD0E22B03E5388BEBEF2PAXPR09MB6529eurp_"

--_000_PAXPR09MB65299EEADAD0E22B03E5388BEBEF2PAXPR09MB6529eurp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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:14=
6 query INSERT INTO JobHisto (JobId, Job, Name, Type, Level,ClientId, JobSt=
atus,SchedTime, StartTime, EndTime, RealEndTime, RealStartTime, JobTDate,Vo=
lSessionId, VolSessionTime, JobFiles, JobBytes, ReadBytes,JobErrors, JobMis=
singFiles, PoolId, FileSetId, PriorJobId, PriorJob, PurgedFiles, HasBase, H=
asCache, Reviewed, Comment, FileTable, isVirtualFull,CompressRatio,Rate,Las=
tReadStorageId,WriteStorageId,LastReadDevice,WriteDevice,StatusInfo,Encrypt=
ed)SELECT JobId, Job, Name, Type, Level, ClientId, JobStatus,SchedTime, Sta=
rtTime, EndTime, RealEndTime, RealStartTime, JobTDate,VolSessionId, VolSess=
ionTime, JobFiles, JobBytes, ReadBytes,JobErrors, JobMissingFiles, PoolId, =
FileSetId, PriorJobId, PriorJob, PurgedFiles, HasBase, HasCache, Reviewed, =
Comment, FileTable, isVirtualFull,CompressRatio,Rate,LastReadStorageId,Writ=
eStorageId,LastReadDevice,WriteDevice,StatusInfo,Encrypted FROM Job WHERE J=
obStatus 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 upd=
ate_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/u=
pdatedb.

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 ve=
rsion upgrade because of missing changes, is that correct?

i have now added the columns manually und update stats job runs with proble=
ms, but i need now the check the complete schema because i am unsure which =
scripts i used in the past.

Best regards
Ulrich

--_000_PAXPR09MB65299EEADAD0E22B03E5388BEBEF2PAXPR09MB6529eurp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
hi,</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
after upgrading to verions 15.0.2 our nightly update stats job failed:</div=
>
<div class=3D"elementToProof" style=3D"font-family: Aptos, Aptos_EmbeddedFo=
nt, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; c=
olor: rgb(0, 0, 0);">
<br>
</div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">18-May 06:15 vlbackup=
.obvsg.at-dir JobId 0: Fatal error: bdb.h:146 bdb.h:146 query INSERT INTO J=
obHisto (JobId, Job, Name, Type, Level,ClientId, JobStatus,SchedTime, Start=
Time, 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 ('T','W','f</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">,'A','E')AND NOT EXIS=
TS (SELECT JobHisto.JobId FROM JobHisto WHERE JobHisto.Jobid=3DJob.JobId)AN=
D JobTDate &lt; 1715746502&nbsp; failed:</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">Unknown column 'FileT=
able' in 'field list'</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">after upgrading to ve=
rsion 15.0.2 i have updated the database using the update_mysql_tables whic=
h is installed into scripts directory.</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">the source code of th=
is script is bacula/src/cats/update_mysql_tables.in,&nbsp; but there are al=
so scripts to upgrade between specific versions in bacula/updatedb.</span><=
/div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">it seems these update=
 scripts are not in sync because only &nbsp;bacula/src/cats/update_mysql_ta=
bles.in contains the FileTable update:</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">ALTER TABLE Job ADD C=
OLUMN FileTable CHAR(20) default 'File';<br>
ALTER TABLE JobHisto ADD COLUMN FileTable CHAR(20) default 'File';</span></=
div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">there is no such alte=
r FileTable in any of the bacula/updatedb scripts.</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; 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 class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">i have now added the =
columns manually und update stats job runs with problems, but i need now th=
e check the complete schema because i am unsure which scripts i used in the=
 past.</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);"><br>
</span></div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">Best regards</span></=
div>
<div class=3D"elementToProof" style=3D"font-family: &quot;Segoe UI&quot;, &=
quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-syste=
m, BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; font=
-size: 14.6667px; color: rgb(0, 0, 0);">
<span style=3D"background-color: rgb(255, 255, 255);">Ulrich</span></div>
</body>
</html>

--_000_PAXPR09MB65299EEADAD0E22B03E5388BEBEF2PAXPR09MB6529eurp_--


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


--===============0160283116583647385==
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

--===============0160283116583647385==--