puppetlabs-tomcat icon indicating copy to clipboard operation
puppetlabs-tomcat copied to clipboard

Installation from archive location problem

Open Enrice opened this issue 1 year ago • 1 comments

Describe the Bug

The way archive is used with the installation from source does not work in my setup. It seems curl doesn't download the archive.

Expected Behavior

curl should download the archive which in turn should be extracted in place.

Environment

  • module version 7.2.0
  • Rocky Linux 9
  • puppet 7.28.0
  • archive 7.1.0
  • curl 7.76.1 (x86_64-redhat-linux-gnu) libcurl/7.76.1 OpenSSL/3.0.7 zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh/0.10.4/openssl/zlib nghttp2/1.43.0
  • tar 1.34

I provided PR #559 as a workaround

Enrice avatar Feb 08 '24 14:02 Enrice

Some debug log to show the problem:

Debug: /Stage[main]/Main/Node[default]/Eip::Liferay62ce[eip-liferay]/Liferay62ce[eip-liferay]/Tomcat8[eip-liferay]/Tomcat::Install[/data/eip-liferay/tomcat8.5.57]/Tomcat::Install::Source[/data/eip-liferay/tomcat8.5.57]/File[/data/eip-liferay/tomcat8.5.57]: The container Tomcat::Install::Source[/data/eip-liferay/tomcat8.5.57] will propagate my refresh event
Debug: Executing: '/bin/curl https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.57/bin/apache-tomcat-8.5.57.tar.gz -o /tmp/apache-tomcat-8.5.57.tar.gz_20240208-65842-1mc19q4 -fsSLg --max-redirs 5'
Debug: Archive extracting /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz in /data/eip-liferay/tomcat8.5.57: tar --strip 1 -xf /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz
Debug: Executing with uid=tomcat gid=tomcat: 'tar --strip 1 -xf /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz'
Debug: Cleanup archive /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz
Error: Execution of 'tar --strip 1 -xf /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz' returned 2: tar: /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
Error: /Stage[main]/Main/Node[default]/Eip::Liferay62ce[eip-liferay]/Liferay62ce[eip-liferay]/Tomcat8[eip-liferay]/Tomcat::Install[/data/eip-liferay/tomcat8.5.57]/Tomcat::Install::Source[/data/eip-liferay/tomcat8.5.57]/Archive[/data/eip-liferay/tomcat8.5.57-/data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz]/ensure: change from 'absent' to 'present' failed: Execution of 'tar --strip 1 -xf /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz' returned 2: tar: /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
Debug: Tomcat::Install::Source[/data/eip-liferay/tomcat8.5.57]: Resource is being skipped, unscheduling all events

Reason:

[root@rocky9-cis DEV1]# ll /data/eip-liferay/tom*
total 0

The archive is just not there, nor in /tmp

Enrice avatar Feb 08 '24 14:02 Enrice

Debug: Executing with uid=tomcat gid=tomcat: 'tar --strip 1 -xf /data/eip-liferay/tomcat8.5.57/apache-tomcat-8.5.57.tar.gz'

Puppet is trying to run this command as the tomcat user. Maybe the folder permissions aren't set up the right way.

moritzdietz avatar Mar 05 '25 14:03 moritzdietz

That observation is correct. I had to set "manage_home" on tomcat::install, then it worked as it should.

Enrice avatar Mar 10 '25 12:03 Enrice