Cannot access a disposed object

Hi,
Just trying to get Duplicati 2 working on my gf’s mac laptop for an S3 upload. I’m getting the dreaded “Cannot access a disposed object. Object name: ‘System.Net.Sockets.NetworkStream’” error. I can get an upload to work without error if I restrict it to one small file, but as soon as I try and upload a proper backup set I get this error.

On the mac I’m really unsure where to look for any sort of more substantial logging to find the underlying cause of the problem.
I’ve tried both the beta channel and the canary - with the same results.

Any suggestions for how to proceed here?

Ok, so I played around with this some more and I think I’ve got a possible idea of what might be the issue. I disabled System Integrity Protection using csrutil disable, ran mozroots and now the backup seems to be running ok. It seems like some part of the encryption process is trying to write to /usr/share/.mono, which is protected by System Integrity Protection. This is even the case with SSL turned off, so I think it’s the block encryption rather than the transport-level encryption.

So far I haven’t tried re-enabling csrutil, but I have a suspicion that it’s not going to work - each time I run the backup I notice the system reporting changes (now permitted rather than blocked) to /usr/share/.mono . Is this a mono issue (I can’t find any mention of it with a quick google) or is this duplicati-specific? Obviously it’s not really desirable to leave System Integrity Protection switched off.

Hi @herodotus, welcome to the forum - and thanks for the research you’ve already done into your issue!

Would it be possible for you to post the full details around the System.Net.Sockets.NetworkStream error? Assuming they haven’t “aged out” of your logs already, they should be in there - just click on the error line to open it up and display the details.

Hi,

So I’m a bit stuck here. As far as I can remember, when I clicked on the error I got no additional information beyond what I’ve already posted. Unfortunately, for some reason, the version of duplicati running on my GFs macbook has no “Show log” button, which is weird, so I can’t get access to the log messages. Any idea why this might be. I installed from the .dmg on the website and then switched to the canary channel while trying to get this problem sorted.

When I have a moment I will try and recreate the error but it’s a bit of a faff because I’ll have to reboot into the Recovery Partition to reset the system integrity protection and I’m slightly concerned that I’ll lose all the progress we’ve so far made on her backup (v. slow on our connection) when the error happens again.

Any tips on how I can get to the log on the mac version?

At one point I recall having a “Show log” menu item under the “main” menu, but at some point it seems to have been moved to a “Show log” button under the main “About” menu.

In there you you should see “global” errors that relate to all jobs, as well as a “Live” button which offers options to set real-time(-ish) logging levels.
image


There’s also a “Show log…” link when you expand a job. This shows job-specific log entries under the “General” button as well as log entries related to the destination under the “Remote” button.
image


I’m not sure why you wouldn’t get any expanded detail… granted there are some messages that have no additional info - but an error like you’re reporting shouldn’t be one of them.


Another option would be to add the --log-file=<path> and --log-level=profiling parameters to the failing job and try running it. This should generate a detailed log at <path> that you can then open in a text editor instead of digging through the GUI.

Sorry - jumping in on this one … I have the same thing on a new linux install.

Cannot access a disposed object. Object name: ‘System.Net.Sockets.NetworkStream’.

Job Log:

23 Jun 2018 23:43: put duplicati-b2eebe0eae8b145288717d0d6d622fc53.dblock.zip.aes
{"Size":47678189,"Hash":"XzhaX38mKLY8mmDtKANjYuaxpw/+UpHVAV4WStcOQjs="}

System Log:

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'.
 at Duplicati.Library.Main.BackendManager.WaitForEmpty (Duplicati.Library.Main.Database.LocalDatabase db, IDbTransaction transation) <0x41b28310 + 0x00137> in <filename unknown>:0
 at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, IFilter filter) <0x41ad2290 + 0x01b9b> in <filename unknown>:0 
{
"ClassName":"System.ObjectDisposedException",
"Message":"Cannot access a disposed object.",
"InnerException":null,
"HelpURL":null,
"StackTraceString":" at Duplicati.Library.Main.BackendManager.WaitForEmpty (Duplicati.Library.Main.Database.LocalDatabase db, IDbTransaction transation) <0x41b28310 + 0x00137> in <filename unknown>:0 
 at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, IFilter filter) <0x41ad2290 + 0x01b9b> in <filename unknown>:0 ",
"RemoteStackTraceString":null,
"RemoteStackIndex":0,
"HResult":-2146232798,
"Source":"Duplicati.Library.Main",
"ExceptionMethod":null,
"Data":null,
"ObjectName":"System.Net.Sockets.NetworkStream"
}

Full profile trace:

