Added the mt-st package to the bacula-base Dockerfile to resolve issue with autochanger #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to get my Dell PowerVault 124T working with the Docker files in this repository, I noticed that I was not able to complete the
autochangertest that is included in thebtapetool, as recommended by the Bacula documentationThe
btapetoolautochangercommand would output the following:While there was a drive loaded in drive number 0. As Bacula was wrongfully assuming that drive 0 was empty, it would try to load a drive from slot 1 into drive 0 , which would return the error
Drive 0 Full (Storage Element 1 loaded), while thebtapetool would continue reportingUntil a timeout was reached and the
autochangertest failed.The
btapeautochangerprogram calls a script/opt/bacula/scripts/mtx-changerin thebacula-sdcontainer, which is a wrapper for the genericmtxcommand. This script is used to do all the interactions with the autochanger, acting as a proxy formtx.When the
btapeautochangercommand is ran, it calls themtx-changerscript with theloadedargument to probe if the drive is loaded. It expects a return value of0if the drive is empty, and a return value of1if the drive is full. On my setup, it issued the following command:Where
dev/sg8is the autoloader SCSI device anddev/st0is the autoloader built-in SCSI tape drive.When
btapetries to run this command inside thebacula-sdcontainer, the output is not a pure1or0, but it also contains an error:As the return value now contains an error besides the return value of
1, thebtapeprogram wrongfully interprets this, thinking the drive is empty. It then tries to load a tape into the full drive, which results in theautochangertest failing.Note in the output above that the command is working correctly, as it returns a
1while my drive was loaded at the time, it just also contains the error about themtcommand, causingbtapeto interpret that the drive is emptywhile it is actually full.
The
/opt/bacula/scripts/mtx-changer.confis a configuration file for themtx-changerscript and tries to figure out what version ofmtis installed on line 84 and 89 of themtx-changer.conffile, which is where the error is generated. As themt-stpackage is not installed in thebacula-sdcontainer, the errorcommand not foundis generated, which causes the issues down the line.This pull request adds the
mt-strepository to thebacula-baseDockerfile, which prevents the error from popping up when using themtx-changerscript, which fixes the issue where theautochangertest is not able to complete because of thecommand not founderror being wrongfully interpreted bybtapeas the autochanger having an empty drive, to which it tries to load a drive into an already occupied drive, failing the test.The fact that
btapewrongfully interprets the error generated by the themtx-changerscript as the autochanger having an empty drive (which always will indicate an empty drive, regardless of the autochanger state if themt-stpackage is not installed), is worth the bug report on the Bacula side, which I will try to file after this pull request.