Written by The Jahia Team
 
Sysadmins
   Estimated reading time:
 
 

When upgrading a Jahia version, the upgrade fails with the following error if there are config files (*.cfg) under 'JAHIA_INSTALL/digitall-factory-data/modules' directory

2020-10-30 15:10:35.794> Moving file /jahia/digital-factory-data/modules/org.mymodule.cfg to /opt/jahia/digital-factory-data/karaf/etc
2020-10-30 15:10:35.807> Error: Error while applying fix
java.io.IOException: Error executing script /home/jahia/.fixapplier/temp/resources/scripts/after_fix.groovy
	at org.jahia.fixapplier.controller.fixoperations.scripts.ExecuteScriptFixOperation.executeScript(ExecuteScriptFixOperation.java:77)
...
Caused by: javax.script.ScriptException: javax.script.ScriptException: java.nio.file.FileAlreadyExistsException: /jahia/digital-factory-data/karaf/etc/org.mymodule.cfg
	at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:158)

 

Cause

 

As Jahia now uses Karaf to manage the modules configuration. The upgrade will try to copy all the config files which may exist in the 'digital-factory-data/modules' from old version to the new' digital-factory-data/karaf/etc' directory. This error happens due to a bug in the upgrade script as it fails to successfully copy the file.

Solution

 

The solution is to remove the the config files from the 'digital-factory-data/modules' directory and try the upgrade again.

Related links