Skip to content

Playbook fails despite successful SAP request execution using sap_pyrfc module #50

@wendelsilva

Description

@wendelsilva

Summary

I'm using the community.sap_libs.sap_pyrfc module to create requisitions in SAP. All RFC and connection parameters are correctly configured, and the requisition is successfully created in the SAP system. However, the playbook execution still returns a failed status, even though SAP processes the request successfully.

This behavior causes issues in our automation pipeline since the task is marked as failed, even when the desired result is achieved in SAP.

module_stdout: ''
  module_stderr: >
    Traceback (most recent call last):
      File "/root/.ansible/tmp/ansible-tmp-1744724504.5124443-67-11446826847753/AnsiballZ_sap_pyrfc.py", line 107, in <module>
        _ansiballz_main()
      File "/root/.ansible/tmp/ansible-tmp-1744724504.5124443-67-11446826847753/AnsiballZ_sap_pyrfc.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/root/.ansible/tmp/ansible-tmp-1744724504.5124443-67-11446826847753/AnsiballZ_sap_pyrfc.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.community.sap_libs.plugins.modules.sap_pyrfc', init_globals=dict(_module_fqn='ansible_collections.community.sap_libs.plugins.modules.sap_pyrfc', _modlib_path=modlib_path),
      File "/usr/lib64/python3.9/runpy.py", line 225, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "ansible_collections/community/sap_libs/plugins/modules/sap_pyrfc.py", line 187, in <module>
      File "ansible_collections/community/sap_libs/plugins/modules/sap_pyrfc.py", line 183, in main
      File "ansible/module_utils/basic.py", line 1553, in fail_json
      File "ansible/module_utils/basic.py", line 1522, in _return_formatted
      File "ansible/module_utils/common/parameters.py", line 927, in remove_values
      File "ansible/module_utils/common/parameters.py", line 470, in _remove_values_conditions
    TypeError: Value of unknown type: <class 'decimal.InvalidOperation'>,
    [<class 'decimal.ConversionSyntax'>]

Issue Type

Bug Report

Component Name

community.sap_libs.sap_pyrfc

Ansible Version

$ ansible --version 
2.18

community.sap_libs Version

$ ansible-galaxy collection list community.sap_libs

community.sap_libs:1.4.2

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

Expected Results

Expected the number of the requisition created in SAP

Actual Results

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions