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

Fail to run action xu-cheng/texlive-action/full #1384

Closed
alanlivio opened this issue Oct 10, 2022 · 22 comments · Fixed by #1472 or #1503
Closed

Fail to run action xu-cheng/texlive-action/full #1384

alanlivio opened this issue Oct 10, 2022 · 22 comments · Fixed by #1472 or #1503
Labels
kind/bug Something isn't working

Comments

@alanlivio
Copy link

Bug report info

act --bug-report
act version:            0.2.32
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 8
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        \\.\pipe\docker_engine
Config files:
        C:\Users\alan\.actrc:
                -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
                -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.6
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.32 -X main.commit=21484b5c1ecbd9e1ddb6a57debd7731a3e1fc25f -X main.date=2022-10-01T03:01:40Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         21484b5c1ecbd9e1ddb6a57debd7731a3e1fc25f
                vcs.time:             2022-09-29T05:59:52Z
                vcs.modified:         false
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.68.1-microsoft-standard-WSL2
        OS CPU:                8
        OS memory:             3825 MB
        Security options:
                name=seccomp,profile=default

Command used with act

act

Describe issue

Fail to use action xu-cheng/texlive-action/full@v1 from here

Link to GitHub repository

No response

Workflow content

jobs:
  gh-pages:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
       - uses: xu-cheng/texlive-action/full@v1
         with:
           run: 
             latexmk -shell-escape -cd -pdf file.tex

Relevant log output

[gh-pages.yml/gh-pages]   ❌  Failure - Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages] exit with `FAILURE`: 127

Additional information

No response

@alanlivio alanlivio added the kind/bug Something isn't working label Oct 10, 2022
@KnisterPeter
Copy link
Member

DOCKER_HOST environment variable is unset/empty.

You need to install docker on your machine

@KnisterPeter KnisterPeter added meta/invalid This doesn't seem right and removed kind/bug Something isn't working labels Oct 10, 2022
@alanlivio
Copy link
Author

Many thanks for the response @KnisterPeter.
But the docker was installed, see my docker info bellow

$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.10.2)
  extension: Manages Docker extensions (Docker Inc., v0.2.9)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.19.0)

Server:
 Containers: 2
  Running: 1
  Paused: 0
  Stopped: 1
 Images: 1
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.15.68.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 3.736GiB
 Name: docker-desktop
 ID: GUIT:ASWL:7SKR:ZOET:MI2X:HYIW:BOMH:MMQX:Z6ON:4VUY:FGR4:DJOO
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

Also, I am able to run the latexmk command (used in the step) directly from "docker run"

$ docker run ghcr.io/xu-cheng/texlive-full latexmk
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77.

Latexmk: No file name specified, and I couldn't find any
Use
   latexmk -help
to get usage information

Also, You can see in the log below that act-cli start normally and even runs the immediately previous step uses: actions/checkout@v3.

$ act
[gh-pages.yml/gh-pages] 🚀  Start image=catthehacker/ubuntu:act-latest
[gh-pages.yml/gh-pages]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[gh-pages.yml/gh-pages]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[gh-pages.yml/gh-pages]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/xu-cheng/texlive-action' # ref=v1
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/actions/setup-node' # ref=v3
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/peaceiris/actions-gh-pages' # ref=v3
[gh-pages.yml/gh-pages] ⭐ Run Main actions/checkout@v3
[gh-pages.yml/gh-pages]   🐳  docker cp src=C:\Users\alan\src\alan.io\alanlivio.github.io\. dst=/mnt/c/Users/alan/src/alan.io/alanlivio.github.io
[gh-pages.yml/gh-pages]   ✅  Success - Main actions/checkout@v3
[gh-pages.yml/gh-pages] ⭐ Run Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages]   🐳  docker pull image=ghcr.io/xu-cheng/texlive-full:latest platform= username= forcePull=false
[gh-pages.yml/gh-pages]   🐳  docker create image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
[gh-pages.yml/gh-pages]   🐳  docker run image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
| /bin/bash: line 1: latexmk: command not found
[gh-pages.yml/gh-pages]   ❌  Failure - Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages] exit with `FAILURE`: 127
[gh-pages.yml/gh-pages] 🏁  Job failed
Error: Job 'gh-pages' failed

