FOUR-30789: Fix Nayra REST host resolution for multitenant script execution#8824
Open
eiresendez wants to merge 1 commit into
Open
FOUR-30789: Fix Nayra REST host resolution for multitenant script execution#8824eiresendez wants to merge 1 commit into
eiresendez wants to merge 1 commit into
Conversation
nolanpro
approved these changes
May 8, 2026
|
Contributor
|
QA server K8S was successfully deployed https://tenant-1.ci-87f9422be1.engk8s.processmaker.net |
Contributor
Author
|
Thanks, Nolan, for generating the QA CI server: After running the same test performed on my local using the route above, the fix is still not correct and the issue is reproducible in QA. The following endpoint is returning HTTP 500 errors:
I think I may need the exact configuration from a real multitenant production environment in order to validate and provide an accurate fix. I will try to get that again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Issue & Reproduction Steps
FOUR-30789 tracks a multitenant server error while working with an Expense Report process created from a guide template.
The failure happens when a task edit flow triggers a synchronous php-nayra script execution. In the reproduced multitenant case, opening:
https://processmaker-b.test/tasks/40/editcan trigger the failing endpoint:
POST https://processmaker-b.test/api/1.0/scripts/execute/26?task_id=40Root cause: when the app switches tenant context,
app.instancechanges. The php-nayra runner then tried to resolve or start a tenant-specific Nayra Docker container instead of using the configuredNAYRA_REST_API_HOST. That can make the script execution endpoint fail even though the shared Nayra REST service is configured and available.The fix also preserves the single-tenant path, where this endpoint continues to work:
POST https://processmaker.test/api/1.0/scripts/execute/40?task_id=574Solution
NAYRA_REST_API_HOSTtake priority when resolving the Nayra base URL.NAYRA_REST_API_HOSTis not configured: use cached Nayra IPs when available, or bring up Nayra before resolving the Docker URL.ScriptException.How to Test
./vendor/bin/phpunit tests/unit/ProcessMaker/Models/ScriptDockerNayraTraitTest.phpOK (5 tests, 14 assertions)NAYRA_REST_API_HOSTconfigured, openhttps://processmaker-b.test/tasks/40/editand confirmPOST /api/1.0/scripts/execute/26?task_id=40returns200.https://processmaker.test/tasks/575/editand confirmPOST /api/1.0/scripts/execute/40?task_id=574still returns200.Related Tickets & Packages
ci:deploy
ci:multitenancy
ci:k8s-branch:fix-multitenancy
.