Repository navigation
Description
Description:
When running my test suite using Kaleido on GitHub Actions, I encountered a recurring issue with the browser crashing. The error output suggests that the browser closes immediately after starting, resulting in a BrowserFailedError.
ERROR asyncio:base_events.py:1826 Task exception was never retrieved
future: <Task finished name='Task-2' coro=<Browser._open_async() done, defined at /Users/runner/work/.../.tox/.../choreographer/browser.py:246> exception=BrowserFailedError('The browser seemed to close immediately after starting. Perhaps adding debug_browser=True will help.')>
...
choreographer.browser.BrowserFailedError: Close() was called before the browser finished opening- maybe it crashed?
...
Steps to Reproduce:
- Set up a GitHub Action workflow to test the project.
- Install Kaleido and its dependencies within the matrix (includes
ubuntu-latest,windows-latest, andmacos-latest). - Run the test suite via
tox(defined in the workflow file, see below).
Relevant GitHub Action Workflow:
name: Build
on:
push:
pull_request:
types: [ opened, reopened ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install tox
run: pip install tox tox-gh-actions
- name: Install graphviz and Chromium dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install graphviz chromium-browser libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev
- name: Run tox
run: tox -e pySystem Information:
- OS: Windows, macOS, and Ubuntu (latest versions)
- Python Versions: 3.9, 3.10, 3.11, 3.12
- Kaleido Version: 0.4.1 and 1.0.0rc0
- Tox Version: 4.24.1
Expected Behavior: Kaleido should start a browser instance and successfully save images during test execution.
Actual Behavior: The browser crashes immediately after starting, causing the test suite to fail.
Additional Context: This issue occurs specifically within the GitHub Actions environment. The suggestion to enable debug_browser=True did not provide additional clarity. The same tests run successfully in a local development environment.
Activity
joelsamiller commentedon Jan 27, 2025
I am having the same issue on
windows-latestand the same Python versionsayjayt commentedon Jan 29, 2025
Hi friends, there's very very imminently the actual Kaleido v1 (ie not a release candidate) coming out, and this issue may go away with its improvements.
I will ping you two when it is official released, and if you still have the issue, I will direct you to posting the debug output.
Thanks for your patience!
ayjayt commentedon Feb 24, 2025
Copied from my other comment:
There are new pre-releases slated on github of kaleido: https://github.com/plotly/Kaleido/tree/latest-tag
Once Kaleido > = v1.0.0rc1 is integrated into plotly.py (for figure.write_figure(PATH) shortcut API), it will be released as v1.0.0 official.
But the base Kaleido API is stable and can also be used like this:
Here are some more examples:
https://github.com/plotly/Kaleido/blob/master/src/py/docs/examples.md
The new kaleido release requires a chromium-ish browser (chromium, chrome, edge) to be installed and accesible.
This is also possible from a CLI that comes with kaleido:
That command also uses tested chromiums in case new versions introduce bugs (they do sometimes).
Feel free to @ me for any help.