Skip to main content


 

Symptoms

 


Issue at customer is as follows. We have the standard Sharepoint app for Sharepoint 2013 (version 1.0.0) installed and configured a set of SMOs for a document library. Using the standard generated SMOs we can upload small files, however as soon as the file size is larger than about 1.5 Mb ~ 2Mb then we get an error message:
404 Not found.
 

 

Diagnosis

 


We have run a Fiddler trace between K2 and SharePoint and you can see that it is actually a directory not found exception that is returned. We looked into the value of the @TargetLibrary in the REST response and we suspect that there is a missing "/" at the start of the value. One of our developers was able to confirm that when he posted as follows (as from the app) it gets an error:

POST https://portal.domain.com/sites/tutorials/howtok2/_api/web/GetFolderByServerRelativeUrl(@TargetLibrary)/Files/Add(url=@TargetFileName,overwrite=@Overwrite)?@TargetLibrary='sites/tutorials/HowToK2/Approved Documents'and@TargetFileName='DEV-B331.pptx'and@Overwrite='False' HTTP/1.1

Response:
HTTP/1.1 404 Not Found
Cache-Control: private, max-age=0
Transfer-Encoding: chunked
Content-Type: application/jsonodata=verbosecharset=utf-8
Expires: Mon, 16 Feb 2015 20:13:15 GMT
Last-Modified: Tue, 03 Mar 2015 20:13:15 GMT
Server: Microsoft-IIS/8.5
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 1645
X-AspNet-Version: 4.0.30319
SPRequestGuid: 2337ef9c-24b4-005d-6a17-fe7db7eec757
request-id: 2337ef9c-24b4-005d-6a17-fe7db7eec757
X-FRAME-OPTIONS: SAMEORIGIN
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4617
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1 RequireReadOnly
Date: Tue, 03 Mar 2015 20:13:17 GMT

7b
{"error":{"code":"-2147024893, System.IO.DirectoryNotFoundException","message":{"lang":"en-US","value":"File Not Found."}}}
0

However...
Solution:
When I add the '/' in front of 'sites' in @TargetLibrary, and execute a request again using fiddler composer, everything works:
POST https://portal.domain.com/sites/tutorials/howtok2/_api/web/GetFolderByServerRelativeUrl(@TargetLibrary)/Files/Add(url=@TargetFileName,overwrite=@Overwrite)?@TargetLibrary='/sites/tutorials/HowToK2/Approved Documents'and@TargetFileName='DEV-B331.pptx'and@Overwrite='False' HTTP/1.1

Response:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Transfer-Encoding: chunked
Content-Type: application/jsonodata=verbosecharset=utf-8
Expires: Mon, 16 Feb 2015 20:18:05 GMT
Last-Modified: Tue, 03 Mar 2015 20:18:05 GMT
Server: Microsoft-IIS/8.5
X-SharePointHealthScore: 0
SPClientServiceRequestDuration: 4429
X-AspNet-Version: 4.0.30319
SPRequestGuid: 6a37ef9c-a47a-005d-6a17-f2e442cd0fff
request-id: 6a37ef9c-a47a-005d-6a17-f2e442cd0fff
X-FRAME-OPTIONS: SAMEORIGIN
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4617
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1 RequireReadOnly
Date: Tue, 03 Mar 2015 20:18:10 GMT

 

 

Resolution

This ticket was linked to TFS item 498844 and a coldfix was issued for K2 4.6.7 and K2 for SharePoint 1.0.0 that resolved the issue.

 

 



 
Be the first to reply!

Reply