-
Notifications
You must be signed in to change notification settings - Fork 275
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
Chrome process stopped before startup completed #520
Comments
Why did you close this? There is no indication it is solved. I am working on this with Marc, and none of your linked issues have anything to do with this. What we are seeing is the running a command in the shell works, but it also outputs several warnings/errors, and attempting to run via a web server interpreting it via PHP fails. However, if I run the same PHP file from the cli, it runs just fine. In addition, we have attempted to create a bash script to run the command, since it works from the cli, and use shell_exec() to run the script, and that too fails. We have even gone as far as running the PHP file that runs the bash script via shell_exec() from the cli, and it works. It only fails if a web server is interpreting the php file. Here is an example of that last scenario working:
Here is an example of the command in the bash script runnign diectly from the shell working. Note the warnings/errors about freedesktop and SUID sandbox that should not be there as we are running headless and with no sandbox. It is as if Chrome is simply ignoring those options:
I can't really tell what is happening when we let the web server attempt the same command in PHP via shell_cmd() as it just does a core dump. No matter how wew aproach this, it works from from the shell, either directly or via PHP but fails when PHP is processes by the web server. |
I will also add that this behaviour is identical on two different web servers. One on bare metal, running AlmaLinux 8.8 and CyberPanel (OpenLitespeed) using PHP 8.1 and the other on AWS EC2 instance, AlmaLinux 8.7 and CyperPanel (OpenLitespeed). The paths are different between the two servers, but not much else is. It doesn't matter if we run as root or web server user. Root generates an extra error or two, but the web server user has all the required permissions. I have tested that extensively. I also made the chrome binary available via sudo without password and tried that. The only differnce that made was the owner of the generated PDF file was root and needed to be changed to the web server user. It still generated the file when run from shell and fell on its face if attempted from the web server. |
I closed it because it was the same error from the other issues with no new information, but I can leave it open to see if somebody helps. Your script should behave the same both in the command line and in the web server. If it doesn't, the web server is not executing the same binary and/or loading the same configs and permissions. The web server can run the script with another user, or change the uid/gid of the php process during execution (mod_ruid) or even use an external process to execute the php (fpm, cgi). |
I have ensured that the user used by the web server is the user I used from the shell in testing. It didn't change anything. Also we have compared the php.ini used by the web server with the one used by the cli call to php, and they were the same. We are calling the Chrome binary with the full path to the binary, so they too are the same. In addition I made sure the php binary used by the web server and the cli were the same binary at the same path. Really don't know what else to check that would make the environment differt. My wild guess is that the shell ignores the warnings and errors and continutes, but the web server sees those and halts on error. We have yet to be able to get it to run without outputing errors, including errors that I feel should not be there due to our useage of |
I am experiencing the exact same thing. I have the initial php script that when I run it from CLI it works fine. In browser, nope—times out. I did add the debug-logger.. then attempted to run via a second php file using passthru() — also system(), exec(), etc. At the end the error I see is: the relevant bit probably being: I am running this on a pretty clean install of CentOS 9 + php8.0 (but have tested with other versions) Ive done quite a bit to try to solve this:
i am probably missing something, but it continues to work on the CLI but not in the browser. I think it may have something to do with Apache not being able to connect using chromium — whereas when ran from the CLI from my user… it works every time. I am really hoping someone can point something else out to try because I think I’m stumped. Much appreciated! |
Hi @enricodias @T313C0mun1s7 @kuito, I'm experiencing the same issue. I have probably figured out the reason but I don't know how to solve this yet. My issue is that I'm calling That's probably the reason why it works for most of you using CLI and doesn't work on through the web browser. They are different processes that don't block each other. So if anyone has any ideas on how to approach this, it would be very appreciated. Cheers, |
@pdrhlik that shouldn't be an issue since a new request will create a separate process/thread. Your php process executing |
That's what I thought at first but it seems to be behaving like this. I don't have any other explanation for that. Maybe it's because I'm using php-fpm, it doesn't start a new process but reuses the same one? Anyway, I ended up handling the screenshot functionality using a Go library https://github.com/sensepost/gowitness. I build the command in PHP and calling it through But thanks for your input anyway! |
php-fpm wouldn't change that behaviour either, this is just not how php works. The http server raises a php process/thread on each request and this process doesn't receive the context of any previous requests. Maybe your script is locking a resource like a file or a db row, cause a deadlock. |
Trying to get this running so I can convert html files. When I try to convert I get the above error message (sorry not very informative!). Any suggestions?
The text was updated successfully, but these errors were encountered: