CmisSync icon indicating copy to clipboard operation
CmisSync copied to clipboard

WebException: The request was aborted: The request was canceled

Open nicolas-raoul opened this issue 12 years ago • 31 comments

When uploading CmisSync_1.0.13.msi (2,799,616 bytes).

It does not happen for a smaller file (1,348,608 bytes).

CmisSync.Lib.Cmis.BaseException: Cannot access https://myserver:11222/alfresco/service/cmis/s/workspace:SpacesStore/i/29ba0eab-a803-409e-8778-9c4e92bf6e07/children: The request was aborted: The request was canceled. ---> DotCMIS.Exceptions.CmisConnectionException: Cannot access https://myserver:11222/alfresco/service/cmis/s/workspace:SpacesStore/i/29ba0eab-a803-409e-8778-9c4e92bf6e07/children: The request was aborted: The request was canceled. ---> System.Net.WebException: The request was aborted: The request was canceled.
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
   at System.Xml.XmlUtf8RawTextWriter.WriteRawWithCharChecking(Char* pSrcBegin, Char* pSrcEnd)
   at System.Xml.XmlUtf8RawTextWriter.WriteRaw(Char[] buffer, Int32 index, Int32 count)
   at System.Xml.XmlRawWriterBase64Encoder.WriteChars(Char[] chars, Int32 index, Int32 count)
   at System.Xml.Base64Encoder.Encode(Byte[] buffer, Int32 index, Int32 count)
   at System.Xml.XmlRawWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   at System.Xml.XmlWellFormedWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   at DotCMIS.Binding.AtomPub.AtomEntryWriter.WriteContent(XmlWriter writer) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\Extras\OpenDataSpaceDotCMIS\DotCMIS\binding\atompub\atompub-writer.cs:line 194
   at DotCMIS.Binding.AtomPub.AtomEntryWriter.Write(Stream outStream) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\Extras\OpenDataSpaceDotCMIS\DotCMIS\binding\atompub\atompub-writer.cs:line 137
   at DotCMIS.Binding.Impl.HttpUtils.Invoke(UrlBuilder url, String method, String contentType, Output writer, BindingSession session, Nullable`1 offset, Nullable`1 length, IDictionary`2 headers) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\Extras\OpenDataSpaceDotCMIS\DotCMIS\binding\http.cs:line 181
   --- End of inner exception stack trace ---
   at CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.ProcessRecoverableException(String logMessage, Exception exception) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\CmisSync.Lib\Sync\SynchronizedFolder.cs:line 693
   at CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlLocalFile(String filePath, IFolder remoteFolder, IList`1 remoteFiles) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\CmisSync.Lib\Sync\CrawlStrategy.cs:line 554
   at CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlLocalFiles(String localFolder, IFolder remoteFolder, IList`1 remoteFiles) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\CmisSync.Lib\Sync\CrawlStrategy.cs:line 445
   at CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlDescendants(IFolder remoteFolder, IList`1 children, String localFolder) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\CmisSync.Lib\Sync\CrawlStrategy.cs:line 165
   at CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlSync(IFolder remoteFolder, String localFolder) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\CmisSync.Lib\Sync\CrawlStrategy.cs:line 82
   at CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.Sync(Boolean syncFull) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\CmisSync.Lib\Sync\SynchronizedFolder.cs:line 508
   at CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.<.ctor>b__4(Object o, DoWorkEventArgs args) in C:\Users\win7pro32bit\Documents\GitHub\CmisSync\CmisSync.Lib\Sync\SynchronizedFolder.cs:line 222
   --- End of inner exception stack trace ---

nicolas-raoul avatar Sep 03 '14 09:09 nicolas-raoul

Happens with CmisSync on Alfresco v4.2.0 (via https) but not on Alfresco v5.0.0 (via http).

nicolas-raoul avatar Sep 04 '14 06:09 nicolas-raoul

Not reproduced using https://github.com/nicolas-raoul/dotcmis-upload so it is an OpenDataSpaceDotCMIS problem rather than a CmisSync problem.

nicolas-raoul avatar Sep 04 '14 06:09 nicolas-raoul

Happens even after reverting OpenDataSpaceDotCMIS version to 918e47676a810276885b2a42b720fec910f44435 so it might be a problem with the Alfresco server.

nicolas-raoul avatar Sep 04 '14 07:09 nicolas-raoul

http://stackoverflow.com/questions/21548604/the-request-was-aborted-the-request-was-canceled-no-solution-works

I would like to add an extra tip for people who have this or similar problem: Make sure that you dispose your RequestStream, your Response and your ResponseStream object.

