Scheduler crashing when look for a Virtual Organization with empty Tape Pool Name
In CTA we are getting this error and taking down a big amount of tape drives:
[cta-taped] ERROR Aborting scheduling. zationOfTapepool: getVirtualOrganizationOfTapepool: bindString failed: paramName=:TAPE_POOL_NAME: bindString failed for SQL statement SELECT VIRTUAL_ORGANIZATION.VIRTUAL_ORGANIZATION_NAME AS VIRTUAL_ORGANIZATION...: Optional string parameter :TAPE_POOL_NAME is an empty string. An optional string parameter should either have a non-empty string value or no value at all.
In the code the error happens here:
https://gitlab.cern.ch/cta/CTA/-/blob/main/scheduler/Scheduler.cpp#L1084
for (auto & tapepool: tapepoolsPotentialOrExistingMounts) {
try {
auto vo = m_catalogue.VO()->getCachedVirtualOrganizationOfTapepool(tapepool);
tapepoolVoNameMap[tapepool] = vo.name;
voNameVoMap[vo.name] = vo;
} catch (cta::exception::Exception & ex){
//The VO of this tapepool does not exist, abort the scheduling as we need it to know the number of allocated drives
//the VO is allowed to use
ex.getMessage() << " Aborting scheduling." << std::endl;
throw ex;
}
}
When it passes a Tape Pool Name (std::string) with an empty value.
I comes from here: https://gitlab.cern.ch/cta/CTA/-/blob/main/scheduler/OStoreDB/OStoreDB.cpp#L518
or here: https://gitlab.cern.ch/cta/CTA/-/blob/main/scheduler/OStoreDB/OStoreDB.cpp#L538
When driveState.nextTapePool
doesn't have a value it assigns an empty one.
Related: https://gitlab.cern.ch/cta/operations/-/issues/1146
Edited by Jorge Camarero Vera