Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx build failing on act but succeeding on actions #1853

Closed
liopeer opened this issue Jun 10, 2023 · 2 comments
Closed

Sphinx build failing on act but succeeding on actions #1853

liopeer opened this issue Jun 10, 2023 · 2 comments
Labels
kind/bug Something isn't working stale

Comments

@liopeer
Copy link

liopeer commented Jun 10, 2023

Bug report info

act version:            0.2.46
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
	/var/run/docker.sock
	$HOME/.docker/run/docker.sock
Config files:           
	/Users/lionelpeer/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.20.4
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -X main.version=0.2.46
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               arm64
		GOOS:                 darwin
Docker Engine:
	Engine version:        20.10.22
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Docker Desktop
	OS type:               linux
	OS version:            
	OS arch:               aarch64
	OS kernel:             5.15.49-linuxkit
	OS CPU:                4
	OS memory:             7951 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act --container-architecture linux/amd64

Describe issue

Sphinx build fails at "make html" from the workflow below. It seems to be a timezone related issue that arises from the interaction of the Python packages babel & zoneinfo.

It is important to mention again, that it runs fine when pushing to Github, but unfortunately not in act.

Find the error below:

| Traceback (most recent call last):
| File "/usr/local/bin/sphinx-build", line 5, in
| from sphinx.cmd.build import main
| File "/usr/local/lib/python3.10/dist-packages/sphinx/cmd/build.py", line 20, in
| from sphinx.application import Sphinx
| File "/usr/local/lib/python3.10/dist-packages/sphinx/application.py", line 25, in
| from sphinx.config import Config
| File "/usr/local/lib/python3.10/dist-packages/sphinx/config.py", line 14, in
| from sphinx.util.i18n import format_date
| File "/usr/local/lib/python3.10/dist-packages/sphinx/util/i18n.py", line 12, in
| import babel.dates
| File "/usr/local/lib/python3.10/dist-packages/babel/dates.py", line 34, in
| from babel import localtime
| File "/usr/local/lib/python3.10/dist-packages/babel/localtime/init.py", line 41, in
| LOCALTZ = get_localzone()
| File "/usr/local/lib/python3.10/dist-packages/babel/localtime/init.py", line 37, in get_localzone
| return _get_localzone()
| File "/usr/local/lib/python3.10/dist-packages/babel/localtime/_unix.py", line 49, in _get_localzone
| tzinfo = _get_tzinfo(zone_name)
| File "/usr/local/lib/python3.10/dist-packages/babel/localtime/_helpers.py", line 21, in _get_tzinfo
| return zoneinfo.ZoneInfo(tzenv)
| File "/usr/lib/python3.10/zoneinfo/_tzpath.py", line 67, in find_tzfile
| _validate_tzfile_path(key)
| File "/usr/lib/python3.10/zoneinfo/_tzpath.py", line 81, in _validate_tzfile_path
| raise ValueError(
| ValueError: ZoneInfo keys may not be absolute paths, got: /UTC
| make: *** [Makefile:20: html] Error 1
[Push Docs Build/docs] ❌ Failure - Main Build docs
[Push Docs Build/docs] exitcode '2': failure
[Push Docs Build/docs] 🏁 Job failed

Link to GitHub repository

No response

Workflow content

name: "Push Docs Build"
on: [push]
permissions:
  contents: write

jobs:
  # anything in the job "docs" is executed on the same runner
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Build docs
        run: |
          wget https://bootstrap.pypa.io/get-pip.py
          python get-pip.py
          cd $GITHUB_WORKSPACE/docs
          python -m pip install -r requirements.txt
          make html
      - uses: peaceiris/actions-gh-pages@v3
        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
        with:
          publish_branch: gh-pages
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: docs/build/html/

Relevant log output

| Traceback (most recent call last):
|   File "/usr/local/bin/sphinx-build", line 5, in <module>
|     from sphinx.cmd.build import main
|   File "/usr/local/lib/python3.10/dist-packages/sphinx/cmd/build.py", line 20, in <module>
|     from sphinx.application import Sphinx
|   File "/usr/local/lib/python3.10/dist-packages/sphinx/application.py", line 25, in <module>
|     from sphinx.config import Config
|   File "/usr/local/lib/python3.10/dist-packages/sphinx/config.py", line 14, in <module>
|     from sphinx.util.i18n import format_date
|   File "/usr/local/lib/python3.10/dist-packages/sphinx/util/i18n.py", line 12, in <module>
|     import babel.dates
|   File "/usr/local/lib/python3.10/dist-packages/babel/dates.py", line 34, in <module>
|     from babel import localtime
|   File "/usr/local/lib/python3.10/dist-packages/babel/localtime/__init__.py", line 41, in <module>
|     LOCALTZ = get_localzone()
|   File "/usr/local/lib/python3.10/dist-packages/babel/localtime/__init__.py", line 37, in get_localzone
|     return _get_localzone()
|   File "/usr/local/lib/python3.10/dist-packages/babel/localtime/_unix.py", line 49, in _get_localzone
|     tzinfo = _get_tzinfo(zone_name)
|   File "/usr/local/lib/python3.10/dist-packages/babel/localtime/_helpers.py", line 21, in _get_tzinfo
|     return zoneinfo.ZoneInfo(tzenv)
|   File "/usr/lib/python3.10/zoneinfo/_tzpath.py", line 67, in find_tzfile
|     _validate_tzfile_path(key)
|   File "/usr/lib/python3.10/zoneinfo/_tzpath.py", line 81, in _validate_tzfile_path
|     raise ValueError(
| ValueError: ZoneInfo keys may not be absolute paths, got: /UTC
| make: *** [Makefile:20: html] Error 1

Additional information

No response

@liopeer liopeer added the kind/bug Something isn't working label Jun 10, 2023
@peytondmurray
Copy link

peytondmurray commented Jul 5, 2023

@liopeer I ran into this issue today. There's definitely a problem with how the timezone is being retrieved by babel, but you can get around it by setting TZ=UTC to short circuit the problem during the sphinx build:

name: "Push Docs Build"
on: [push]
permissions:
  contents: write

jobs:
  # anything in the job "docs" is executed on the same runner
  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Build docs
        run: |
          wget https://bootstrap.pypa.io/get-pip.py
          python get-pip.py
          cd $GITHUB_WORKSPACE/docs
          python -m pip install -r requirements.txt
          TZ=UTC make html
      - uses: peaceiris/actions-gh-pages@v3
        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
        with:
          publish_branch: gh-pages
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: docs/build/html/

ESKYoung added a commit to ESKYoung/cookiecutter-machine-learning that referenced this issue Sep 12, 2023
Copy link
Contributor

github-actions bot commented Jan 2, 2024

Issue is stale and will be closed in 14 days unless there is new activity

@github-actions github-actions bot added the stale label Jan 2, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2024
alcarney added a commit to alcarney/esbonio that referenced this issue Jul 7, 2024
This seems to fix an issue that prevents Sphinx from running inside a devcontainer
nektos/act#1853
alcarney added a commit to swyddfa/esbonio that referenced this issue Jul 7, 2024
This seems to fix an issue that prevents Sphinx from running inside a devcontainer
nektos/act#1853
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants