...
|
\[response\]
|
|
Sling removes nt:file node for a new resumable upload and individual chunks on a existing nt:file node.
|
{code:title= Abort incomplete chunk upload response} HTTP/1.1 200 OK
|
...
|
{code}
|
h4. If no broken/discontinued upload sling returns 404 not found response. \[response\] {code:title= Chunk upload not found response} HTTP/1.1 404 Not Found Connection: Close Server: Day-Servlet-Engine/4.1.42 Content-Type: text/html;charset=utf-8 Date: Thu, 28 Feb 2013 14:14:25 GMT Transfer-Encoding: chunked
|
h1. Error Conditions
|
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head><title>404 No resource found</title></head> <body> <h1>No resource found</h1> <p>Cannot serve request to /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08 in /libs/sling/servlet/errorhandler/404.jsp</p> <h3>Request Progress:</h3> <pre> 0 (2013-02-28 19:44:25) TIMER_START{Request Processing} 0 (2013-02-28 19:44:25) COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message> 0 (2013-02-28 19:44:25) LOG Method=GET, PathInfo=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08 0 (2013-02-28 19:44:25) TIMER_START{ResourceResolution} 0 (2013-02-28 19:44:25) TIMER_END{0,ResourceResolution} URI=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08 resolves to Resource=, type=sling:nonexisting, path=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08, resource=[NonExistingResource, path=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08] 0 (2013-02-28 19:44:25) LOG Resource Path Info: SlingRequestPathInfo: path='/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08', selectorString='null', extension='null', suffix='null' 0 (2013-02-28 19:44:25) TIMER_START{ServletResolution} 0 (2013-02-28 19:44:25) TIMER_START{resolveServlet(, type=sling:nonexisting, path=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08, resource=[NonExistingResource, path=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08])} 0 (2013-02-28 19:44:25) LOG {0}: no servlet found 0 (2013-02-28 19:44:25) TIMER_END{0,resolveServlet(, type=sling:nonexisting, path=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08, resource=[NonExistingResource, path=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08])} Using servlet org.apache.sling.servlets.get.DefaultGetServlet 0 (2013-02-28 19:44:25) TIMER_END{0,ServletResolution} URI=/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08 handled by Servlet=org.apache.sling.servlets.get.DefaultGetServlet 0 (2013-02-28 19:44:25) LOG Applying Requestfilters 0 (2013-02-28 19:44:25) LOG Calling filter: org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter 0 (2013-02-28 19:44:25) LOG Calling filter: org.apache.sling.i18n.impl.I18NFilter 0 (2013-02-28 19:44:25) LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.wcm.designimporter.CanvasPageDeleteRequestFilter 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.wcm.core.impl.WCMRequestFilter 0 (2013-02-28 19:44:25) LOG Calling filter: com.adobe.granite.optout.impl.OptOutFilter 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.theme.impl.ThemeResolverFilter 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet 0 (2013-02-28 19:44:25) LOG Calling filter: org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter 0 (2013-02-28 19:44:25) LOG RedirectFilter did not redirect (request extension does not match) 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.wcm.core.impl.warp.TimeWarpFilter 0 (2013-02-28 19:44:25) LOG Applying Componentfilters 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.wcm.core.impl.WCMComponentFilter 0 (2013-02-28 19:44:25) LOG Calling filter: com.day.cq.wcm.core.impl.WCMDebugFilter 0 (2013-02-28 19:44:25) TIMER_START{org.apache.sling.servlets.get.DefaultGetServlet#0} 0 (2013-02-28 19:44:25) TIMER_END{0,org.apache.sling.servlets.get.DefaultGetServlet#0} 0 (2013-02-28 19:44:25) LOG Applying Error filters 0 (2013-02-28 19:44:25) LOG Calling filter: org.apache.sling.rewriter.impl.RewriterFilter 0 (2013-02-28 19:44:25) TIMER_START{handleError:status=404} 0 (2013-02-28 19:44:25) TIMER_END{0,handleError:status=404} Using handler /libs/sling/servlet/errorhandler/404.jsp 0 (2013-02-28 19:44:25) LOG Found processor for post processing ProcessorConfiguration: {contentTypes=[text/html],order=-1, active=true, valid=true, processErrorResponse=true, pipeline=(generator=Config(type=htmlparser, config={}), transformers=(Config(type=linkchecker, config={}), Config(type=mobile, config=org.apache.sling.jcr.resource.JcrPropertyMap@42e95cbf), Config(type=mobiledebug, config=org.apache.sling.jcr.resource.JcrPropertyMap@66c821ea), Config(type=contentsync, config=org.apache.sling.jcr.resource.JcrPropertyMap@5d2abe5d), serializer=Config(type=htmlwriter, config={}))} 0 (2013-02-28 19:44:25) TIMER_END{0,Request Processing} Dumping SlingRequestProgressTracker Entries </pre> <hr> <address>ApacheSling/2.2 (Day-Servlet-Engine/4.1.42, Java HotSpot(TM) 64-Bit Server VM 1.6.0_26, Windows 7 6.1 amd64)</address> </body> </html> {code} h3. Abort chunk upload Client will send delete" operation on upload id to [SlingPostServlet|http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html] to abort chunk upload. \[request\] {code:title= Abort chunk upload request}
|
h4. Starting resumable upload from non zero offset Sling sends 500 internal server error with javax.jcr.RepositoryException: no chunk upload found at {/content/dam/folder/catalog.pdf} in response. {code:title= Start chunk upload request from non-zero offset}
|
POST /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08 /content/dam/folder HTTP/1.1
|
Authorization: Basic YWRtaW46YWRtaW4=
|
Content-Length: 207
|
Transfer-Encoding: chunked
|
Content-Type: multipart/form-data; boundary=tBnruF3YNdCs-besNxXn8zWO6bN1GL_ boundary=4SC3O7Wgs4nrN8yqNaH1TNfQRxPK62
|
Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1 (java 1.5) Host: localhost:4502
|
--tBnruF3YNdCs-besNxXn8zWO6bN1GL_ --4SC3O7Wgs4nrN8yqNaH1TNfQRxPK62 Content-Disposition: form-data; name=":operation" name="catalog.pdf@Length"
|
Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
|
delete 1700 --tBnruF3YNdCs-besNxXn8zWO6bN1GL_-- --4SC3O7Wgs4nrN8yqNaH1TNfQRxPK62
|
Content-Disposition: form-data; name="catalog.pdf@Offset" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
|
|
200 --4SC3O7Wgs4nrN8yqNaH1TNfQRxPK62 Content-Disposition: form-data; name="catalog.pdf"; filename="catalog.pdf" Content-Type: application/pdf Content-Transfer-Encoding: binary $binary-data --4SC3O7Wgs4nrN8yqNaH1TNfQRxPK62--
|
{code} \[response\]
|
{code:title= Abort chunk upload response} HTTP/1.1 200 OK
|
{code:title= 500 internal server error } HTTP/1.1 500 Internal Server Error
|
Connection: Keep-Alive Close
|
Server: Day-Servlet-Engine/4.1.42 Content-Type: text/html;charset=UTF-8
|
Date: Thu, 28 Feb 2013 14:14:25 GMT
|
Date: Mon, 06 May 2013 16:22:55 GMT
|
Transfer-Encoding: chunked <html> <head>
|
<title>Content modified /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08</title>
|
<title>Error while processing /content/dam/folder</title>
|
</head> <body>
|
<h1>Content modified /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08</h1>
|
<h1>Error while processing /content/dam/folder</h1>
|
<table> <tbody> <tr> <td>Status</td>
|
<td><div id="Status">2500</div></td>
|
</tr> <tr> <td>Message</td>
|
<td><div id="Message">OK</div></td>
|
<td><div id="Message">javax.jcr.RepositoryException: no chunk upload found at {/content/dam/folder/catalog.pdf}</div></td>
|
</tr> <tr> <td>Location</td>
|
<td><img src="" alt="invalid link: /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08" title="invalid link: /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08" border="0">/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08<img src="" border="0"></td>
|
<td><a href="" id="Location">/content/dam/folder</a></td>
|
</tr> <tr> <td>Parent Location</td>
|
<td><a href="" id="ParentLocation">/tmp/sling/chunks</a></td>
|
<td><a href="" id="ParentLocation">/</a></td>
|
</tr> <tr> <td>Path</td>
|
<td><div id="Path">/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08</div></td> id="Path">/content/dam/folder</div></td>
|
</tr> <tr>
|
...
|
<tr> <td>ChangeLog</td>
|
<td><div id="ChangeLog"><pre>deleted("/tmp/sling/chunks/21d36856b76045da8719ac932f88fe08");<br/></pre></div></td> id="ChangeLog"><pre></pre></div></td>
|
</tr> </tbody> </table> <p><a href="" Back</a></p>
|
<p><img src="" alt="invalid link: /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08" title="invalid link: /tmp/sling/chunks/21d36856b76045da8719ac932f88fe08" border="0">Modified Resource<img src="" border="0"></p>
|
<p><a href="" Resource</a></p>
|
<p><a href="" class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">tmp/sling/chunks">Parent of Modified Resource</a></p>
|
</body> </html> {code}
|
h1. Implementation h3. Extension to [SlingPostServlet|http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html] Chunk upload is supported in "modify"operation of [SlingPostServlet|http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html] ( ie. In default operation) . No new operation introduced for it h3. Chunks Storage Chunks are saved in temporary location identified by upload id in the following node structure. \[request\] {code:title= Get chunks information} GET /tmp/sling/chunks/f4bc84fbee4d4a608a87c1bf347ddded.infinity.json HTTP/1.1 Authorization: Basic YWRtaW46YWRtaW4= Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1 (java 1.5) Host: localhost:4502 {code} \[response\] {code:title= Get chunks information response} HTTP/1.1 200 OK Connection: Keep-Alive Server: Day-Servlet-Engine/4.1.42 Content-Type: application/json;charset=UTF-8 Content-Length: 155 Date: Thu, 28 Feb 2013 15:09:53 GMT {"chunksUploaded":5,"jcr:createdBy":"admin","bytesUploaded":1600,"jcr:created":"Thu Feb 28 2013 20:39:53 GMT+0530","jcr:primaryType":"sling:OrderedFolder","1":{"size":200,":jcr:data":200,"jcr:primaryType":"nt:unstructured"},"2":{"size":300,":jcr:data":300,"jcr:primaryType":"nt:unstructured"},"3":{"size":300,":jcr:data":300,"jcr:primaryType":"nt:unstructured"},"4":{"size":400,":jcr:data":400,"jcr:primaryType":"nt:unstructured"},"5":{"size":400,":jcr:data":400,"jcr:primaryType":"nt:unstructured"}} {code} h3. Chunk processing * First/Intermediate chunks: Chunk is saved in temporary location in jcr. Ignores all upload semantics (@TypeHint, etc) and request parameters. * Last chunk: Stitches all chunks. Process all upload semantics and request parameters and creates jcr node structure at the right location.
|
|