View Issue Details

IDProjectCategoryView StatusLast Update
0001080bareos-coredirectorpublic2023-10-24 09:18
Reporterunki Assigned Toarogge  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionunable to reproduce 
PlatformLinuxOSDebianOS Version9
Product Version18.2.5 
Summary0001080: Error on 'JobBytes sum select' during backup-job was running
DescriptionDuring an backup-job running - a Differential backup that was just on the way getting finished - `bareos-dir` crashed (segmentation violation) leaving back only these log lines:

```
24-Apr 10:17 backupsrv-sd JobId 19706: Releasing device "DiffPool4" (/srv/bareos/pool).
24-Apr 10:17 backupsrv-sd JobId 19706: Elapsed time=35:10:48, Transfer rate=516.4 K Bytes/second
24-Apr 10:17 bareos-dir JobId 19706: Insert of attributes batch table with 197406 entries start
24-Apr 10:17 bareos-dir JobId 19706: Insert of attributes batch table done
24-Apr 10:17 bareos-dir JobId 19706: Fatal error: cats/sql_get.cc:1481 cats/sql_get.cc:1481 query SELECT SUM(JobBytes) FROM Job WHERE ClientId = 119 AND JobId != 19706 AND SchedTime > TIMESTAMP '1577823450-01-00 03:38:02' failed:
ERROR: date/time field value out of range: "1577823450-01-00 03:38:02"
LINE 1: ...AND JobId != 19706 AND SchedTime > TIMESTAMP '157782345...
                                                             ^
HINT: Perhaps you need a different "datestyle" setting.

24-Apr 10:17 bareos-dir JobId 19706: Error: JobBytes sum select failed: ERR=
24-Apr 10:17 bareos-dir JobId 19706: Warning: Error getting Quota value: ERR=JobBytes sum select failed: ERR=
```

followed by

```
Apr 24 10:17:51 backup2 bareos-dir[6647]: BAREOS interrupted by signal 11: Segmentation violation
```

Somehow this UNIX-timestamp made it into the datatime-string.

It's Bareos v18.2.5 using a PostgreSQL database (9.6.11) on Debian Stretch (9.8).
Additional InformationIt is possibly this SQL Query - defined in `core/src/cats/postgresql_queries.inc`

```
/* 0059_get_quota_jobbytes.postgresql */
"SELECT SUM(JobBytes) "
  "FROM Job "
 "WHERE ClientId = %s "
   "AND JobId != %s "
   "AND SchedTime > TIMESTAMP '%s' "
,
```
TagsNo tags attached.

Activities

arogge

arogge

2019-07-12 10:31

manager   ~0003448

this is one of these "i looked at the code and this cannot happen" issues.

The timestamp is calculated and then converted to a datetime string before being injected into the query, so what you observed should be impossible.
Is this somehow reproducible?
unki

unki

2019-08-01 07:14

reporter   ~0003547

No, luckily this never occurred again - I guess you can feel free to close this issue :)
unki

unki

2019-08-07 08:39

reporter   ~0003558

Just this morning this issue hits me again - unbelievable :)

It's still on bareos v18.2.5.

this message was logged into syslog

Aug 07 08:20:45 backup2 bareos-dir[663]: BAREOS interrupted by signal 11: Segmentation violation

this in /var/log/bareos/bareos.log

07-Aug 08:20 backup-sd JobId 33591: Releasing device "DiffPool4" (/srv/bareos/pool).
07-Aug 08:20 backup-sd JobId 33591: Elapsed time=129:15:39, Transfer rate=1.745 M Bytes/second
07-Aug 08:20 bareos-dir JobId 33591: Insert of attributes batch table with 7017 entries start
07-Aug 08:20 bareos-dir JobId 33591: Insert of attributes batch table done
07-Aug 08:20 bareos-dir JobId 33591: Fatal error: cats/sql_get.cc:1481 cats/sql_get.cc:1481 query SELECT SUM(JobBytes) FROM Job WHERE ClientId = 119 AND JobId != 33591 AND SchedTime > TIMESTAMP '1577823450-01-00 01:40:56' failed:
ERROR: date/time field value out of range: "1577823450-01-00 01:40:56"
LINE 1: ...AND JobId != 33591 AND SchedTime > TIMESTAMP '157782345...
                                                             ^
HINT: Perhaps you need a different "datestyle" setting.

07-Aug 08:20 bareos-dir JobId 33591: Error: JobBytes sum select failed: ERR=
07-Aug 08:20 bareos-dir JobId 33591: Warning: Error getting Quota value: ERR=JobBytes sum select failed: ERR=

Issue History

Date Modified Username Field Change
2019-04-24 12:49 unki New Issue
2019-07-12 10:31 arogge Status new => feedback
2019-07-12 10:31 arogge Note Added: 0003448
2019-08-01 07:14 unki Note Added: 0003547
2019-08-01 07:14 unki Status feedback => new
2019-08-01 09:03 arogge Assigned To => arogge
2019-08-01 09:03 arogge Status new => resolved
2019-08-01 09:03 arogge Resolution open => unable to reproduce
2019-08-01 09:04 arogge Status resolved => closed
2019-08-07 08:39 unki Status closed => new
2019-08-07 08:39 unki Resolution unable to reproduce => reopened
2019-08-07 08:39 unki Note Added: 0003558
2023-10-24 09:18 arogge Status new => resolved
2023-10-24 09:18 arogge Resolution reopened => unable to reproduce
2023-10-24 09:18 arogge Status resolved => closed