community.sap_install icon indicating copy to clipboard operation
community.sap_install copied to clipboard

sap_swpm: unhandled exception when using sap_swpm_swpm_observer_mode...

Open berndfinger opened this issue 1 year ago • 2 comments

... and not defining sap_swpm_swpm_remote_access_user.

The error occurs in task SAP SWPM Pre Install - Set sapinst command. The complete error message is:

fatal: [host01]: FAILED! => msg: 'An unhandled exception occurred while templating ''{{ ''SAPINST_REMOTE_ACCESS_USER='' + sap_swpm_swpm_remote_access_user + '' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true'' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined and sap_swpm_swpm_remote_access_user | length > 0 else '''' }}''. Error was a <class ''ansible.errors.AnsibleError''>, original message: Unexpected templating type error occurred on ({{ ''SAPINST_REMOTE_ACCESS_USER='' + sap_swpm_swpm_remote_access_user + '' SAPINST_REMOTE_ACCESS_USER_IS_TRUSTED=true'' if sap_swpm_swpm_observer_mode and sap_swpm_swpm_remote_access_user is defined and sap_swpm_swpm_remote_access_user | length > 0 else '''' }}): object of type ''NoneType'' has no len(). object of type ''NoneType'' has no len()'

The error does not happen when sap_swpm_swpm_remote_access_user is defined, e.g. as 'root' or ''.

I have not yet been able to reproduce this issue with a simple yml test file which contains just this task.

The related PR is https://github.com/sap-linuxlab/community.sap_install/pull/749 .

The ansible version is ansible [core 2.16.7], with jinja version = 3.1.4 and python version 3.12.3

berndfinger avatar Jul 05 '24 10:07 berndfinger

Sorry for the delay @berndfinger . I'll have a look next week.

rob0d avatar Aug 15 '24 16:08 rob0d

I was able to replicate this.

rob0d avatar Aug 30 '24 19:08 rob0d

I believe this is fixed in #850. Closing now.

berndfinger avatar Feb 17 '25 17:02 berndfinger