Alfresco: PUT request from Office with a custom storage adapter yields 409 response

206 views Asked by At

I have Alfresco community 5.2 and have built a custom content store (based on what they do with https://github.com/Alfresco/alfresco-sdk-samples/tree/alfresco-51/all-in-one/custom-content-store-repo).

With that custom store I can create documents using share, or CMIS, no problem. However, when I create a document using office it does not work.

Word can connect with the repo, but when I try to save the operation fails.

I have checked the access log and get the following:

[31/Aug/2017:08:25:15 +0000] "OPTIONS /alfresco/aos/Shared/ HTTP/1.0" 200 -
[31/Aug/2017:08:25:16 +0000] "HEAD /alfresco/aos/Shared/3y24.docx HTTP/1.0" 404 -
[31/Aug/2017:08:25:17 +0000] "OPTIONS /alfresco/aos/Shared/3y24.docx HTTP/1.0" 200 -
[31/Aug/2017:08:25:18 +0000] "PROPFIND /alfresco/aos/Shared/3y24.docx HTTP/1.0" 404 22
[31/Aug/2017:08:25:18 +0000] "OPTIONS /alfresco/aos/Shared/3y24.docx HTTP/1.0" 200 -
[31/Aug/2017:08:25:19 +0000] "HEAD /alfresco/aos/Shared/3y24.docx HTTP/1.0" 401 -
[31/Aug/2017:08:25:19 +0000] "HEAD /alfresco/aos/Shared/3y24.docx HTTP/1.0" 404 -
[31/Aug/2017:08:25:19 +0000] "PUT /alfresco/aos/Shared/3y24.docx HTTP/1.0" 201 -
[31/Aug/2017:08:25:20 +0000] "LOCK /alfresco/aos/Shared/3y24.docx HTTP/1.0" 200 533
[31/Aug/2017:08:25:22 +0000] "PUT /alfresco/aos/Shared/3y24.docx HTTP/1.0" 409 999

The alfresco.log, with the logging levels properly elevated gives me the following:

2017-08-29 10:36:25,310 DEBUG [org.alfresco.repo.content.AbstractContentStore] [http-apr-8080-exec-1] 
Fetched new writer: 
  Store:   mycomponent.cmis.database.DbContentStore@27c9fb78
  Context: NodeContentContext[ contentUrl=null, existing=false, nodeRef=workspace://SpacesStore/4fe8f573-b19e-4231-9485-ca04c6ca6d47, propertyQName={http://www.alfresco.org/model/content/1.0}content]
  Writer:  ContentAccessor[ contentUrl=db://301f9a77-51a2-4986-896d-e4f7f6e63995.bin, mimetype=null, size=0, encoding=UTF-8, locale=en_US]
2017-08-29 10:36:25,310 DEBUG [mycomponent.cmis.database.LoggingContentStore] [http-apr-8080-exec-1] EXITING getWriter =ContentAccessor[ contentUrl=db://301f9a77-51a2-4986-896d-e4f7f6e63995.bin, mimetype=null, size=0, encoding=UTF-8, locale=en_US]
2017-08-29 10:36:25,311 DEBUG [mycomponent.cmis.database.DbContentWriter] [http-apr-8080-exec-1] Creating temp file [uuid=b74b6d85-1842-4859-a2df-b2f8377ff421]
2017-08-29 10:36:25,312 DEBUG [mycomponent.cmis.database.DbContentWriter] [http-apr-8080-exec-1] Returning write channel to temp file [uuid=b74b6d85-1842-4859-a2df-b2f8377ff421]
2017-08-29 10:36:25,312 DEBUG [org.alfresco.repo.content.AbstractContentWriter] [http-apr-8080-exec-1] 
  Created callback byte channel: 
   original: sun.nio.ch.FileChannelImpl@19f2447e
   new: org.alfresco.repo.content.AbstractContentAccessor$CallbackFileChannel@8907420
2017-08-29 10:36:25,312 DEBUG [org.alfresco.repo.content.AbstractContentWriter] [http-apr-8080-exec-1] 
  Opened channel onto content: 
   content: ContentAccessor[ contentUrl=db://301f9a77-51a2-4986-896d-e4f7f6e63995.bin, mimetype=null, size=0, encoding=UTF-8, locale=en_US]
   channel: org.alfresco.repo.content.AbstractContentAccessor$CallbackFileChannel@8907420
2017-08-29 10:36:25,313 ERROR [org.alfresco.repo] [http-apr-8080-exec-1] Could not find db://301f9a77-51a2-4986-896d-e4f7f6e63995.bin in the repo
2017-08-29 10:36:25,313 DEBUG [org.alfresco.repo.content.AbstractContentWriter] [http-apr-8080-exec-1] 
Writer spawned new reader: 
  writer: ContentAccessor[ contentUrl=db://301f9a77-51a2-4986-896d-e4f7f6e63995.bin, mimetype=null, size=0, encoding=UTF-8, locale=en_US]
  new reader: ContentAccessor[ contentUrl=db://301f9a77-51a2-4986-896d-e4f7f6e63995.bin, mimetype=null, size=0, encoding=UTF-8, locale=en_US]
2017-08-29 10:36:25,314 DEBUG [org.alfresco.repo.content.cleanup.EagerContentStoreCleaner] [http-apr-8080-exec-1] Post-commit deletion of old content URLs: 

I know I am not providing the code, but my question is as follows: This EagerContentStoreCleaner is marking my URL to be deleted. I don't know why.

My custom component creates a temporary file and then, using a org.alfresco.service.cmr.repository.ContentStreamListener (as seen in https://github.com/Alfresco/alfresco-sdk-samples/blob/alfresco-51/all-in-one/custom-content-store-repo/src/main/java/org/alfresco/tutorial/contentstore/DbContentStreamListener.java), waits for Alfresco to inform that the file has been filled, but the method never gets invoked.

I am at a loss at how to even troubleshoot this, the listener does not get called and the file is never written, so of course, it is never found. I don't know where to look. This does not happen with the vanilla Filesystem Content provider.

0

There are 0 answers