Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000624bareos-core[All Projects] directorpublic2016-02-19 15:072016-10-13 11:55
Reportermonotek 
Assigned Tojoergs 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version14.04
Product Version15.2.2 
Target VersionFixed in Version15.2.4 
Summary0000624: Memory leak in bareos-dir
DescriptionI have a bareos 15.2 director on Ubuntu 14.04 using packages from the official Bareos repositorys.

After some days of successful backups my VM, which has the bareos-dir running, is running out of ram.

PS shows that bareos-dir is consuming most of the RAM. Restarting bareos-dir solves the problem for the moment but we don't like to have to do this every x days.



Steps To Reproducepid=`pgrep bareos-dir` ; for i in `seq -w 1000` ; do echo -e "list jobs\n" | bconsole > /dev/null ; echo $i ; echo "$i `ps -p $pid -o pmem=,vsz=` " >> /tmp/bareos_dir_memcount ; done

This shows increasing memory in director:
0001 1.0 719564
0002 1.0 719564
0003 1.0 719564
0004 1.0 719564
0005 1.1 727760
...
0988 1.4 746064
0989 1.4 746064
0990 1.4 754260
0991 1.4 762456
0992 1.5 770652
0993 1.5 770652
0994 1.5 770652
0995 1.5 770652
0996 1.5 778848
0997 1.5 787044
0998 1.5 795240
0999 1.5 770652
1000 1.5 770652
TagsNo tags attached.
bareos-master: impactyes
bareos-master: actionfixed
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: impactyes
bareos-15.2: actionfixed
bareos-14.2: impactno
bareos-14.2: action
bareos-13.2: impactno
bareos-13.2: action
bareos-12.4: impactno
bareos-12.4: action
Attached Files

- Relationships
child of 0000641closedmaik Release bareos-15.2.4 

-  Notes
(0002202)
monotek (reporter)
2016-02-24 12:40

I investigated a bit further and i think i found the problem. I was wondering, why bareos-dir also consumes more ram, when there actually are no backups running.

It seems bconsole is responsible for the problem. I use it for an Icinga Monitoring check. After the last bareos-dir crash i've disabled this check and ram stays now at the same level for some hours.
(0002203)
maik (administrator)
2016-02-25 17:14

Could you add the Icinga Script you are using, or at least the bconsole commands? How frequently are you running the script?
(0002205)
monotek (reporter)
2016-02-25 18:17

Its an Icinga check. So i think around every 5 to 10 minutes.

This is the check command i'm using:


[code]
#!/bin/bash
#
# nagios check bareos status
#

WARN="$1"
CRIT="$2"
DATE="$(date +"%Y-%m-%d")"

if [ -z $1 ]; then
    echo "Usage: $0 WARN CRIT"
    exit 3;
elif [ -z $2 ]; then
    echo "Usage: $0 WARN CRIT"
    exit 3;
fi

# mysql
#STATUS="$(mysql --defaults-file=/etc/mysql/debian.cnf -B -N -e "SELECT COUNT(*) FROM Job WHERE JobStatus != 'T' AND SchedTime LIKE '${DATE} %'" bacula)"

# postgresql
#STATUS=$(psql -t -d bareos -c "SELECT COUNT(*) FROM job WHERE jobstatus != 'T' AND schedtime::text LIKE '2016-02-24%';" | sed 's/\s//g')

# bconsole
STATUS="$(echo "list jobs" | bconsole | sed -n '10,$p' | grep -v "You have messages" | head -n -1 | grep ${DATE} | sed -e 's/.* | //g' -e 's/|//g' | grep -v T | wc -l)"

OUTPUT="STATUS=${STATUS};${WARN};${CRIT}"

if [ -z "${STATUS}" ]; then
    echo "Error - No Status found!"
    exit 3
elif [ ${STATUS} -ge ${CRIT} ]; then
    echo "CRIT - Errors = ${STATUS}|${OUTPUT}"
    exit 2
elif [ ${STATUS} -ge ${WARN} ]; then
    echo "WARN - Errors = ${STATUS}|${OUTPUT}"
    exit 1
fi

echo "Bareos run OK! Errors = ${STATUS}|${OUTPUT}"

exit 0

[/code]

i switched to the postgresql version now.
(0002388)
maik (administrator)
2016-10-13 11:55

Closed, release done

- Related Changesets
bareos: master 44f903a3
Timestamp: 2016-04-21 16:34:02
Author: joergs
Committer: mvwieringen
Ported: N/A
Details ] Diff ]
json output: create json objects only if required

Issues 0000624: Memory leak in bareos-dir
mod - src/lib/output_formatter.c Diff ] File ]

- Issue History
Date Modified Username Field Change
2016-02-19 15:07 monotek New Issue
2016-02-24 12:40 monotek Note Added: 0002202
2016-02-25 17:14 maik Note Added: 0002203
2016-02-25 17:14 maik Assigned To => maik
2016-02-25 17:14 maik Status new => feedback
2016-02-25 17:15 maik Assigned To maik =>
2016-02-25 17:15 maik Status feedback => acknowledged
2016-02-25 18:17 monotek Note Added: 0002205
2016-02-29 12:08 maik bareos-15.2: impact => yes
2016-02-29 12:08 maik bareos-15.2: action => will care
2016-02-29 12:08 maik Priority high => normal
2016-02-29 12:08 maik Status acknowledged => confirmed
2016-02-29 12:08 maik Product Version => 15.2.2
2016-02-29 12:08 maik Steps to Reproduce Updated View Revisions
2016-02-29 14:38 maik bareos-master: impact => yes
2016-02-29 14:38 maik bareos-master: action => will care
2016-04-21 16:28 joergs Assigned To => joergs
2016-04-21 16:28 joergs Status confirmed => assigned
2016-04-29 17:38 mvwieringen Changeset attached => bareos master 44f903a3
2016-06-13 14:42 joergs bareos-master: action will care => fixed
2016-06-13 14:42 joergs bareos-15.2: action will care => fixed
2016-06-13 14:42 joergs Status assigned => resolved
2016-06-13 14:42 joergs Fixed in Version => 15.2.4
2016-06-13 14:42 joergs Resolution open => fixed
2016-06-13 14:43 joergs Relationship added child of 0000641
2016-07-05 13:32 joergs bareos-14.2: impact => no
2016-07-05 13:32 joergs bareos-13.2: impact => no
2016-07-05 13:32 joergs bareos-12.4: impact => no
2016-10-13 11:55 maik Note Added: 0002388
2016-10-13 11:55 maik Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker