Skip to content

RequestTask: a failed SOAP call does not fail the process with the stop error strategy #25

Description

@njoubert-cleverage

Description

When a SOAP call fails, RequestTask does not report the failure to the process manager:

  • with error_strategy: stop (the default), the process stops but is not failed: it ends with "executed successfully" and the console command exits 0;
  • with error_strategy: skip, the error outputs receive false instead of the task input, unlike every other task.

Reproduction

unreachable is a non-WSDL client whose location is a closed port (http://127.0.0.1:1/soap), so every call fails with a SoapFault:

clever_age_process:
    configurations:
        demo.soap.call_failure:
            tasks:
                entry:
                    service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
                    options:
                        output:
                            sCountryISOCode: 'FR'
                    outputs: [request]
                request:
                    service: '@CleverAge\SoapProcessBundle\Task\RequestTask'
                    error_strategy: 'stop'
                    options:
                        client: unreachable
                        method: 'FullCountryInfo'
                    outputs: [debug]
                debug:
                    service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
$ bin/console cleverage:process:execute demo.soap.call_failure
ALERT     [app] Soap call 'FullCountryInfo' on '' failed : Could not connect to host [...]
ERROR     [app] Empty resultset for query [...]
Process 'demo.soap.call_failure' executed successfully
$ echo $?
0

With error_strategy: skip and error_outputs: [debug_error] (demo.soap.call_failure_skip), debug_error dumps false.

Expected: the process fails (non-zero exit code) with the stop strategy; the error outputs receive the task input with the skip strategy.

Tested on main (1a796cb), cleverage/process-bundle 5.1, PHP 8.5, Symfony 7.4.

Cause

On a false result, RequestTask::execute() applies the error strategy itself: it calls $state->setStopped(true) without an exception (so the process history is never marked as failed) and $state->setErrorOutput(false). It then calls $state->setOutput(false) in every case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions