Chromium headless immediate abort

/usr/local/bin/chrome --headless results in the following error:
Code:
[12506:-1942282240:1206/092602.673717:ERROR:property_cache.cc(46)] Check failed: it->second.response.has_value(). 
[bad_optional_access.cc : 39] RAW: Bad optional access 
Abort

Seeing this error on multiple FreeBSD13.2-RELEASE p5 and p6 boxes. Some boxes use ports and others use package, with one box being a scratch load with packages. Also having same error with www/ungoogled-chromium.

Google search has not turned up any results for this and I have not seen anything on bugs.freebsd.org. I wanted to see if anyone else is seeing this before I submit a bug report.
 
I get the same error at my place.

> $ chrome --headless --disable-gpu --dump-dom https://www.google.com
> [97980:1159798784:1210/110234.367526:ERROR:property_cache.cc(46)] Check failed: it->second.response.has_value().
> [bad_optional_access.cc : 39] RAW: Bad optional access
> zsh: abort chrome --headless --disable-gpu --dump-dom https://www.google.com
My environment is as follows:
> $ uname -a
> FreeBSD liva 14.0-RELEASE FreeBSD 14.0-RELEASE #0 releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:23 UTC 2023 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

You asked for information, and since you did not seem to have responded yet, I am providing it. I do not need a reply.
I apologize for the plain text as it is a machine translation.
 
What's the intention of headless?

I get a browser window.

Code:
% pkg iinfo chromium
chromium-119.0.6045.199
ungoogled-chromium-119.0.6045.199
% uname -aKU
FreeBSD mowa219-gjp4-zbook-freebsd 15.0-CURRENT FreeBSD 15.0-CURRENT #5 main-n266797-0a958aa16fed-dirty: Mon Dec  4 04:49:51 GMT 2023     grahamperrin@mowa219-gjp4-zbook-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1500005 1500005
% /usr/local/bin/chrome --headless
[4140:107028480:1211/041024.713343:ERROR:nss_util.cc(357)] After loading Root Certs, loaded==false: NSS error code: -8018

(chrome:4140): Gtk-WARNING **: 04:10:24.871: Theme parsing error: gtk.css:1479:66: Using one color stop with linear-gradient() is deprecated.

(chrome:4140): Gtk-WARNING **: 04:10:24.871: Theme parsing error: gtk.css:1498:66: Using one color stop with linear-gradient() is deprecated.

(chrome:4140): Gtk-WARNING **: 04:10:24.879: Theme parsing error: gtk.css:4247:21: negative values are not allowed.
Gtk-Message: 04:10:24.933: Failed to load module "appmenu-gtk-module"
[4140:107028480:1211/041025.011575:ERROR:policy_logger.cc(157)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(163) Cloud management controller initialization aborted as CBCM is not enabled.
%

If it's relevant, <https://udger.com/resources/online-parser?action=my> reports:

Code:
Sec-Ch-Ua: "Chromium";v="119", "Not?A_Brand";v="24"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Full-Version: "119.0.6045.199"
Sec-Ch-Ua-Arch: ""
Sec-Ch-Ua-Platform: "Linux"
Sec-Ch-Ua-Platform-Version: "15.0.0"
Sec-Ch-Ua-Model: ""
Sec-Ch-Ua-Bitness: "64"
Sec-Ch-Ua-Full-Version-List: "Chromium";v="119.0.6045.199", "Not?A_Brand";v="24.0.0.0"
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/119.0.0.0 Safari/537.36
 
Glad to see that I'm not the only one. I'll submit a bug report either today or tomorrow.

We use Chromium headless to convert live html pages to pdf:
Code:
/usr/local/bin/chrome --headless --disable-gpu --run-all-compositor-stages-before-draw --print-to-pdf-no-header --print-to-pdf="test.pdf" {url}

Unfortunately, there are very few alternative live /online HTML->PDF converters that work in our specific application. We were using converters/wkhtmltopdf until it broke last year(?). We are getting by now by using www/firefox print screen option and then converting the jpg to pdf.
 
pboehmer We have experienced the exact some thing since some time. I just commented on your bug report (many thanks for filing it).

Just like you we went from wkhtmltopdf to chromium headless to generate PDF from HTML on our server. I will try to build the last version that worked for us (117.0.5938.88) on 14.0-RELEASE and pkg-lock that, hoping that at some point the problem will be fixed and I can update again. Fortunately, we create PDFs only from trusted HTML so that I need not worry about security bugs in the old Chromium version.
 
"bad optional access" seems to have disappeared. Just tested with chromium-123.0.6312.105. However, something is still not working - when trying to render pdf nothing is output.

Code:
chromium --headless --disable-gpu --print-to-pdf=/tmp/test.pdf https://www.google.com

I wonder if this is related to "new" headless mode, because even with older chromium version which works specifying --headless=new breaks it.
 
Back
Top