In Duplicati v2.0.3.7, the commandline utilities no longer return any output. I guess “Removed all calls to Console.WriteLine as it could lock up the console on Windows” from the release notes is responsible for this behaviour.
Is this a temporary fix to prevent lockups, a permanent change of just a bug?
I hope the commandline tools will report back results in one of the next versions, because even Duplicati.CommandLine.exe help advanced doesn’t show any information.
As a workaround, I use the help command from the CommandLine item in the Web UI.
According to that documentation, the child process should just send the output.
@kees-z & @warwickmm are you running with the auto-updater disabled? If the auto-updater is disabled, it will not make a child process, which could muddy the testing.
If I’m not mistaken, once the autoupdate is disabled, it will not hit the code I changed and will run “normally” without any console sharing. If that is so, it is something else.
For both 2.0.3.6 and 2.0.3.7, I downloaded the Zip version, extracted the zip and executed Duplicati.CommandLine.exe help advanced from the extracted folder.
For the 2.0.3.7 version, I started the server with Duplicati.Server.exe --webservice-port=8500 --portable-mode, created a test job in the Web UI and launched the help command using the Commandline menu of the test job.
I just tested this on a Windows machine, and if the autoupdater is disabled, output is sent correctly, so it has to do with not redirecting the console back from the child process.
In that case, it seems likely it’s from my commit. Can you try to re add the stdout/stderr stream redirects, but not stdin, and see what happens on Windows? Redirecting stdin breaks it on Linux as we saw. Hopefully not redirecting stdin also works on Windows.
I also tried to use this method, which should do it, but I cannot get it to work correctly:
Instead, I am working on a solution where the Linux is using the automatic redirect and Windows is using manual forwards and a workaround for reading the passphrase.
That sounds reasonable, although it would be nice to have something uniform. I don’t have time to look into it right now, though my fingers are itching From the C# Today link you’d say it should’ve worked on windows, the screenshots on that page are from Windows and display the desired behavior.
I read the change. So on Windows in ReadPassphraseFromConsole throws an InvalidOperation exception, by
probably Console.ReadKey? Though Console.Readline works fine in the ReadPassphraseFromStdin? Strange.
Yes, the Console.ReadKey() reads from the keyboard, not stdin. If the console is redirected, the method throws InvalidOperationException. We can read from Console.ReadLine(), as that just returns a line from stdin. Downside is that we cannot mask the input, but for now, I think this is a better solution than having a broken password input.
It seems that on linux the output isn’t completely correct either, some output lines are missing. Like what’s actually happening. Only progress reports are printed.
I did increase console-log-level, let’s see if that makes any difference.
Totally off-topic request, just to think about.
I would LOVE to see option, where output would show files and number of blocks (or whole files) being added, replaced, removed.