nicolas-raoul avatar Sep 05 '14 05:09 nicolas-raoul

Same problem when using the official DotCMIS 0.6

That library used to work, so I guess it is a temporary problem with the Alfresco server.

If anyone has the same problem, please let us know your server name & version, and whether you are using HTTPS or not. And your CMIS URL too.

nicolas-raoul avatar Sep 05 '14 07:09 nicolas-raoul

We're noticing the same issue with Alfresco 4.1.8.6 over HTTP and HTTPS

tarh33l avatar Oct 01 '14 15:10 tarh33l

Same problem on Alfresco 4.2d Community, over http:

DotCMIS.Exceptions.CmisConnectionException: Cannot access http://x.y.z/alfresco/service/cmis/s/workspace:SpacesStore/i/5c74831c-3ef4-4e69-b6b5-e6c4b8a9c57a/children: The request was aborted: The request was canceled. ---> System.Net.WebException: The request was aborted: The request was canceled.

wimco avatar Nov 10 '14 07:11 wimco

@tarh33l @wimco Does it also happen with small files? For all files? If not, from what size? Thanks for the feedback! Nicolas

nicolas-raoul avatar Nov 10 '14 07:11 nicolas-raoul

?I'll monitor it. This happened on a folder object and a 1Mb PDF file.

Thx


