quarto-dev / quarto-actions

GNU General Public License v2.0
218 stars 50 forks source link

GitHub Actions stuck at "Warning: vkCreateInstance: Found no drivers!" #115

Closed isaactpetersen closed 2 weeks ago

isaactpetersen commented 2 weeks ago

I don't know if this is the right place to post this question, but I'm having an issue with rendering my Quarto website via GitHub Actions, and I'd appreciate help in either solving the issue or in finding the right place to post this question. My GitHub Action recently has been getting stuck on a particular step--the workflow had worked fine in prior runs, so I'm not sure what happened.

Here is my failing workflow: https://github.com/isaactpetersen/Fantasy-Football-Analytics-Textbook/actions/runs/10605075217/job/29393117856

The Action gets stuck on the job "Render Quarto Project":

Run quarto-dev/quarto-actions/render@v2
  with:
    path: .
  env:
    R_LIBS_USER: /home/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    R_LIB_FOR_PAK: /opt/R/4.4.1/lib/R/site-library
    BUNDLE_EXT: linux-amd64.deb
Run echo $(which chromium-browser)
  echo $(which chromium-browser)
  $(which chromium-browser) --headless https://www.chromestatus.com
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    R_LIBS_USER: /home/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
    R_LIB_FOR_PAK: /opt/R/4.4.1/lib/R/site-library
    BUNDLE_EXT: linux-amd64.deb
