We were testing and writing simultaneously, so I’ll just post how mine failed, and you can see what you think.
The Activate button is killing Duplicati service differently and more completely in further testing with my questionable blended system with 2.0.3.13 WindowsService in 2.0.3.12 base, trying to Install then Activate a 2.0.3.13 update. Before, there was a lingering WindowsService parent which I killed manually (not sure that I had to though). Now, the whole Duplicati stack exits. Unfortunately I haven’t been able to get a debugger on the new child WindowsService to figure out why it exits (which would also require learning more about code-level details and procedures of Windows service installations), so for now I watch WindowsService and Server with Sysinternals Process Monitor. Results below.
Press web UI Activate button at around 7:00:00.
Server exits with MAGIC_EXIT_CODE, as expected:
7:00:01.5788265 AM Duplicati.Server.exe 9884 Process Exit SUCCESS Exit Status: 126, User Time: 4.3750000 seconds, Kernel Time: 4.0156250 seconds, Private Bytes: 58,867,712, Peak Private Bytes: 60,911,616, Working Set: 26,505,216, Peak Working Set: 87,224,320
WindowsService child exits with MAGIC_EXIT_CODE, as expected:
7:00:01.5942378 AM Duplicati.WindowsService.exe 11508 Process Exit SUCCESS Exit Status: 126, User Time: 0.2812500 seconds, Kernel Time: 0.1250000 seconds, Private Bytes: 23,306,240, Peak Private Bytes: 23,625,728, Working Set: 8,998,912, Peak Working Set: 28,745,728
WindowsService parent picks an update, as expected:
7:00:01.5989967 AM Duplicati.WindowsService.exe 30872 QueryDirectory C:\ProgramData\Duplicati\updates\* SUCCESS Filter: *, 1: .
WindowsService child runs as 2.0.3.13, as expected:
7:00:02.6066800 AM Duplicati.WindowsService.exe 32008 Load Image C:\ProgramData\Duplicati\updates\2.0.3.13\Duplicati.WindowsService.exe SUCCESS Image Base: 0x2507db60000, Image Size: 0xa000
WindowsService child logs an error event. BAD NEWS:
Log Name: Application
Source: Duplicati
Date: 11/2/2018 7:00:03 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: HP4
Description:
Service cannot be started. The service process could not connect to the service controller
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Duplicati" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2018-11-02T11:00:03.233040800Z" />
<EventRecordID>1208575</EventRecordID>
<Channel>Application</Channel>
<Computer>HP4</Computer>
<Security />
</System>
<EventData>
<Data>Service cannot be started. The service process could not connect to the service controller</Data>
</EventData>
</Event>
WindowsService next child exits 0. Not expected, but reasonable (except maybe exit 0 is wrong) given error:
7:00:03.2368398 AM Duplicati.WindowsService.exe 32008 Process Exit SUCCESS Exit Status: 0, User Time: 0.2343750 seconds, Kernel Time: 0.1406250 seconds, Private Bytes: 22,634,496, Peak Private Bytes: 22,990,848, Working Set: 28,078,080, Peak Working Set: 28,090,368
WindowsService parent exits 0. I wonder if non-0 child exit would differ? Also, should service try harder?:
7:00:03.2539239 AM Duplicati.WindowsService.exe 30872 Process Exit SUCCESS Exit Status: 0, User Time: 0.7968750 seconds, Kernel Time: 0.4843750 seconds, Private Bytes: 29,921,280, Peak Private Bytes: 29,995,008, Working Set: 23,064,576, Peak Working Set: 30,334,976
Service Control Managers logs an error event:
Log Name: System
Source: Service Control Manager
Date: 11/2/2018 7:00:03 AM
Event ID: 7034
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: HP4
Description:
The Duplicati service service terminated unexpectedly. It has done this 8 time(s).
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" />
<EventID Qualifiers="49152">7034</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x8080000000000000</Keywords>
<TimeCreated SystemTime="2018-11-02T11:00:03.258424400Z" />
<EventRecordID>49386</EventRecordID>
<Correlation />
<Execution ProcessID="804" ThreadID="24956" />
<Channel>System</Channel>
<Computer>HP4</Computer>
<Security />
</System>
<EventData>
<Data Name="param1">Duplicati service</Data>
<Data Name="param2">8</Data>
<Binary>4400750070006C00690063006100740069000000</Binary>
</EventData>
</Event>
Aside from whether or not disaster handling is optimal, the error is WindowsService update had some issue with Windows and quit. The 2.0.3.13 WindowsService in the base and the update are the same (aside from debug hacks in the base), so I still suspect that the code is up to an initial start as a service, but not another self-initiated start as a service (launched as a new process). My concern is whether it’s from my odd test, or will Activate kill the service on 2.0.3.13 to 2.0.3.14, which I would consider a worse failure than we now have.