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
autochanger
test that is included in thebtape
tool, as recommended by the Bacula documentationThe
btape
toolautochanger
command 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 thebtape
tool would continue reportingUntil a timeout was reached and the
autochanger
test failed.The
btape
autochanger
program calls a script/opt/bacula/scripts/mtx-changer
in thebacula-sd
container, which is a wrapper for the genericmtx
command. This script is used to do all the interactions with the autochanger, acting as a proxy formtx
.When the
btape
autochanger
command is ran, it calls themtx-changer
script with theloaded
argument to probe if the drive is loaded. It expects a return value of0
if the drive is empty, and a return value of1
if the drive is full. On my setup, it issued the following command:Where
dev/sg8
is the autoloader SCSI device anddev/st0
is the autoloader built-in SCSI tape drive.When
btape
tries to run this command inside thebacula-sd
container, the output is not a pure1
or0
, but it also contains an error:As the return value now contains an error besides the return value of
1
, thebtape
program wrongfully interprets this, thinking the drive is empty. It then tries to load a tape into the full drive, which results in theautochanger
test failing.Note in the output above that the command is working correctly, as it returns a
1
while my drive was loaded at the time, it just also contains the error about themt
command, causingbtape
to interpret that the drive is emptywhile it is actually full.
The
/opt/bacula/scripts/mtx-changer.conf
is a configuration file for themtx-changer
script and tries to figure out what version ofmt
is installed on line 84 and 89 of themtx-changer.conf
file, which is where the error is generated. As themt-st
package is not installed in thebacula-sd
container, the errorcommand not found
is generated, which causes the issues down the line.This pull request adds the
mt-st
repository to thebacula-base
Dockerfile, which prevents the error from popping up when using themtx-changer
script, which fixes the issue where theautochanger
test is not able to complete because of thecommand not found
error being wrongfully interpreted bybtape
as 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
btape
wrongfully interprets the error generated by the themtx-changer
script as the autochanger having an empty drive (which always will indicate an empty drive, regardless of the autochanger state if themt-st
package is not installed), is worth the bug report on the Bacula side, which I will try to file after this pull request.