Browserless-chrome : Failed to send scheduled delivery Screenshot failed: locator.all: Execution context was destroyed, most likely because of a navigation
Hi,
trying to enable the Headless chrome feature that Lightdash suggests so as to send the screenshots of Chart details via scheduled delivery. The .csv Option works Fine but not the "image and pdf" one.
The Errors I come accross are as below (Errors displayed on the dashboard) :
-
Failed to send scheduled delivery Screenshot failed: locator.all: Execution context was destroyed, most likely because of a navigation.
-
Failed to send scheduled delivery
Screenshot failed: browserType.connectOverCDP: WebSocket error: connect ECONNREFUSED IP_address:3000 Call log:
ws://lightdash-browserless-chrome:3000/
ws://lightdash-browserless-chrome:3000/ error connect ECONNREFUSED IP_address:3000
===========================
Further when I check the logs of the browserless-chrome Pod I get the errors as below :
=============================
Unhealthy
Readiness probe failed: Get "http://ip_address:3000/pressure": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
On checking the details of to which Port the service listens to internally - it is 3000
I have also added readiness and Liveliness parameters as below under browserless-chrome section in the File :
livenessProbe:
httpGet:
path: /pressure
port: 3000
initialDelaySeconds: 60
timeoutSeconds: 20
periodSeconds: 30
failureThreshold: 5
readinessProbe:
httpGet:
path: /pressure
port: 3000
initialDelaySeconds: 90
timeoutSeconds: 30
periodSeconds: 30
failureThreshold: 3
The service details in the cluster is as below :
Name: lightdash-blue-browserless-chrome
Namespace: namew
Labels:
helm.sh/chart=browserless-chrome-0.0.4
Annotations: <none>
Selector: app.kubernetes.io/instance=lightdash-blue,app.kubernetes.io/name=browserless-chrome
Type: ClusterIP
IP Family Policy: SingleStack
IP Families: IPv4
IP: IP_address_1
IPs: IP_address_1
Port: http 3000/TCP
TargetPort: 3000/TCP
Endpoints: IP_address_2:3000,IP_address_3:3000,IP_address_4:3000 + 0 more...
Session Affinity: None
Internal Traffic Policy: Cluster
Events: <none>
Further I get :
curl: (6) Could not resolve host: lightdash-browserless-chrome
on executing below command :
curl http://service-name:3000/pressure.
But still I land to the
Readiness Probe Failure errors.
Lightdash Documentation : https://docs.lightdash.com/self-host/customize-deployment/enable-headless-browser-for-lightdash
As per the above Document I have also enabled the Parametrs as :
- name: HEADLESS_BROWSER_HOST
value: "lightdash-browserless-chrome"
- name: HEADLESS_BROWSER_PORT
value: "3000"
- name: SITE_URL
value: "https://lightdash.test.com"
The screenshots Option doesn't work .
still receiving the below Error :
Failed to send scheduled delivery Screenshot failed: locator.all: Execution context was destroyed, most likely because of a navigation
Further checking the logs :
browserless.io:ChromiumCDPWebSocketRoute:info IP_Address Starting new ChromiumCDP instance +0ms
42
browserless.io:ChromiumCDPWebSocketRoute:info IP_Address ChromiumCDP got open port 44235 +1ms
41
browserless.io:ChromiumCDPWebSocketRoute:info IP_Address {
40
args: [
39
'--remote-debugging-port=44235',
38
'--no-sandbox',
37
'--user-data-dir=/tmp/browserless-data-dirs/browserless-data-dir-0392309b06d4b'
36
],
35
executablePath: '/usr/local/bin/playwright-browsers/chromium-1148/chrome-linux/chrome'
34
} Launching ChromiumCDP Handler +0ms
33
browserless.io:ChromiumCDPWebSocketRoute:info IP_Address ChromiumCDP is running on ws://127.0.0.1:44235/devtools/browser/f4-9e23-ae6befd236c1 +385ms
32
browserless.io:router:trace Running found WebSocket handler. +9d
31
browserless.io:ChromiumCDPWebSocketRoute:info IP_Address Proxying http://0.0.0.0:3000/?launch=%7B%7D to ChromiumCDP ws://127.0.0.1:44235/devtools/browser/f49a0864-6e86-1 +1ms
30
browserless.io:ChromiumCDPWebSocketRoute:trace IP_Address Setting up file:// protocol request rejection +0ms
29
browserless.io:ChromiumCDPWebSocketRoute:trace IP_Address GET: https://lightdash.testwebsite.com/minimal/projects/45faa215-826f-42d7-84a2-3abb1764477f/saved/1bbc0b0a-d429-4745-8c52-ea90ff11bdba?context=scheduledDelivery +19ms
28
browserless.io:ChromiumCDPWebSocketRoute:warn IP_Address "net::ERR_CERT_AUTHORITY_INVALID": https://lightdash.testwebsite.com/minimal/projects/45faa215-826f-42d7-84a2-/saved/1bbc0b0a-d429-4745-8c52-?context=scheduledDelivery +0ms
27
browserless.io:ChromiumCDPWebSocketRoute:trace IP_Address Navigation to chrome-error://chromewebdata/ +140ms
26
browserless.io:router:trace WebSocket Request handler has finished. +262ms
25
browserless.io:browser-manager:info 0 Client(s) are currently connected, Keep-until: 0, force: false +9d
24
browserless.io:browser-manager:info Closing browser session +0ms
23
browserless.io:browser-manager:info Deleting "/tmp/browserless-data-dirs/browserless-data-dir-0392bec4-e37e-4fef-bd66-0bb309b06d4b" user-data-dir and session from memory +0ms
22
browserless.io:ChromiumCDPWebSocketRoute:info IP_Address Closing ChromiumCDP process and all listeners +261ms
21
browserless.io:server:trace Websocket connection complete +661ms
20
browserless.io:limiter:info Job has succeeded after 651ms of activity. +650ms
19
browserless.io:limiter:info (Running: 0, Pending: 0) All jobs complete. +0ms
18
browserless.io:browser-manager:info Deleting data directory "/tmp/browserless-data-dirs/browserless-data-dir-0392bec4-e37eb06d4b" +7ms
17
browserless.io:server:trace Handling inbound HTTP request on "GET: /pressure" +7s
Looking at the error logs, the main issue is a certificate authority validation error when browserless-chrome tries to access the Lightdash URL. The key error is:
"net::ERR_CERT_AUTHORITY_INVALID": https://lightdash.testwebsite.com/minimal/projects/...
To fix this, you need to configure the certificate settings in your browserless-chrome deployment.
This issue was mentioned by a user in slack: https://lightdash-community.slack.com/archives/C03MG2VTR08/p1763502376796609?thread_ts=1763502376.796609&cid=C03MG2VTR08