setup wizard cannot handle errors in tarsnap-keygen (or perhaps anything)
gperciva opened this issue · comments
When I try to create a new keyfile, I get the "Generating keyfile..." with a "busy" animation for less than a second, then the animation disappears. Looking at the log, I see:
Task {76ec4aeb-e36a-48ae-ba0f-72ff5f8e4e7b} finished with error 1 (Process crashed) occured (exit code 5):
[/usr/local/bin/tarsnap-keygen --user 'gperciva@tarsnap.com' --machine Grahams-Mac-mini.local --keyfile '/Users/gperciva/Library/Application Support/Tarsnap Backup Inc./Tarsnap/Grahams-Mac-mini.local-2017-09-01-13-46-18.key']
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: /usr/local/bin/tarsnap-keygen
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _clock_gettime
Referenced from: /usr/local/bin/tarsnap-keygen
Expected in: /usr/lib/libSystem.B.dylib
Fair enough; that's a known problem (Tarsnap/tarsnap#286) and I can fix that with a brew uninstall tarsnap && brew install tarsnap
. However, the GUI should never be in that state!
I see that TarsnapTask::processFinished()
will only emit finished(...)
if we get _process->exitStatus() == Process::NormalExit
. As a result,
void TaskManager::registerMachineFinished(QVariant data, int exitCode,
QString stdOut, QString stdErr)
{
Q_UNUSED(data)
if(exitCode == SUCCESS)
emit registerMachineStatus(TaskStatus::Completed, stdOut);
else
emit registerMachineStatus(TaskStatus::Failed, stdErr);
will never be called with exitCode != SUCCESS
, so of course we won't see the error in the GUI.
I suspect (but haven't yet read all the code) that this applies to all other tasks as well -- errors won't be displayed because it doesn't get a finished
signal.