-
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
Cannot yet tell if frame is final #398
Comments
To verify if it's a problem with the library, we need to be able to reproduce the problem at our end. Your logs just shows a normal timeout, meaning that the chrome process didn't reply fast enough. Can you provide a sample code that leads to the errors you mentioned? |
Sure. I've created a custom wrapper for your tool. The strange thing is, that the exact same code sometimes worked 20x and right now it does not work. I already tried to change timeouts but the exceptions will be thrown after a few seconds (bellow the timeout limit) In my Index i run the following code:
Relevant code of the function (The code does not reach the try-block):
|
Are you executing this code in parallel? Can you test it using the version 1.4? |
I tested all versions and the same error occurred beginning with version 0.10.0.
And I don't run the code in parallel. The interesting part is, that I don't have the feeling of changing any setting in chrome (not my default browser, so it is only used by your script) but sometimes it worked without any problem... |
When you execute in non-headless-mode, does the browser remains alive after the error? I'm thinking that something else may be killing your chrome process. |
The browser remains open for the full 5s till the timeout. Is it maybe an anti-virus-related issue? This script is running on a company device and we use MS Defender |
same issue. browser version 103.0.5060.134-1. package 1.6.1 |
I executed this exact code and couldn't reproduce the error: include 'vendor/autoload.php';
use HeadlessChromium\BrowserFactory;
$s_url = 'https://github.com/chrome-php/chrome';
$i_quality = 90;
$s_destination = 'test.jpg';
$o_browserFactory = new BrowserFactory();
$o_browser = $o_browserFactory->createBrowser([
'windowSize' => [1920, 1080],
'noSandbox' => true,
]);
try {
$o_page = $o_browser->createPage();
$o_page->navigate($s_url)->waitForNavigation();
$o_screenshot = $o_page->screenshot([
'format' => 'jpeg',
'quality' => $i_quality,
]);
$o_screenshot->saveToFile($s_destination);
} catch (Exception $e) {
// Return Error
} It's probably something related to your specific setup. The fatal error when calling |
This issue has been automatically marked as stale because there has been no recent activity. It will be closed after 30 days if no further activity occurs. Thank you for your contributions. |
Hi,
unfortunately I have some problems running your code (sometimes). I already tried to run the browser in non-headless-mode where I see, that the browser is running. Then I received a ton of exceptions until the 5s timeout. I have days where I can run the same code without any problem and - like today - it will not work regardless what I do.
How can I fix this error?
Exceptions during runtime (before the 5s timeout):
Cannot yet tell if frame is final
Cannot yet tell expected length
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot yet tell if frame is final
Cannot yet tell expected length
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot yet tell if frame is final
Cannot yet tell expected length
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot get extended length: need more data
Cannot yet tell if frame is final
Cannot yet tell expected length
Error Output:
Fatal error: Uncaught HeadlessChromium\Exception\OperationTimedOut: Operation timed out after 5s. in \composer\vendor\chrome-php\chrome\src\Exception\OperationTimedOut.php:18 Stack trace:
#0 \composer\vendor\chrome-php\chrome\src\Utils.php(67): HeadlessChromium\Exception\OperationTimedOut::createFromTimeout()
#1 \composer\vendor\chrome-php\chrome\src\Communication\ResponseReader.php(115): HeadlessChromium\Utils::tryWithTimeout()
#2 \composer\vendor\chrome-php\chrome\src\Communication\Connection.php(270): HeadlessChromium\Communication\ResponseReader->waitForResponse()
#3 \composer\vendor\chrome-php\chrome\src\Browser.php(84): HeadlessChromium\Communication\Connection->sendMessageSync()
#4 \composer\vendor\chrome-php\chrome\src\Browser\ProcessAwareBrowser.php(26): HeadlessChromium\Browser->__construct()
#5 \composer\vendor\chrome-php\chrome\src\Browser\BrowserProcess.php(162): HeadlessChromium\Browser\ProcessAwareBrowser->__construct()
#6 \composer\vendor\chrome-php\chrome\src\BrowserFactory.php(81): HeadlessChromium\Browser\BrowserProcess->start()
#7 \php\classes\main\main\screenshot.class.php(39): HeadlessChromium\BrowserFactory->createBrowser()
#8 \index.php(52): screenshot::createScreenshot()
#9 C:_Private Data - NO BACKUP\Source\web_template\index.php(238): include('...') #10 {main} thrown in \composer\vendor\chrome-php\chrome\src\Exception\OperationTimedOut.php on line 18
Fatal error: Uncaught Error: Call to a member function sendCloseMessage() on null in \composer\vendor\chrome-php\chrome\src\Browser\BrowserProcess.php:210 Stack trace:
#0 [internal function]: HeadlessChromium\Browser\BrowserProcess->kill() #1 {main} thrown in \composer\vendor\chrome-php\chrome\src\Browser\BrowserProcess.php on line 210
Chrome Log:
The text was updated successfully, but these errors were encountered: