Last active
March 12, 2024 10:51
-
-
Save aitseitz/89fbd80bb63fa38c3f13449f3df15ec3 to your computer and use it in GitHub Desktop.
ACS: How to downgrade an AMP-Module like alfresco-aos-module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on Tech Article: | |
// https://community.hyland.com/tskb/000013140-how-to-downgrade-the-outlook-integration-module-after-installing-unsupported-amp-version | |
// the correct uuid for the amp module needs to be identified via the node browser inside the system://system Store | |
var sysNodeUUID = "system://system/8b6df670-9bb3-462b-8483-9b156e2621fd"; | |
var newVersionString = "1.0.0"; | |
/** | |
* Searches for the target node and sets a fix Version for "module:currentVersion" | |
* @param sysNodeUUID {String} module node string e.g. "system://system/uuid" | |
* @param newVersionString {String} the version which will be set for the target node | |
*/ | |
function setFixModuleVersion(sysNodeUUID, newVersionString) { | |
var targetNode = search.findNode(sysNodeUUID); | |
if (targetNode) { | |
logger.log("Fixing Module Version for '" + targetNode.properties["cm:name"] + "':"); | |
logger.log("Module '" + targetNode.properties["cm:name"] + "' (before change) Version = " + targetNode.properties["module:currentVersion"]); | |
targetNode.properties["module:currentVersion"] = newVersionString; | |
targetNode.save(); | |
logger.log("Module '" + targetNode.properties["cm:name"] + "' (after change) Version = " + targetNode.properties["module:currentVersion"]); | |
} else { | |
logger.error("Target Node not found in for " + sysNodeUUID); | |
} | |
} | |
setFixModuleVersion(sysNodeUUID, newVersionString); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR [org.springframework.web.context.ContextLoader] [localhost-startStop-1] Context initialization failed | |
org.alfresco.error.AlfrescoRuntimeException: 06060023 Failed to start modules | |
at org.alfresco.repo.module.ModuleComponentHelper$1.doWork(ModuleComponentHelper.java:326) | |
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:602) | |
at org.alfresco.repo.module.ModuleComponentHelper.startModules(ModuleComponentHelper.java:213) | |
at org.alfresco.repo.module.ModuleServiceImpl.startModules(ModuleServiceImpl.java:149) | |
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.base/java.lang.reflect.Method.invoke(Method.java:566) | |
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) | |
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) | |
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) | |
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) | |
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) | |
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) | |
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) | |
at com.sun.proxy.$Proxy154.startModules(Unknown Source) | |
at org.alfresco.repo.module.ModuleStarter$1.execute(ModuleStarter.java:73) | |
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450) | |
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338) | |
at org.alfresco.repo.module.ModuleStarter$2.doWork(ModuleStarter.java:83) | |
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:602) | |
at org.alfresco.repo.module.ModuleStarter.onBootstrap(ModuleStarter.java:78) | |
at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56) | |
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:221) | |
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:186) | |
at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:206) | |
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402) | |
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359) | |
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896) | |
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) | |
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401) | |
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292) | |
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) | |
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70) | |
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4705) | |
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5168) | |
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) | |
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743) | |
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719) | |
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) | |
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672) | |
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1873) | |
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) | |
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) | |
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) | |
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) | |
at java.base/java.lang.Thread.run(Thread.java:829) | |
Caused by: org.alfresco.error.AlfrescoRuntimeException: 06060022 | |
Downgrading of modules is not supported. | |
Module 'alfresco-aos-module' version 1.3.2.1 is currently installed and must be uninstalled before version 1.3.0 can be installed. | |
at org.alfresco.error.AlfrescoRuntimeException.create(AlfrescoRuntimeException.java:52) | |
at org.alfresco.repo.module.ModuleComponentHelper.startModule(ModuleComponentHelper.java:633) | |
at org.alfresco.repo.module.ModuleComponentHelper.access$5(ModuleComponentHelper.java:530) | |
at org.alfresco.repo.module.ModuleComponentHelper$1$1.execute(ModuleComponentHelper.java:263) | |
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450) | |
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338) | |
at org.alfresco.repo.module.ModuleComponentHelper$1.doWork(ModuleComponentHelper.java:284) | |
... 46 more |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Alternative solution --> Delete AMP Module row from DB: | |
-- Select AOS Module Row | |
SELECT * FROM | |
alf_node_properties prop, | |
alf_qname qname, | |
alf_namespace ns, | |
alf_node_properties prop2 | |
WHERE | |
prop.qname_id = qname.id | |
and qname.ns_id = ns.id | |
and prop2.node_id = prop.node_id | |
and qname.local_name='currentVersion' | |
and ns.uri='http://www.alfresco.org/system/modules/1.0' | |
and prop2.string_value='alfresco-aos-module' | |
-- Delete AOS AMP row from PostgreSQL Database | |
DELETE FROM | |
alf_node_properties prop | |
USING | |
alf_qname qname, | |
alf_namespace ns, | |
alf_node_properties prop2 | |
where | |
prop.qname_id = qname.id | |
and qname.ns_id = ns.id | |
and prop2.node_id = prop.node_id | |
and qname.local_name='currentVersion' | |
and ns.uri='http://www.alfresco.org/system/modules/1.0' | |
and prop2.string_value='alfresco-aos-module' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
easier approach: use the node browser from the admin console (not share) and just delete the module registration. It will be recreated once alfresco restarts.
You could do this also by a javascript like: