Skip to content

sapcar_extract: Update SAPCAR command from PATH and add explanation with HANA limitations - #86

Open
marcelmamula wants to merge 1 commit into
sap-linuxlab:devfrom
marcelmamula:sapcar-path
Open

sapcar_extract: Update SAPCAR command from PATH and add explanation with HANA limitations#86
marcelmamula wants to merge 1 commit into
sap-linuxlab:devfrom
marcelmamula:sapcar-path

Conversation

@marcelmamula

@marcelmamula marcelmamula commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Changes

Reported in #85

  • Change sapcar executable to SAPCAR when using PATH.
s02pas:s02adm 1001> which sapcar SAPCAR
sapcar: Command not found.
/usr/sap/S02/SYS/exe/uc/linuxx86_64/SAPCAR

h02adm@s02hana0:/usr/sap/H02/HDB90> which sapcar SAPCAR
which: no sapcar in (/lss/shared/H02/exe:/usr/sap/H02/HDB90/exe/krb5/bin:/usr/sap/H02/HDB90/exe/krb5/sbin:/usr/sap/H02/HDB90/s02hana0:/usr/sap/H02/HDB90:/usr/sap/H02/HDB90/exe:/usr/sap/H02/HDB90/exe/mdc:/usr/sap/H02/HDB90/exe/Python3/bin:/usr/sap/H02/HDB90/exe/dat_bin_dir:/usr/sap/H02/home:/usr/sap/H02/home/.local/bin:/usr/local/bin:/usr/bin:/bin)
/usr/sap/H02/HDB90/exe/SAPCAR
  • Add explanation of limitations in this scenario when used with SAP HANA user.

Reason for limitation

SAP HANA comes with bundled outdated Python version, causing incompatibility with ansible-core version on Control node.

fatal: [b01hana]: FAILED! =>
    ansible_facts:
        discovered_interpreter_python: /usr/bin/python3.13
    changed: false
    module_stderr: |-
        Shared connection to b01hana closed.
    module_stdout: |-
        Traceback (most recent call last):
          File "/var/tmp/ansible-tmp-1781867144.5599601-864630-36766788676533/AnsiballZ_sapcar_extract.py", line 5, in <module>
            import datetime
          File "/usr/sap/H01/HDB90/exe/Python3/lib/python3.8/datetime.py", line 8, in <module>
            import math as _math
        ModuleNotFoundError: No module named 'math'
    msg: 'Module result deserialization failed: No start of json char found'
    rc: 1

Tests

Tested with variations of following task

    - name: Execute module sapcar_extract
      community.sap_libs.sapcar_extract:
        path: /software/sap_swpm_download_basket/SAPEXEDB_50-70008101.SAR
        dest: /tmp/sapcar_extract
        overwrite: true
      become: true
      become_user: s02adm
      become_method: sudo
      become_flags: "-i"

@marcelmamula

Copy link
Copy Markdown
Contributor Author

@herrmie Are you able to test it?

@marcelmamula
marcelmamula requested review from berndfinger and rhmk July 29, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant