Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000923bareos-core[All Projects] directorpublic2018-03-02 16:342018-03-02 16:34
Reporterkjetilho 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformLinuxOSanyOS Version3
Product Version16.2.7 
Target VersionFixed in Version 
Summary0000923: sql_query retry hides real error
DescriptionI was getting a puzzling error:

'INSERT INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM batch) as a WHERE NOT EXISTS (SELECT Name FROM Filename WHERE Name = a.Name)'

this failed with ERR=ERROR: relation "batch" does not exist

The *actual* error did not become apparent before I turned on logging in PostgreSQL:

 LOG: statement: INSERT INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM batch) as a WHERE NOT EXISTS (SELECT Name FROM Filen
ame WHERE Name = a.Name)
 ERROR: integer out of range
 STATEMENT: INSERT INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM batch) as a WHERE NOT EXISTS (SELECT Name FROM Filename W
HERE Name = a.Name)
 LOG: statement: SET datestyle TO 'ISO, YMD'
 LOG: statement: SET cursor_tuple_fraction=1
 LOG: statement: SET standard_conforming_strings=on
 LOG: statement: INSERT INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM batch) as a WHERE NOT EXISTS (SELECT Name FROM Filen
ame WHERE Name = a.Name)
 ERROR: relation "batch" does not exist at character 75

in other words, the root cause was that filenameid now needs to be bigger than integer on my system. that exact problem has obviously been fixed in Bareos 17, but the retry logic may need a closer look anyway.
Steps To Reproducebump up filenameid sequence, do a backup jobs with spooled attributes.
Additional Informationhere's the log from 16.2.6. the logic is the same in 16.2.7 as far as I can tell:

02-Mar-2018 15:29:53.283258 dump-dir (500): postgresql.c:622-2024858 sql_query starts with 'INSERT INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM batch) as a WHERE NOT EXIS
TS (SELECT Name FROM Filename WHERE Name = a.Name)'
02-Mar-2018 15:29:53.274530 dump-dir (50): postgresql.c:665-2024858 Result status fatal: INSERT INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM batch) as a WHERE NOT EXISTS
(SELECT Name FROM Filename WHERE Name = a.Name)
02-Mar-2018 15:29:53.283130 dump-dir (50): postgresql.c:665-2024858 Result status fatal: INSERT INTO Filename (Name) SELECT a.Name FROM (SELECT DISTINCT Name FROM batch) as a WHERE NOT EXISTS
(SELECT Name FROM Filename WHERE Name = a.Name)

if I had been more eagle-eyed I could have spotted that there are two "Result status fatal", but ...
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-03-02 16:34 kjetilho New Issue


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker