Skip to content

FOUR-30789: MULTITENANT Server Error creating a new report from an Expense Report process created from Guide Template#8819

Closed
eiresendez wants to merge 1 commit into
developfrom
task/FOUR-30789
Closed

FOUR-30789: MULTITENANT Server Error creating a new report from an Expense Report process created from Guide Template#8819
eiresendez wants to merge 1 commit into
developfrom
task/FOUR-30789

Conversation

@eiresendez
Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

FOUR-30789: MULTITENANT Server Error creating a new report from an Expense Report process created from Guide Template
Ticket: https://processmaker.atlassian.net/browse/FOUR-30789

Creating a report from an Expense Report process generated from a Guide Template can trigger php-nayra script execution in multitenant mode, where Nayra resolves a tenant-specific Docker container instead of the configured REST service.

  1. Create or select a guide template that includes an Expense Report process.
  2. Generate a new Expense Report process from the template.
  3. Attempt to create a new report associated with that generated process.
  4. Fill required fields and save or create the report.
  5. Observe the server error during report creation when php-nayra execution resolves the wrong Nayra endpoint in multitenant mode.

Solution

  • Updated php-nayra execution to use app.nayra_rest_api_host directly when configured.
  • Skipped Docker Nayra address discovery, health fallback, and container startup when a configured Nayra REST API host is present.
  • Normalized configured Nayra REST API hosts by trimming trailing slashes before appending /run_script.
  • Moved curl HTTP status inspection before closing the curl handle.
  • Added focused unit coverage for configured REST host precedence and the existing Docker-address fallback.

How to Test

  1. Run vendor/bin/phpunit tests/unit/ProcessMaker/Models/ScriptDockerNayraTraitTest.php.
  2. In a multitenant environment with NAYRA_REST_API_HOST configured, generate an Expense Report process from a guide template and create a new report.
  3. Verify the report is created without a server error and php-nayra posts to the configured Nayra REST endpoint instead of attempting tenant-specific Docker container discovery.

Related Tickets & Packages

@processmaker-sonarqube
Copy link
Copy Markdown

@eiresendez
Copy link
Copy Markdown
Contributor Author

Closing this ticket because I will be working on a different solution instead of continuing with this draft implementation. The issue will be addressed through the new approach to avoid duplicate efforts and keep the work aligned in a single track.

@eiresendez eiresendez closed this May 7, 2026
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