Unhelpful error message when desired working directory does not exist
Opened this issue · 3 comments
I was using this:
- name: Build deps
uses: gabrielbb/xvfb-action@v1.6
with:
run: mvn -T4 clean install -DskipTests
working-directory: ./triggevent-base
I was getting this error:
Run gabrielbb/xvfb-action@v1.6
with:
run: mvn -T4 clean install -DskipTests
working-directory: ./triggevent-base
env:
JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.4-1/x64
JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.4-1/x64
/usr/bin/sudo apt-get install -y xvfb
Reading package lists...
Building dependency tree...
Reading state information...
xvfb is already the newest version 2:21.1.3-2ubuntu2.2).
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
Command: mvn -T4 clean install -DskipTests
/usr/bin/xvfb-run --auto-servernum mvn -T4 clean install -DskipTests
/usr/bin/bash /home/runner/work/_actions/gabrielbb/xvfb-action/v1.6/cleanup.sh
No xvfb processes to kill
Error: There was an error when attempting to execute the process '/usr/bin/xvfb-run'. This may indicate the process failed to start. Error: spawn /usr/bin/xvfb-run ENOENT
This is running on the Github-hosted Ubuntu 22.04 image.
It turned out that the step just before this was deleting the desired working directory for some reason - however, the actual error message (Error: spawn /usr/bin/xvfb-run ENOENT
) is not helpful for diagnosing this issue.
Maybe try working-directory: ${{github.workspace}}/triggevent-base
instead of relative path.
I actually ended up figuring it out - not sure why, but a previous step was deleting the directory in question.
I'll change the bug accordingly.
Looking at the action, the error seems to come from the xvfb library itself, so it might be very hard to output the exact nature of the problem (like a missing directory). Unless you add a check whether the working directory is actually in place.