From: Nicolas Raoul [email protected] Sent: 10 November 2014 09:59 AM To: aegif/CmisSync Cc: Wim Coetzee Subject: Re: [CmisSync] WebException: The request was aborted: The request was canceled (#418)

@tarh33lhttps://github.com/tarh33l @wimcohttps://github.com/wimco Does it also happen with small files? For all files? If not, from what size? Thanks for the feedback! Nicolas

Reply to this email directly or view it on GitHubhttps://github.com/aegif/CmisSync/issues/418#issuecomment-62351859.

wimco avatar Nov 10 '14 10:11 wimco

We are now getting the same problem with Alfresco 5 over HTTP and HTTPS for larger files which take a while to upload. If uploaded via AWS Windows machine, no problems - over ASDL upload at 50kb/sec even a 6MB file won't upload. Uploads fine via Alfresco web interface.

stuartbuckell avatar Jan 20 '15 14:01 stuartbuckell

Hi, I had to downgrade to version 1.1.1.0 in order to get it to work again. That was the last version I know it's working okay for me. Maybe higher versions than 1.1.1.0 are okay as well. I didn't try.

I'm waiting desparately for the fix. Your tool is great and I cannot work without it any longer. :) Thank you so much for your effort!

rosenkra avatar Apr 17 '15 10:04 rosenkra

Nicolas, do you have an update for us?

stuartbuckell avatar Apr 17 '15 10:04 stuartbuckell

Everyone:

  1. Are you getting the exact same stacktrace, including SynchronizedFolder.CrawlLocalFile?

  2. Does CmisSync.1.1.2.0.exe work or not? If yes, what is the last version that works? All past versions can be found at https://bitbucket.org/aegif/cmissync/downloads

If we find what exact commit broke CmisSync, it will be easier to fix. All commits can be found here, including version bumps: https://github.com/aegif/CmisSync/commits/master

Thanks a lot for your feedback!

nicolas-raoul avatar Apr 17 '15 13:04 nicolas-raoul

Hi,

version 1.2.4 is working version 1.2.13 is not.

I will now check the versions in between.

rosenkra avatar Apr 22 '15 05:04 rosenkra

Okay, it looks like 1.2.7 is the last version that's okay. A quick retest with version 1.2.8 showed the same error popping up (sorry for posting the whole stuff in this discussion): BTW: "Die Anfrage wurde abgebrochen" means "The request has been cancelled"

2015-04-22 08:14:06,541 [4] INFO  CmisSync.Lib.Sync.CmisRepo+SynchronizedFolder [(null)] - Uploading: D:\<some path here>\10 In-Progress\Atomium_R51_BD_Tactical_Campaigns_v1-01 - Del.docx
2015-04-22 08:15:06,585 [4] ERROR CmisSync.Lib.Sync.CmisRepo+SynchronizedFolder [(null)] - Could not upload file: D:\<some path here>\10 In-Progress\Atomium_R51_BD_Tactical_Campaigns_v1-01 - Del.docx
DotCMIS.Exceptions.CmisConnectionException: Cannot access <some URL here>: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen.. ---> System.Net.WebException: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen..
   bei System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   bei System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   bei System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
   bei System.Xml.XmlUtf8RawTextWriter.WriteRawWithCharChecking(Char* pSrcBegin, Char* pSrcEnd)
   bei System.Xml.XmlUtf8RawTextWriter.WriteRaw(Char[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlRawWriterBase64Encoder.WriteChars(Char[] chars, Int32 index, Int32 count)
   bei System.Xml.Base64Encoder.Encode(Byte[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlRawWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlWellFormedWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   bei DotCMIS.Binding.AtomPub.AtomEntryWriter.WriteContent(XmlWriter writer)
   bei DotCMIS.Binding.AtomPub.AtomEntryWriter.Write(Stream outStream)
   bei DotCMIS.Binding.Impl.HttpUtils.Invoke(UrlBuilder url, String method, String contentType, Output writer, BindingSession session, Nullable`1 offset, Nullable`1 length, IDictionary`2 headers)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei DotCMIS.Binding.Impl.HttpUtils.Invoke(UrlBuilder url, String method, String contentType, Output writer, BindingSession session, Nullable`1 offset, Nullable`1 length, IDictionary`2 headers)
   bei DotCMIS.Binding.Impl.HttpUtils.InvokePOST(UrlBuilder url, String contentType, Output writer, BindingSession session)
   bei DotCMIS.Binding.AtomPub.AbstractAtomPubService.Post(UrlBuilder url, String contentType, Output writer)
   bei DotCMIS.Binding.AtomPub.ObjectService.CreateDocument(String repositoryId, IProperties properties, String folderId, IContentStream contentStream, Nullable`1 versioningState, IList`1 policies, IAcl addAces, IAcl removeAces, IExtensionsData extension)
   bei DotCMIS.Client.Impl.Session.CreateDocument(IDictionary`2 properties, IObjectId folderId, IContentStream contentStream, Nullable`1 versioningState, IList`1 policies, IList`1 addAces, IList`1 removeAces)
   bei DotCMIS.Client.Impl.Folder.CreateDocument(IDictionary`2 properties, IContentStream contentStream, Nullable`1 versioningState, IList`1 policies, IList`1 addAces, IList`1 removeAces, IOperationContext context)
   bei DotCMIS.Client.Impl.Folder.CreateDocument(IDictionary`2 properties, IContentStream contentStream, Nullable`1 versioningState)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.UploadFile(String filePath, IFolder remoteFolder)
2015-04-22 08:15:06,589 [4] ERROR CmisSync.Lib.Sync.CmisRepo+SynchronizedFolder [(null)] - Could not crawl sync local file: D:\<some path here>\10 In-Progress\Atomium_R51_BD_Tactical_Campaigns_v1-01 - Del.docx
DotCMIS.Exceptions.CmisConnectionException: Cannot access <some URL here>: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen.. ---> System.Net.WebException: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen..
   bei System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   bei System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   bei System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
   bei System.Xml.XmlUtf8RawTextWriter.WriteRawWithCharChecking(Char* pSrcBegin, Char* pSrcEnd)
   bei System.Xml.XmlUtf8RawTextWriter.WriteRaw(Char[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlRawWriterBase64Encoder.WriteChars(Char[] chars, Int32 index, Int32 count)
   bei System.Xml.Base64Encoder.Encode(Byte[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlRawWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlWellFormedWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   bei DotCMIS.Binding.AtomPub.AtomEntryWriter.WriteContent(XmlWriter writer)
   bei DotCMIS.Binding.AtomPub.AtomEntryWriter.Write(Stream outStream)
   bei DotCMIS.Binding.Impl.HttpUtils.Invoke(UrlBuilder url, String method, String contentType, Output writer, BindingSession session, Nullable`1 offset, Nullable`1 length, IDictionary`2 headers)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.ProcessRecoverableException(String logMessage, Exception exception)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.UploadFile(String filePath, IFolder remoteFolder)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlLocalFile(String filePath, IFolder remoteFolder, IList`1 remoteFiles)
2015-04-22 08:15:06,589 [4] INFO  CmisSync.Lib.RepoBase [(null)] - Sync Error: Cannot access <some URL here>: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen..
2015-04-22 08:15:06,590 [4] ERROR CmisSync.StatusIconController [(null)] - Error syncing '320 Release 5.1': Cannot access <some URL here>: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen..
CmisSync.Lib.Cmis.BaseException: Cannot access <some URL here>: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen.. ---> DotCMIS.Exceptions.CmisConnectionException: Cannot access <some URL here>: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen.. ---> System.Net.WebException: Die Anfrage wurde abgebrochen: Die Anfrage wurde abgebrochen..
   bei System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   bei System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   bei System.Xml.XmlUtf8RawTextWriter.FlushBuffer()
   bei System.Xml.XmlUtf8RawTextWriter.WriteRawWithCharChecking(Char* pSrcBegin, Char* pSrcEnd)
   bei System.Xml.XmlUtf8RawTextWriter.WriteRaw(Char[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlRawWriterBase64Encoder.WriteChars(Char[] chars, Int32 index, Int32 count)
   bei System.Xml.Base64Encoder.Encode(Byte[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlRawWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   bei System.Xml.XmlWellFormedWriter.WriteBase64(Byte[] buffer, Int32 index, Int32 count)
   bei DotCMIS.Binding.AtomPub.AtomEntryWriter.WriteContent(XmlWriter writer)
   bei DotCMIS.Binding.AtomPub.AtomEntryWriter.Write(Stream outStream)
   bei DotCMIS.Binding.Impl.HttpUtils.Invoke(UrlBuilder url, String method, String contentType, Output writer, BindingSession session, Nullable`1 offset, Nullable`1 length, IDictionary`2 headers)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.ProcessRecoverableException(String logMessage, Exception exception)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlLocalFile(String filePath, IFolder remoteFolder, IList`1 remoteFiles)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlLocalFiles(String localFolder, IFolder remoteFolder, IList`1 remoteFiles)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlDescendants(IFolder remoteFolder, IList`1 children, String localFolder)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlDescendants(IFolder remoteFolder, IList`1 children, String localFolder)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.CrawlSync(IFolder remoteFolder, String localFolder)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.Sync(Boolean syncFull)
   bei CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.<.ctor>b__4(Object o, DoWorkEventArgs args)
   --- Ende der internen Ausnahmestapelüberwachung ---

rosenkra avatar Apr 22 '15 06:04 rosenkra

Thanks Rosenkra for the investigation! Very helpful.

Here are all the changes between 1.2.7 and 1.2.8: https://github.com/aegif/CmisSync/compare/de967a4807cf37fd83404c7922e08b543df94b2e...f9dfd0d70b036a7f63d65301d1599105a329f2b7 In particular, SessionParameter.ConnectTimeout has been reduced from -1 (infinite) to 60000 (one minute).

Everyone, could you tell me whether it happens only on slow servers, or only when the server is waking up from sleep, or starting, or for any reason taking more than a minute to send a reply?

Increasing ConnectTimeout might be a solution... after how much time should we consider that the server is hopelessly unreachable?

nicolas-raoul avatar Apr 22 '15 08:04 nicolas-raoul

That's a big problem. Because from 1.2.8 the error is depending on the speed of the connection. This morning I used my ADSL connection from home to do the tests. The file could be synced with version 1.2.7 but not with version 1.2.8. But now that I'm in the office I synced successfully the same file with version 1.2.8.

So it depends on the bandwidth of the connection: If the file can be transferred to the server within a minute then it's considered okay?

That's a pity. Is there no other way to determine if the connection is (still) valid or not?

rosenkra avatar Apr 22 '15 08:04 rosenkra

Yes this is exactly the same issue as us @nicolas-raoul - with ADSL it won't sync. With our new 20MB upload pipe it's fine. IT seems this "1 minute timeout" means, you can upload a file for a maximum of 1 minute. The timeout should not be called if an upload is in progress. Can you change this to check?

stuartbuckell avatar Apr 22 '15 08:04 stuartbuckell

Here is the code: https://github.com/aegif/CmisSync/blob/master/CmisSync.Auth/Auth.cs#L72

There are 2 settings currently defined:

  • ConnectTimeout: 1 minute
  • ReadTimeout: 20 minutes

ConnectTimeout is when establishing the network connection, so the size of the file should not matter in principle (in practice it might be different, or maybe I misunderstand something). For big files, I believe ReadTimeout is used (I wonder whether there is a "WriteTimeout" as well).

When you try to upload a huge file on a very narrow connection, after exactly how many seconds does the error appear?

nicolas-raoul avatar Apr 22 '15 08:04 nicolas-raoul

It appears exactly after 60 seconds:

2015-04-22 07:40:56,728 [6] INFO  CmisSync.Lib.Sync.CmisRepo+SynchronizedFolder [(null)] - Uploading: D:\XYZ.docx
2015-04-22 07:41:56,788 [6] ERROR CmisSync.Lib.Sync.CmisRepo+SynchronizedFolder [(null)] - Could not upload file: D:\XYZ.docx

:-(

rosenkra avatar Apr 22 '15 09:04 rosenkra