Headless Chrome gives command_buffer_proxy_impl.cc(128) error, sometimes - google-chrome

I use Google Chrome to produce PDFs of webpages. I have noticed that once in a while, Chrome errors out. I started playing with it and from the command line, even when I execute Chrome with the bare minimum of flags, it errors out on occasion. This is the command I run:
google-chrome --headless --no-sandbox
And this is the error I get. But only sometimes. Most of the time, only the two warnings are triggered, and Chrome loads as expected.
[0930/042541.982039:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[0930/042542.096418:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process.
[0930/042542.120932:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
I've been trying to make sense out of the error, but the best I have come up with is that it's related to some sort of memory issue. What's confusing to me is that most of the time, it works fine.
I've gone through the list of flags and tried playing with turning off most of the features I don't need, but even so, the error appears, sometimes. Has anyone experienced a similar issue?
I'm running Ubuntu 20.04.05 LTS with Google Chrome 106.0.5249.61.

Disables GPU hardware acceleration. If software renderer is not in place, then the GPU process won't launch. ↪
https://peter.sh/experiments/chromium-command-line-switches/#disable-gpu

Related

Pandas-Profiling.to_widgets(): Error displaying widget: model not found

Error screenshot
I've been facing an intermittent issue with pandas profiling widget not rendering & it has been going on and off for awhile.
I've tried this in the command prompt:
jupyter nbextension enable --py widgetsnbextension
it comes up with " - Validating: ok" but still not rendering.
A quick google search led me to a few githubs/pandas-profiling/issues sections but they were a few years old.
I had this problem in Kaggle, I think it is related to memory. It happens when I repeat running my notebook a few times, without restarting the kernel.
To fix it, I just clicked Run, then Restart and Clear Outputs, and it's working again.
I have since then optimized my codes to release memory when done with them, as well as get into the habit of restarting and clearing outputs before a fresh run.
It hasn't happened on my local environment with Jupyter Notebook, probably because I have better memory locally. But if it did happen, I guess I would select Kernel, then Restart and Clear Output.

Chrome nativeMessaging example fails on Windows

I downloaded the official Chrome nativeMessaging example to test it out.
To do this, I installed the app from chrome://extensions, by choosing Load Unpacked. No problems so far.
I then installed the host. I'm using Windows 7, so I ran install_host.bat, which claimed that "The operation completed successfully." However, when I go to chrome://apps/ and click the Connect button, I get this error:
Failed to connect: Native host has exited.
Is there some reason this would happen? Restarting Chrome did not fix the issue, nor did uninstalling and then reinstalling the host program.
(I noticed that native-messaging-example-host.bat requires Python 2, so I modified it to run Python 2 explicitly. If I run native-messaging-example-host.bat from the command line, it pops up a little example program of its own with a GUI and seems to work correctly.)
Turns out I was using a non-standard character in the path leading to the host executable. This wouldn't be a problem for any other program, but Chrome's native messaging API doesn't like it, I guess.
By the way, the documentation on setting up this example is near-nonexistent, but this stack overflow link has some useful info: Chrome Extension NativeMessaging 'connectNative' undefined

Chrome headless screenshot on local machine

I have a localhost website created with ember which is just working fine.
I want to use Lighthouse to get some metrics about the performance over time. Of course I want this to be in Chrome and headless. I installed Lighthouse using NPM and run the following command:
lighthouse http://localhost:4200 -chrome-flags='--headless'
When running above, I got the following error resulting in a question mark as a performance metric:
Chrome didn't collect any screenshots during the page load. Please make sure there is content visible on the page, and then try re-running Lighthouse. (SPEEDINDEX_OF_ZERO)
I tried running the dist folder of ember with the http-server package, but no differences in the result. The same error occurs.
When I run the test against google.com or against a website in our test environment I get a result back and not the error. When a colleague is running it on his local machine, no error occurs. Only difference we can find is he is running win8.1 and my machine is win10.
When I run Chrome without the headless flagg I also get a result, but I need it to work headless.
I'm using all the latest versions of Lighthouse, Chrome, Windows10, node. Also tried Chromium but no differences.
Hopefully someone got an idea
After a week I tried again, still the same error. Now I tried again and it works. Nothing changed to my codebase and all apps, packs and so on are also the same version which I can see.
I don't know what fixed the issue, but it works now. Case closed.

PNaCl and Google Chrome 40 on Linux: Compile process could not be created

I am trying to run the part1 application in the getting_started directory of the Google Native Client SDK, and I obtain the following message in my browser:
NativeClient: PnaclCoordinator: Compile process could not be created:
When I visit the http://localhost:5103 I see the string "Loading...", but it never changes to "Success".
What do I need to configure in Chrome in order to be able to use Native Client applications?
My setup:
OS: Ubuntu Linux 12.04 LTS
Browser: Google Chrome 40
Pepper: 39
Root access: no
Not an answer, but a question:
Can you try to get some more log messages out of chrome or the NaCl runtime?
Start chrome from the shell with the environment variable NACLVERBOSITY=4 set. That asks chrome to show what is going on in the NaCl runtime when it has created a NaCl process (for the compiler). Typical messages are something like:
Entered NaClCreateServiceSocket
...
NaClSetUpBootstrapChannel
...
Elf header
...
and some more details. If that shows up, we know that NaCl compiler process creation at least made it that far. Could you then post the log somewhere, and I can take a look?
If it doesn't show up, then the problem is earlier in chrome. In this case, running chrome w/ --enable-logging=stderr -v1 (http://www.chromium.org/for-testers/enable-logging) might give some idea of what is going on in chrome before NaCl process creation.
Same issue.
I changed the chrome://flags settings for NaCl for debugging but we are not using the NaCl debugger at all. I set it back to default and it started working. (So I guess that was the problem?)

Chrome: Attaching nacl-gdb to packaged application loaded as an unpacked extension

I have built a simple NaCl application. For running the application I use technique 2 described in Nacl Developer's guide, which means that instead of running a local server I load my application as unpacked extension to chrome. The application runs fine so far.
Now I want to experiment with nacl-gdb and attach my application to it at startup.
In the NaCl Developer's guide there are only instructions on how to attach nacl-gdb on an application that is run with local server(technique 1). I made a search to the internet and I ended up with the following approach in order to attach nacl-gdb for an application that is being ran with technique 2:
I enabled "Native Client GDB-based debugging" flag of Chrome.
I started chrome from a terminal like this: ./chrome "--nacl-gdb=gnome-terminal --
/media/sdb1/leonidasbo/AncientRoot/nacl_sdk/pepper_27/toolchain/linux_x86_glibc/bin/x86_64-nacl-gdb"
When Chrome launched, I navigated to my application.
With this approach, Chrome automatically started nacl-gdb when I opened my application.
However nacl-gdb tried to attach but with no success. The output was the following:
*This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=x86_64-nacl".
Reading symbols from /opt/google/chrome/nacl_irt_x86_64.nexe...(no debugging symbols found)...done.
Don't know how to attach. Try "help target".
(gdb)*
It seems that gdb cannot attach to my application. I tried executing "target exec /path/to/my.nexe", but nothing changed.
Am I missing something here? Is there any other way to debug applications loaded as unpacked extensions with nacl-gdb?
My OS is Ubuntu 12.04 and I am using pepper_27 of nacl_sdk. Chrome version is 27.0.1453.93.
Thanks
I assume you were using this guide, which I was using earlier as well. It is out of date. These are the real instructions. It seems that the way you attach the debugger has completely changed, and it is no longer possible to use --nacl-gdb (that is planned for removal). You must manually attach the debugger by following these steps.
The full guide is here, but I'll summarize:
Launch Chrome with chrome --enable-nacl --enable-nacl-debug --no-sandbox --disable-hang-monitor.
Run <NACL_SDK_ROOT>/toolchain/win_x86_newlib/bin/x86_64-nacl-gdb (with no arguments).
Enter these commands into the gdb prompt:
(gdb) nacl-manifest <path-to-your-.nmf-file>
(gdb) nacl-irt <CHROME-DIR>/nacl_irt_x86_64.nexe
(gdb) target remote localhost:4014
Now you can use gdb as normal. (If you just want to run the application until it crashes, start by typing continue.)