Netcentric / vault-upgrade-hook

Jackrabbit FileVault Install Hook to perform additional actions during package installation
Eclipse Public License 1.0
19 stars 13 forks source link

NPE in upgrade processor #54

Closed pun-ky closed 4 years ago

pun-ky commented 4 years ago

using 1.0.4

3.06.2020 09:13:29.284 *ERROR* [qtp511676655-3004] biz.netcentric.vlt.upgrade.UpgradeProcessor Error during END phase, this will *not* mark the package installation as failed.
java.lang.NullPointerException: null
    at biz.netcentric.vlt.upgrade.UpgradeProcessor.updateInfoStatus(UpgradeProcessor.java:111)
    at biz.netcentric.vlt.upgrade.UpgradeProcessor.saveStatus(UpgradeProcessor.java:104)
    at biz.netcentric.vlt.upgrade.UpgradeProcessor.executeActionsAndSaveStatus(UpgradeProcessor.java:98)
    at biz.netcentric.vlt.upgrade.UpgradeProcessor.execute(UpgradeProcessor.java:78)
nc-andreashaller commented 4 years ago

Thanks for submitting this issue. Did you analyse already why the NPE happens and this is about setting the right status in that case or is this issue about fixing the actual cause of the issue?

pun-ky commented 4 years ago

yep, it is because I misconfigured package building

javax.jcr.PathNotFoundException: Node with path /etc/packages/foo/foo.ui.apps-sites-xxx-SNAPSHOT.zip/jcr:content/vlt:definition/upgrader does not exist.

better error reporting will be appreciated here

nc-andreashaller commented 4 years ago

Alright, thanks for clarification. You suggest that the NPE should be a more specific exception or do you have something else in mind? For sure you are also welcome to open a PullRequest.

pun-ky commented 4 years ago

hmmm I've got in my package 'META-INF/vault/definition/upgrader' ZIP entry with contents copied from samples/groovy however this "upgrader" node is not being persisted in JCR under definition when installing even when I comment out hook (skipping it in package). Any ideas why?

pun-ky commented 4 years ago

the cause is simple and straightforward, upgrader node not existing in package and such message should be displayed and eventually what should be checked/fixed to push it forward

pun-ky commented 4 years ago

samples/groovy-package after building cannot be installed on AEM as it is not containing even 'jcr_root'.

please provide real-life sample for AEM - a module with some content and vault-upgrade-hook configured. I am having serious problems to configure it in a single module with all plugins configured all together (mean filevault-package-maven-plugin, wcmio-content-package-maven-plugin, etc);

sadly, while not having it, it is effectively stopping me from using this vault-upgrade-hook :/

pun-ky commented 4 years ago

@nc-andreashaller the root cause was missing defaultPhase="installed" in samples it was hard to infer what was exactly going on.

now stuck on

Caused by: java.lang.IncompatibleClassChangeError: Found interface com.icfolson.aem.groovy.console.response.RunScriptResponse, but class was expected
    at biz.netcentric.vlt.upgrade.handler.groovy.GroovyScript.execute(GroovyScript.java:50)
    at biz.netcentric.vlt.upgrade.UpgradeProcessor.executeActions(UpgradeProcessor.java:133)
    at biz.netcentric.vlt.upgrade.UpgradeProcessor.execute(UpgradeProcessor.java:75)
    ... 58 common frames omitted
23.06.2020 11:01:16.669 *INFO* [qtp511676655-3352] biz.netcentric.vlt.upgrade.UpgradeProcessor phase [INSTALL_FAILED] - null
23.06.2020 11:01:16.669 *INFO* [qtp511676655-3352] biz.netcentric.vlt.upgrade.UpgradeProcessor starting execution

I guess because of groovy console API changes (used with 15.1.0 / most recent)

edit: just checked that it works with Groovy Console <= 14.0.0 so we need recompilation of vault-upgrade-hook.

could you provide a new release with compatibility for recent Groovy Console?

nc-andreashaller commented 4 years ago

Thanks for the details. I was already working on making the hook compatible with GroovyConsole 15.1.0, hopefully I can provide the new hook version soon. I'll also have a look why the sample is not building correctly.

Thanks again for your input.

nc-andreashaller commented 4 years ago

PR for fixing the broken sample packages: https://github.com/Netcentric/vault-upgrade-hook/pull/56

pun-ky commented 4 years ago

how about

@nc-andreashaller the root cause was missing defaultPhase="installed" in samples it was hard to infer what was exactly going on.

I cannot see any changes in PR regarding this

nc-andreashaller commented 4 years ago

Because the defaultPhase is optional, that is not needed, I successfully tested the sample package with the changes from my PR.