shinesolutions/puppet-aem-curator

Healthcheck installation fails with Permission Denied

Closed this issue · 3 comments

In some very rare cases the installation of the Healthcheck fails due to wrong permissions.

Error Message:

02.10.2019 14:25:30.173 *ERROR* [Timer-0] org.apache.sling.installer.provider.file.impl.Installer Unable to read file /mnt/ebs1/author/crx-quickstart/install/aem-healthcheck-content-1.3.3.zip20191002-3605-9srla7
java.io.FileNotFoundException: /mnt/ebs1/author/crx-quickstart/install/aem-healthcheck-content-1.3.3.zip20191002-3605-9srla7 (Permission denied)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.apache.sling.installer.provider.file.impl.Installer.createResource(Installer.java:156)
        at org.apache.sling.installer.provider.file.impl.Installer.updated(Installer.java:103)
        at org.apache.sling.installer.provider.file.impl.FileMonitor.run(FileMonitor.java:146)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

It looks like to me that the Puppet File resource place a temporary file to the FS and than renames the file therefore the temporary file is not present or that the permissions are really not correct.

As an improvement we could set the correct permissions when download and placing the file to the temp dir

https://github.com/shinesolutions/puppet-aem-curator/blob/master/manifests/install_aem_healthcheck.pp#L17-L20

This is not a permission denied error it is a java.io.FileNotFoundException error and caused by the behaviour of the puppet ressource file.

The Puppet ressource file copies the file to the new location. While copying it creates a temp file. In very rare cases AEM directly consumes this temp file and tries to install it.

This problem is still happening with Puppet 7.9.0

30.08.2022 09:10:51.499 *ERROR* [Timer-0] org.apache.sling.installer.provider.file.impl.Installer Unable to read file /mnt/ebs1/publish/crx-quickstart/install/aem-healthcheck-content-1.3.3.zip20220830-8826-149zxux

We might want to update the puppet-stdlib to the latest version and test it again.

Upgraded stdlib module to 8.4.0. Going to reopen the issue if it's going to happen again.