View Issue Details

IDProjectCategoryView StatusLast Update
0001080bareos-core[All Projects] directorpublic2019-07-12 10:31
ReporterunkiAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status feedbackResolutionopen 
PlatformLinuxOSDebianOS Version9
Product Version18.2.5 
Target VersionFixed in Version 
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.
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

Activities

arogge

arogge

2019-07-12 10:31

developer   ~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?

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