firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.24k stars 127 forks source link

Error: ENOENT: no such file or directory, open '/workspaces/.gitlab-ci-local/output/build4testsOgx86.log' #1285

Open ko-maren opened 2 months ago

ko-maren commented 2 months ago

I'm running gitlab-ci-local within a docker container and executing the CI jobs locally there. It worked previously, but not anymore.

Minimal .gitlab-ci.yml illustrating the issue

---
build4tests:x86:
  script:
    - scripts/ci-build4tests.sh
  artifacts:
    name: "$CI_JOB_NAME"
    paths:
      - output/       # for ctest, to prevent total re-build                   

scripts/ci-build4tests.sh

changed_files_commit=$(git diff --name-only HEAD^..HEAD)
printf "changed files in last commit:\n%s\n\n" "$changed_files_commit"

cmake -DBUILD_TEST=1  build_all 

make -j 8 install

exit 0

Expected behavior I was expecting the job to finish without error, however it get the following error:

build4tests:x86 > Skipping repository .gitlab-ci-local/builds/.docker
Error: ENOENT: no such file or directory, open '/workspaces/.gitlab-ci-local/output/build4testsOgx86.log'
    at Object.openSync (node:fs:599:3)
    at Object.openSync (pkg/prelude/bootstrap.js:793:32)
    at Object.writeFileSync (node:fs:2221:35)
    at Object.appendFileSync (node:fs:2283:6)
    at outFunc (/snapshot/firecow-gitlab-ci-local/src/job.ts:823:16)
    at Transform.<anonymous> (/snapshot/firecow-gitlab-ci-local/src/job.ts:830:69)
    at Transform.emit (node:events:537:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Transform.Readable.push (node:internal/streams/readable:234:10)

The folder is recreated during the execution of the gitlab-ci-local command, so I don't know how to proceed.

Host information Laptop with Ubuntu 24.04 Docker, where gitlab-ci-local is running: bookworm gitlab-ci-local 4.52.1 (tried it also with 4.51.0)

firecow commented 2 months ago

This is not a minimal example. Please include a stripped down version of the .sh script, so we can reproduce.

ko-maren commented 2 months ago

I was working on a branch where I already commited a change in a submodule. Going back to main branch actually help to get the local CI running again. I also stumbled over https://github.com/firecow/gitlab-ci-local/issues/633, so perhaps it's because I had a commit related to the submodule and gitlab-ci-local couldn't handle it.

firecow commented 2 months ago

So what should we do about this issue?