Skip to content

Conversation

@eiresendez
Copy link
Contributor

@eiresendez eiresendez commented Dec 9, 2025

Issue & Reproduction Steps

The Smart Extract subprocess surfaced only “Script execution failed with exit code: 1” in the Errors tab, hiding the actual root cause.

Reproduce: run Smart Extract subprocess with an invalid/missing SMART_EXTRACT_API_HOST; the UI shows only the generic exit code and no actionable message.

Solution

  • Enhanced error extraction in ProcessMaker/Jobs/ErrorHandling.php to surface concise, meaningful messages from microservice responses (prefers output error/exception/stderr/stdout; trims to first line and limits length; keeps timeout handling intact).
  • Added PHPUnit coverage in tests/Unit/ErrorHandlingTest.php for output precedence, stderr first-line trimming, timeout handling and fallback to raw message.

Before:
before

After:
after

How to Test

  1. Functional UI check: trigger the Smart Extract subprocess with SMART_EXTRACT_API_HOST blank/invalid. In the request Errors tab, you should see the specific message (e.g., “SMART_EXTRACT_API_HOST is required but could not be resolved”) instead of a generic exit code.
  2. Unit tests: run php artisan test --filter=ErrorHandlingTest to verify the new error-handling cases.

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube

@mcraeteisha mcraeteisha self-requested a review December 9, 2025 16:21
@sanjacornelius sanjacornelius merged commit 11943c9 into epic/FOUR-26611 Dec 9, 2025
9 of 18 checks passed
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.

5 participants