sap-linuxlab / community.sap_install

Automation for SAP - Collection of Ansible Roles for various SAP software installation
Apache License 2.0
52 stars 55 forks source link

sap_swpm: unhandled exception when using sap_swpm_swpm_observer_mode... #792

Open berndfinger opened 2 months ago

berndfinger commented 2 months ago

... 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

rob0d commented 1 month ago

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

rob0d commented 2 weeks ago

I was able to replicate this.