Do you have another suggestion?

@KnisterPeter
Copy link
Member

I don't know the action. Could have plenty of reasons. Sorry.
But I'll reopen the issue, maybe someone else has a suggestion

@KnisterPeter KnisterPeter reopened this Oct 11, 2022
@KnisterPeter
Copy link
Member

KnisterPeter commented Oct 11, 2022

M assumption is, that latexmk is not in the PATH inside the docker container.

@alanlivio
Copy link
Author

Many thanks again @KnisterPeter.

M assumption is, that latexmk is not in the PATH inside the docker container.

I think this is not the case because the following command works.
$ docker run ghcr.io/xu-cheng/texlive-full latexmk

Is there a way to me better debug the error with act-cli?

@KnisterPeter
Copy link
Member

This docker run ghcr.io/xu-cheng/texlive-full latexmk is different from what is happening in your action I think.

[gh-pages.yml/gh-pages] 🐳 docker run image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
| /bin/bash: line 1: latexmk: command not found

Looks like it should be more like docker run --entrypoint /bin/bash ghcr.io/xu-cheng/texlive-full:latest -eo pipefail -c 'latexmk -shell-escape -cd -pdf ./latex/cv.tex'

@alanlivio
Copy link
Author

Thanks again @KnisterPeter.
Your suggestion run the latexmk indeed, but, although being in the right folder, latexmk said that the subdir does not exist. For me, It seems docker does not mount the current folder/repo as act-cli does.

docker run --entrypoint /bin/bash ghcr.io/xu-cheng/texlive-full:latest -eo pipefail -c 'latexmk -shell-escape -cd -pdf ./latex/cv.tex'
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77.
Latexmk: Changing directory to './latex/'
Latexmk: Error in changing directory to './latex'.  I must stop
latexmk: Can't change directory to './latex'
   A directory of the same name does not exist.

I also open the bash in the container and it has the latexmk in the PATH

$ docker run -it ghcr.io/xu-cheng/texlive-full:latest bash
bash-5.1# latexmk
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77.

Latexmk: No file name specified, and I couldn't find any
Use
   latexmk -help
bash-5.1# echo $PATH
/opt/texlive/texdir/bin/x86_64-linuxmusl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale label Nov 11, 2022
@alanlivio
Copy link
Author

Hi, again @KnisterPeter. Did you say that My assumption is, that latexmk is not in the PATH inside the docker container.
But I checked above that the container, and it has the latexmk in the PATH.
Can I set the path during the docker run --entrypoint /bin/bash call?

@KnisterPeter
Copy link
Member

@alanlivio I think thats not possible. But you can for sure change the docker container and update it to your needs.

@github-actions github-actions bot removed the stale label Nov 12, 2022
@alanlivio
Copy link
Author

Many thanks, @KnisterPeter.

But you can for sure change the docker container and update it to your needs.

I think is not the case to change it. Because, as I show up, the docker already has the latexmk in the PATH. My may point in trying docker run is to enable work in your nektos tool.
Do you have another suggestion on how to enable nektos work with this ghcr.io/xu-cheng/texlive-full docker

@ChristopherHX
Copy link
Contributor

Do you have another suggestion on how to enable nektos work with this ghcr.io/xu-cheng/texlive-full docker

Debug act, then find and fix the bug. I believe something in act's path handling is different compared to actions/runner, act reads /etc/environment while it shouldn't do that.

I might pick this up, once my PR queue is empty

@ChristopherHX ChristopherHX added kind/bug Something isn't working and removed meta/invalid This doesn't seem right labels Nov 15, 2022
@ChristopherHX
Copy link
Contributor

I think act doesn't respect this line:
ENV PATH="/opt/texlive/texdir/bin/x86_64-linuxmusl:${PATH}"
I'm not shure if act once did it correctly, if so there was no test case.

@ChristopherHX
Copy link
Contributor

Something in act still defines the PATH variable..., if this is also fixed this action should work.