23 Jun 2018 23:47: Backend event: Put - Failed: duplicati-bbd50c547cdc342449598aa1622c75cf7.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:47: Operation Put with file duplicati-bbd50c547cdc342449598aa1622c75cf7.dblock.zip.aes attempt 5 of 5 failed with message: Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'.
23 Jun 2018 23:47: RemoteOperationPut took 00:00:00.202
23 Jun 2018 23:47: Backend event: Put - Started: duplicati-bbd50c547cdc342449598aa1622c75cf7.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:47: Starting - RemoteOperationPut
23 Jun 2018 23:47: Renaming "duplicati-ba516f374193a463b81dead5916dfd9cd.dblock.zip.aes" to "duplicati-bbd50c547cdc342449598aa1622c75cf7.dblock.zip.aes"
23 Jun 2018 23:47: Backend event: Put - Rename: duplicati-bbd50c547cdc342449598aa1622c75cf7.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:47: Backend event: Put - Rename: duplicati-ba516f374193a463b81dead5916dfd9cd.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:47: Backend event: Put - Retrying: duplicati-ba516f374193a463b81dead5916dfd9cd.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:47: Operation Put with file duplicati-ba516f374193a463b81dead5916dfd9cd.dblock.zip.aes attempt 4 of 5 failed with message: Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'.
23 Jun 2018 23:47: RemoteOperationPut took 00:00:00.198
23 Jun 2018 23:47: Backend event: Put - Started: duplicati-ba516f374193a463b81dead5916dfd9cd.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:47: Starting - RemoteOperationPut
23 Jun 2018 23:46: Renaming "duplicati-b8326bf5956da4589903a366d200852f7.dblock.zip.aes" to "duplicati-ba516f374193a463b81dead5916dfd9cd.dblock.zip.aes"
23 Jun 2018 23:46: Backend event: Put - Rename: duplicati-ba516f374193a463b81dead5916dfd9cd.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Backend event: Put - Rename: duplicati-b8326bf5956da4589903a366d200852f7.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Backend event: Put - Retrying: duplicati-b8326bf5956da4589903a366d200852f7.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Operation Put with file duplicati-b8326bf5956da4589903a366d200852f7.dblock.zip.aes attempt 3 of 5 failed with message: Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'.
23 Jun 2018 23:46: RemoteOperationPut took 00:00:00.194
23 Jun 2018 23:46: Backend event: Put - Started: duplicati-b8326bf5956da4589903a366d200852f7.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Starting - RemoteOperationPut
23 Jun 2018 23:46: Renaming "duplicati-b0ab38291a80445f38b506c0f0c6d4f6f.dblock.zip.aes" to "duplicati-b8326bf5956da4589903a366d200852f7.dblock.zip.aes"
23 Jun 2018 23:46: Backend event: Put - Rename: duplicati-b8326bf5956da4589903a366d200852f7.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Backend event: Put - Rename: duplicati-b0ab38291a80445f38b506c0f0c6d4f6f.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Backend event: Put - Retrying: duplicati-b0ab38291a80445f38b506c0f0c6d4f6f.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Operation Put with file duplicati-b0ab38291a80445f38b506c0f0c6d4f6f.dblock.zip.aes attempt 2 of 5 failed with message: Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'.
23 Jun 2018 23:46: RemoteOperationPut took 00:00:00.200
23 Jun 2018 23:46: Backend event: Put - Started: duplicati-b0ab38291a80445f38b506c0f0c6d4f6f.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Starting - RemoteOperationPut
23 Jun 2018 23:46: Renaming "duplicati-bf20760f6a7c04b648d4e762a598d70ef.dblock.zip.aes" to "duplicati-b0ab38291a80445f38b506c0f0c6d4f6f.dblock.zip.aes"
23 Jun 2018 23:46: Backend event: Put - Rename: duplicati-b0ab38291a80445f38b506c0f0c6d4f6f.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Backend event: Put - Rename: duplicati-bf20760f6a7c04b648d4e762a598d70ef.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Backend event: Put - Retrying: duplicati-bf20760f6a7c04b648d4e762a598d70ef.dblock.zip.aes (45.47 MB)
23 Jun 2018 23:46: Operation Put with file duplicati-bf20760f6a7c04b648d4e762a598d70ef.dblock.zip.aes attempt 1 of 5 failed with message: Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'.
23 Jun 2018 23:46: RemoteOperationPut took 00:00:00.209
23 Jun 2018 23:46: Starting - Async backend wait
23 Jun 2018 23:46: Uploading a new fileset took 00:00:00.090
23 Jun 2018 23:46: CommitUpdateRemoteVolume took 00:00:00.003
23 Jun 2018 23:46: Starting - CommitUpdateRemoteVolume
23 Jun 2018 23:46: CommitUpdateRemoteVolume took 00:00:00.003
23 Jun 2018 23:46: Starting - CommitUpdateRemoteVolume
23 Jun 2018 23:46: Starting - Uploading a new fileset
23 Jun 2018 23:46: VerifyConsistency took 00:00:00.004
23 Jun 2018 23:46: ExecuteScalarInt64: SELECT COUNT(*) FROM "File" WHERE "BlocksetID" != ? AND "BlocksetID" != ? AND NOT "BlocksetID" IN (SELECT "BlocksetID" FROM "BlocksetEntry") took 00:00:00.000

Hi @enly1, welcome to the forum - and thanks for the detail log info!

I see the put operation failing over all 5 retries, but I’m not really sure why it’s failing. I suspect @kenkendk will have a better idea about it, but until he gets a chance to see this can you let us know:

  • what version of Duplicati you are using?
  • what type of backend destination is involved?
  • has this (or any other) job ever worked on this new Linux install?

@JonMikelV Some info as requested.

Latest version downloaded last night. Not at machine to check.

I did manage to get something working for a small backup set once, but had issues with thd backup when i changed some params and so created a new clean bigger backup which didnt work.

It did put files onto the backend at some point, but not really much on that backup.

Backend is s3. Bucket was created manually as it moaned that the bucket didn’t exist. (Not sure if its supposed to create it).

Bucket located in europe. Think it was eu-west-2.

Api keys used had s3 full rights.

Hope that helps.