Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Scan server.command for the possible path to the PHP/script/binary file #658

Closed
rustatian opened this issue May 4, 2021 · 4 comments · Fixed by #713
Closed

[RFC] Scan server.command for the possible path to the PHP/script/binary file #658

rustatian opened this issue May 4, 2021 · 4 comments · Fixed by #713
Assignees
Labels
A-other Area: other C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc.. S-RFC Request: Request for comments
Milestone

Comments

@rustatian
Copy link
Member

rustatian commented May 4, 2021

Currently, error handling when the wrong path is provided in the server.command is terrible and leads to a bad UX. Consider the following approach:

  1. Scan the command and try to find the *.php pattern to treat it as a path.
  2. If the path is found, try to stat it, and in case of a wrong path provided, print a user-friendly message.
  3. Because it is heuristic, do not panic on the wrong path; print a message.
  4. We could apply the same way of handling other patterns like .sh or .ps.
@rustatian rustatian added C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc.. S-RFC Request: Request for comments A-other Area: other labels May 4, 2021
@rustatian rustatian self-assigned this May 4, 2021
@rustatian rustatian changed the title [RFC] Scan server.command for the possible path to the PHP file [RFC] Scan server.command for the possible path to the PHP/script/binary file May 4, 2021
@rustatian rustatian added this to the 2.4.0 milestone May 21, 2021
@rustatian rustatian modified the milestones: 2.4.0, 2.3.0 Jun 7, 2021
@treadmillian
Copy link

Can you confirm if this is why I see this error?

scan command {"error": "server_command_scan: scan failed, possible path not found"}

@rustatian
Copy link
Member Author

Can you confirm if this is why I see this error?

scan command {"error": "server_command_scan: scan failed, possible path not found"}

Yep, but actually, this is an info level message:
https://github.com/spiral/roadrunner/blob/master/plugins/server/plugin.go#L100
Could you please show the command you use? I'll try to improve the scanner.

@mmalessa
Copy link

mmalessa commented Jul 1, 2021

Hi!
I have the same problem.
Command: php bin/console baldinof:roadrunner:worker - baldinof/roadrunner-bundle
Temporary workaround: cp ./bin/console ./bin/console.php ..but that shouldn't be the target solution ;-)
Regards!

@rustatian
Copy link
Member Author

Hi!
I have the same problem.
Command: php bin/console baldinof:roadrunner:worker - baldinof/roadrunner-bundle
Temporary workaround: cp ./bin/console ./bin/console.php ..but that shouldn't be the target solution ;-)
Regards!

This is not an issue, I mean, the message scan command {"error": "server_command_scan: scan failed, possible path not found"} only notify the user, about the scan result. If a possible path will be found and stat syscall will be unsuccessful, it will point you to the problem with the path to the script/worker.
But, I see that this solution raises questions, I'll try to improve it, thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-other Area: other C-enhancement Category: enhancement. Meaning improvements of current module, transport, etc.. S-RFC Request: Request for comments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants