cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix “Failed to set content property on stream closure”?

iceja
Confirmed Champ
Confirmed Champ

Alfresco version 6.2 community edition:

I have an issue which is similar to https://issues.alfresco.com/jira/browse/ALF-16252 and https://hub.alfresco.com/t5/alfresco-content-services-forum/quot-failed-to-set-content-property-on-s... When I quickly switch between lists in the share it fails with following exception:

2021-04-15 10:27:09,563 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-bio-8080-exec-3970] Exception from executeScript: 03150113 org.alfresco.service.cmr.repository.ContentIOException: 03151030 Failed to set content property on stream closure:    node: workspace://SpacesStore/2a92f3df-5769-4d7a-8fa4-c85a4cc3e408   property: {http://www.alfresco.org/model/content/1.0}preferenceValues   writer: ContentAccessor[ contentUrl=store://2021/4/15/10/27/26fce69f-191f-4094-bc8b-c81c89389fcb.bin, mimetype=text/plain, size=920, encoding=UTF-8, locale=ru_RU]org.springframework.dao.ConcurrencyFailureException: Failed to update node 730
org.springframework.extensions.webscripts.WebScriptException: 03150113 org.alfresco.service.cmr.repository.ContentIOException: 03151030 Failed to set content property on stream closure: 
   node: workspace://SpacesStore/2a92f3df-5769-4d7a-8fa4-c85a4cc3e408
   property: {http://www.alfresco.org/model/content/1.0}preferenceValues
   writer: ContentAccessor[ contentUrl=store://2021/4/15/10/27/26fce69f-191f-4094-bc8b-c81c89389fcb.bin, mimetype=text/plain, size=920, encoding=UTF-8, locale=ru_RU]
org.springframework.dao.ConcurrencyFailureException: Failed to update node 730
        at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1124)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
        at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:527)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:595)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:664)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:435)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:315)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210)
        at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
        at org.alfresco.repo.web.scripts.AlfrescoWebScriptServlet.service(AlfrescoWebScriptServlet.java:43)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.alfresco.web.app.servlet.ClearSecurityContextFilter.doFilter(ClearSecurityContextFilter.java:53)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.mozilla.javascript.JavaScriptException: JavaException: org.alfresco.service.cmr.repository.ContentIOException: 03151030 Failed to set content property on stream closure: 
   node: workspace://SpacesStore/2a92f3df-5769-4d7a-8fa4-c85a4cc3e408
   property: {http://www.alfresco.org/model/content/1.0}preferenceValues
   writer: ContentAccessor[ contentUrl=store://2021/4/15/10/27/26fce69f-191f-4094-bc8b-c81c89389fcb.bin, mimetype=text/plain, size=920, encoding=UTF-8, locale=ru_RU]
org.springframework.dao.ConcurrencyFailureException: Failed to update node 730 (classpath*:alfresco/templates/webscripts/org/alfresco/repository/preference/preferences.post.json.js#37)
        at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_repository_preference_preferences_post_json_js_5._c_main_1(classpath*:alfresco/templates/webscripts/org/alfresco/repository/preference/preferences.post.json.js:37)
        at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_repository_preference_preferences_post_json_js_5.call(classpath*:alfresco/templates/webscripts/org/alfresco/repository/preference/preferences.post.json.js)
        at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:87)
        at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_repository_preference_preferences_post_json_js_5._c_script_0(classpath*:alfresco/templates/webscripts/org/alfresco/repository/preference/preferences.post.json.js:41)
        at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_repository_preference_preferences_post_json_js_5.call(classpath*:alfresco/templates/webscripts/org/alfresco/repository/preference/preferences.post.json.js)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:409)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3566)
        at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_repository_preference_preferences_post_json_js_5.call(classpath*:alfresco/templates/webscripts/org/alfresco/repository/preference/preferences.post.json.js)
        at org.mozilla.javascript.gen.classpath__alfresco_templates_webscripts_org_alfresco_repository_preference_preferences_post_json_js_5.exec(classpath*:alfresco/templates/webscripts/org/alfresco/repository/preference/preferences.post.json.js)
        at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:509)
        at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:207)
        at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:219)
        at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:181)
        at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:109)
        at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1376)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
        ... 37 more

Here is the screenshot image

1 ACCEPTED ANSWER

iceja
Confirmed Champ
Confirmed Champ

I have handle it in JavaScript project-share/src/main/assembly/web/js/components/dashlets/tabbed-dashlet.js simply rejectin to save preferences when user click faster than once per 2600 milliseconds.

var inMotion =  Date.now();

...
var
duration = Date.now() - inMotion;
console.log("DEBUG: " + duration);
if( duration < 2600){
// too often
} else {
this.services.preferences.set(this.DASHLET_TAB, subid.substring(this.id.length + 1));
}
inMotion = Date.now();

View answer in original post

2 REPLIES 2

iceja
Confirmed Champ
Confirmed Champ

I have handle it in JavaScript project-share/src/main/assembly/web/js/components/dashlets/tabbed-dashlet.js simply rejectin to save preferences when user click faster than once per 2600 milliseconds.

var inMotion =  Date.now();

...
var
duration = Date.now() - inMotion;
console.log("DEBUG: " + duration);
if( duration < 2600){
// too often
} else {
this.services.preferences.set(this.DASHLET_TAB, subid.substring(this.id.length + 1));
}
inMotion = Date.now();

EddieMay
World-Class Innovator
World-Class Innovator

Hi @iceja 

Thanks for providing your solution - really helpful to other users.

Cheers,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!