@ChristopherHX
Copy link
Contributor

I made a patch with a test, the new linked PR should fix the problem you were facing. You can try an artifact of it under checks / workflow summary

@Moelf
Copy link

Moelf commented Jan 11, 2023

also hitting a similar

| /root/.fontconfig: not cleaning non-existent cache directory
| fc-cache: succeeded
| Compile dissertation.tex
| /root/entrypoint.sh: line 170: latexmk: command not found
[Build LaTeX document/build_latex]   ❌  Failure - Main Compile LaTeX document
[Build LaTeX document/build_latex] exit with `FAILURE`: 127
[Build LaTeX document/build_latex] 🏁  Job failed

when running with

      - name: Compile LaTeX document
        uses: xu-cheng/latex-action@v2
        with:
          root_file: dissertation.tex

@mergify mergify bot closed this as completed in #1503 Feb 4, 2023
@alanlivio
Copy link
Author

hi @KnisterPeter and ChristopherHX. Sorry for the delay. I just tried the act version 0.2.42 for my github workflow and I still have the same problem 😔. Please see output below:

$ act # at my alanlivio.github.io repo
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/actions/setup-node' # ref=v3
[gh-pages.yml/gh-pages]   ☁  git clone 'https://github.com/peaceiris/actions-gh-pages' # ref=v3
[gh-pages.yml/gh-pages] ⭐ Run Main actions/checkout@v3
[gh-pages.yml/gh-pages]   🐳  docker cp src=C:\Users\alan\src\alanlivio.github.io\. dst=/mnt/c/Users/alan/src/alanlivio.github.io
[gh-pages.yml/gh-pages]   ✅  Success - Main actions/checkout@v3
[gh-pages.yml/gh-pages] ⭐ Run Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages]   🐳  docker pull image=ghcr.io/xu-cheng/texlive-full:latest platform= username= forcePull=false
[gh-pages.yml/gh-pages]   🐳  docker create image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
[gh-pages.yml/gh-pages]   🐳  docker run image=ghcr.io/xu-cheng/texlive-full:latest platform= entrypoint=["/bin/bash"] cmd=["-eo" "pipefail" "-c" "latexmk -shell-escape -cd -pdf ./latex/cv.tex"]
| /bin/bash: line 1: latexmk: command not found
[gh-pages.yml/gh-pages]   ❌  Failure - Main xu-cheng/texlive-action/full@v1
[gh-pages.yml/gh-pages] exit with `FAILURE`: 127
[gh-pages.yml/gh-pages] 🏁  Job failed
Error: Job 'gh-pages' failed

I tried enter in the image and tried to find the latexmk but it is not at /opt as mentioned by ChristopherHX here. See below.

$ docker exec -it act-gh-pages-yml-gh-pages bash
root@docker-desktop:/mnt/c/Users/alan/src/alanlivio.github.io# latexmk
bash: latexmk: command not found
root@docker-desktop:/mnt/c/Users/alan/src/alanlivio.github.io# ls /opt
hostedtoolcache

Any other suggestions? Thank you in advance.

Also thanks @Moelf for indicate the similar issue.

@ChristopherHX
Copy link
Contributor

@alanlivio The change is not released yet.

It has a test case, which fails with the current 0.2.42 release.

@ChristopherHX
Copy link
Contributor

I tried enter in the image and tried to find the latexmk but it is not at /opt as mentioned by ChristopherHX here. See below.

The /opt folder of docker actions is obviously not the same as /opt of the job container.

Therefore my change uses the PATH defined by the docker action and not by the job container, as long you don't override it in your workflow file.

@alanlivio
Copy link
Author

Many thanks for you reply @ChristopherHX. I will wait for the next release to try again. 😊

@alanlivio
Copy link
Author

Thanks @ChristopherHX, I checked 0.2.44 and it worked.

@virzak
Copy link

virzak commented Jun 29, 2024

I'm having an issue with xu-cheng/latex-action@v3. It calls docker internally and there seems to be an issue with a entrypoint.sh mapping. Does anyone else has the same issue?

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
Projects
None yet
5 participants