/usr/bin/chromium-browser
[8900:8989:0828/220824.509422:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8900:8989:0828/220824.509549:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8900:8989:0828/220824.509570:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8900:8989:0828/220824.509586:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8900:8989:0828/220824.509600:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8900:8989:0828/220827.371082:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8900:8989:0828/220827.371124:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8900:9109:0828/220828.952975:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[8900:9109:0828/220828.953757:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[8900:9109:0828/220828.953969:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[9039:7:0828/220830.760335:ERROR:command_buffer_proxy_impl.cc(132)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
Warning: Warning: vkCreateInstance: Found no drivers!
Warning: Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
    at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:106)

Warning: Warning: vkCreateInstance: Found no drivers!
Warning: Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
    at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:106)

Error: The operation was canceled.

My workflow file is below:

on:
  workflow_dispatch:
  push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v4 # update
        with:
          lfs: true  # This ensures that Git LFS files are pulled

      - name: Checkout LFS objects
        run: git lfs checkout

      - name: Setup R
        uses: r-lib/actions/setup-r@v2 # update

      - name: Session info
        run: Rscript -e 'sessionInfo()'

      - name: Setup pandoc
        uses: r-lib/actions/setup-pandoc@v2 # update

      - name: Install libcurl on Linux
        if: runner.os == 'Linux'
        run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev

      - name: Install tinytex
        uses: r-lib/actions/setup-tinytex@v2 # update

      #- name: Install additional LaTeX packages
      #  run: |
          #tlmgr install url
          #tlmgr install underscore

      - name: Install package dependencies
        uses: r-lib/actions/setup-r-dependencies@v2 # update

      #- name: Install remote packages
      #  run: |
      #   Rscript -e 'remotes::install_github("DevPsyLab/petersenlab")'

      - name: Install cmdstan
        run: |
          cmdstanr::check_cmdstan_toolchain(fix = TRUE)
          cmdstanr::install_cmdstan(cores = 2)
        shell: Rscript {0}

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2 # update

      - name: Render Quarto Project
        uses: quarto-dev/quarto-actions/render@v2 # update
        #with:
        #  to: html # can specify a particular output format

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2 # update
        with:
          target: gh-pages
          render: false # renders in previous step, so don't render again
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Archive production artifacts
        uses: actions/upload-artifact@v4 # update
        with:
          name: _book
          path: |
            _book/
            *.tex
            *.md

I'm not sure why I'm getting these warnings (and why the Action gets stuck), and my Action used to run fine. Any guidance would be greatly appreciated. Thanks in advance!

cscheid commented 2 weeks ago

I think this is another instance of the bug caused by Chrome updating their headless configuration: https://github.com/quarto-dev/quarto-cli/issues/10626

By default, our actions install the latest stable version of Quarto, which currently has this issue.

We fixed this bug in the 1.6 prereleases, but the 1.5 patch release happens once a month, and so will (hopefully) be fixed on Sep 1 with 1.5.57. You can try to render with the prereleases by configuring the setup action like so:

    - uses: quarto-dev/quarto-actions/setup@v2
      with:
        version: pre-release

Of course, this will mean you're now rendering with 1.6 instead of 1.5. But it should be enough for you to check that the issue is resolved.

ianalexmac commented 2 weeks ago

Our repo is having a similar breakdown upon build. The issue also seemed to stem from the render workflow quarto-dev/quarto-actions/render@v2. We got around it by manually rendering the PDF version using quarto render --profile pdf --output-dir _book in the action, then committing the rendered PDF to gh-pages (I see your artifact archiver, that looks more streamlined). Perhaps a little hackish, but it got us back up and running. Here is a copy of our workflow, you can see the render is commented out and the manual render is right below.

Hope this helps.

on:
  push:
    branches: main

name: Render and Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    concurrency:
      group: pages-deploy
      cancel-in-progress: true
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2
        with:
          # To install LaTeX to build PDF book 
          tinytex: true 
          # uncomment below and fill to pin a version
          # version: 0.9.600

      - name: Set up R
        uses: r-lib/actions/setup-r@v2

      - name: Install system dependencies
        run: sudo apt-get install -y libcurl4-openssl-dev  

      - name: Cache Renv packages
        uses: actions/cache@v2
        with:
          path: ~/R/Library
          key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
          restore-keys: |
            ${{ runner.os }}-renv-

      - name: Restore R package dependencies with renv
        run: |
          Rscript -e "install.packages('renv')"
          Rscript -e "renv::restore()"

      - name: Install Barlow font
        run: |
          mkdir -p ~/.local/share/fonts
          wget -qO- https://github.com/google/fonts/raw/main/ofl/barlow/Barlow-Regular.ttf > ~/.local/share/fonts/Barlow-Regular.ttf
          wget -qO- https://github.com/google/fonts/raw/main/ofl/barlow/Barlow-Bold.ttf > ~/.local/share/fonts/Barlow-Bold.ttf
          fc-cache -f -v

      - name: Publish to GitHub Pages (and render)
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages
        env:
          QUARTO_PROFILE: html
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 

      # - name: Render PDF
      #   uses: quarto-dev/quarto-actions/render@v2
      #   with:
      #     version: pre-release
      #     to: pdf
      #     path: .
      #   env:
      #     QUARTO_PROFILE: pdf
      #     GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Manually Render PDF (debug)
        run: quarto render --profile pdf --output-dir _book

      # Switch to branch gh-pages
      - name: Checkout gh-pages branch
        uses: actions/checkout@v2
        with:
          ref: gh-pages
          path: gh-pages

      # Copy the PDF to the gh-pages directory
      - name: Copy PDF to gh-pages directory
        run: |
          cp ./_book/*.pdf gh-pages/

      - name: Commit and Push PDF to gh-pages
        working-directory: ./gh-pages
        run: |
          git config user.email "action@github.com"
          git config user.name "GitHub Action"
          git add -f *.pdf
          git commit -m "Automatically generated PDF" -a || echo "No changes to commit"
          git push origin gh-pages
cscheid commented 2 weeks ago

We decided to go ahead and create a new stable 1.5 release ahead of schedule because of these reports. If you can confirm that your CI is using 1.5.57, then this issue should be fixed.

ianalexmac commented 2 weeks ago

Here's a link to the working build with the manual PDF render: https://github.com/ianalexmac/aetr-web-book-2024/actions/runs/10620510306/job/29440437978

It appears to be using CI 1.5.57

cscheid commented 2 weeks ago

Ok, thanks. I'm going to go ahead and close this issue, then.

ianalexmac commented 2 weeks ago

Thank you!

isaactpetersen commented 2 weeks ago

Hmm, my GitHub Action is using the latest stable version of Quarto (1.5.57), and it is still running into the same issue. Any ideas?

cscheid commented 2 weeks ago

@isaactpetersen You're correct, there's an additional issue in the setup stage. @cderv is investigating a fix (we have the same problem in quarto-web) and we'll let you know more when we do.

cscheid commented 2 weeks ago

The only way we know how to partially work around this problem (which is unfortunately not a Quarto problem, as you can see by the place where your CI hangs) is to disable Chromium installation and usage entirely in CI. This is very unfortunate because you will not be able to render documents that (for example) have mermaid or dot diagrams to formats like typst, pdf and docx.

cscheid commented 2 weeks ago

You can try the change we made on quarto-web for your own actions: https://github.com/quarto-dev/quarto-web/commit/f28e58e4f86a8f119c309df85fc4c2bce9463ba4

isaactpetersen commented 2 weeks ago

Thanks for the prompt responses. I appreciate it. Will this be fixed with the patch release on 9/1, or will I need to make the change you indicated for the forseeable future, in order to get my quarto website to render?

cderv commented 2 weeks ago

I have made a new v2.1.6 release with opting out the chrome checking that creates the problem. v2 and v2.1 tag are updated too.

Using quarto-dev/quarto-actions/render@v2 should solve this.

This means that

could happen again, but we'll find a new solution that don't create problem on CI.