Giter Site home page Giter Site logo

Comments (7)

firecow avatar firecow commented on June 7, 2024 1

Right, thanks that gave me/us the error to debug on

mjn@mjn-laptop:~/downloads/gitlab-ci-local-test$ gitlab-ci-local build-job 
Using fallback git user.email
parsing and downloads finished in 44 ms
build-job starting golang:1.22.1 (build)
build-job copied to docker volumes in 686 ms
build-job $ mkdir -p "${GOPATH}" # collapsed multi-line command
build-job $ go build # collapsed multi-line command
build-job > go: downloading github.com/labstack/echo/v4 v4.11.4
build-job > go: downloading golang.org/x/net v0.19.0
build-job > go: downloading github.com/labstack/gommon v0.4.2
build-job > go: downloading golang.org/x/crypto v0.17.0
build-job > go: downloading github.com/mattn/go-isatty v0.0.20
build-job > go: downloading github.com/mattn/go-colorable v0.1.13
build-job > go: downloading github.com/valyala/fasttemplate v1.2.2
build-job > go: downloading github.com/valyala/bytebufferpool v1.0.0
build-job > go: downloading golang.org/x/sys v0.15.0
build-job > go: downloading golang.org/x/text v0.14.0
build-job finished in 11 s
build-job > still running...
Error: Command failed with exit code 1: docker cp 3f78cb34d9b7be12b5b195ad2ead3ad391caa2ef86e240c7c924d83702120a93:/cache/. .gitlab-ci-local/cache/.
open /home/mjn/downloads/gitlab-ci-local-test/.gitlab-ci-local/cache/default/.go/pkg/mod/github.com/labstack/echo/[email protected]/.editorconfig: permission denied
    at makeError (/snapshot/firecow-gitlab-ci-local/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/snapshot/firecow-gitlab-ci-local/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Job.copyOut (/snapshot/firecow-gitlab-ci-local/src/job.ts:1019:13)
    at /snapshot/firecow-gitlab-ci-local/src/job.ts:935:21
    at Function.exclusive (/snapshot/firecow-gitlab-ci-local/src/mutex.ts:19:9)
    at Job.copyCacheOut (/snapshot/firecow-gitlab-ci-local/src/job.ts:934:17)
    at Job.start (/snapshot/firecow-gitlab-ci-local/src/job.ts:496:9)
    at /snapshot/firecow-gitlab-ci-local/node_modules/p-map/index.js:57:22

from gitlab-ci-local.

firecow avatar firecow commented on June 7, 2024 1

I wonder what Gitlab CI/CD runners use...

from gitlab-ci-local.

firecow avatar firecow commented on June 7, 2024

Are you aware that the commands are being executed on your local machine, and not inside a docker container ?

from gitlab-ci-local.

BLaurent avatar BLaurent commented on June 7, 2024

Hi @firecow ,
Thanks for taking the time to review this issue.
I think my example was not correct:

variables:
  CI_DEBUG_TRACE: "true"
  FF_USE_FASTZIP: "true"
  GOLANG_VERSION: "1.22.1"
.go-cache:
  variables:
    GOPATH: $CI_PROJECT_DIR/.go
  before_script: |
    mkdir -p "${GOPATH}"
    chown -R :users $CI_PROJECT_DIR
    chmod -R a+rwX $CI_PROJECT_DIR
  cache:
    paths:
      - "${GOPATH}/pkg/mod/"
      - "${GOPATH}/bin"
image:
  name: golang:${GOLANG_VERSION}
stages:
  - build
build-job:
  stage: build
  extends: [.go-cache]
  script: |
    go build

During this process two containers are launch golang:1.22.1 and gitlab-local-ci.
At the end I end up with the same error, docker cp failed. So docker is involved somehow.

from gitlab-ci-local.

firecow avatar firecow commented on June 7, 2024

Hi @firecow , Thanks for taking the time to review this issue. I think my example was not correct:

variables:
  CI_DEBUG_TRACE: "true"
  FF_USE_FASTZIP: "true"
  GOLANG_VERSION: "1.22.1"
.go-cache:
  variables:
    GOPATH: $CI_PROJECT_DIR/.go
  before_script: |
    mkdir -p "${GOPATH}"
    chown -R :users $CI_PROJECT_DIR
    chmod -R a+rwX $CI_PROJECT_DIR
  cache:
    paths:
      - "${GOPATH}/pkg/mod/"
      - "${GOPATH}/bin"
image:
  name: golang:${GOLANG_VERSION}
stages:
  - build
build-job:
  stage: build
  extends: [.go-cache]
  script: |
    go build

During this process two containers are launch golang:1.22.1 and gitlab-local-ci. At the end I end up with the same error, docker cp failed. So docker is involved somehow.

image

It cannot reproduce using this example.

from gitlab-ci-local.

BLaurent avatar BLaurent commented on June 7, 2024

I have setup this small test project to ensure we are seeing the same thing.
Hope this will work for you
Regards

from gitlab-ci-local.

ANGkeith avatar ANGkeith commented on June 7, 2024

Under the hood, we're using docker cp to copy out the cache and it has the following "limitation":

docker cp creates directory without write permission set. Then fails to write files into it.
https://stackoverflow.com/a/45276559/11054476

Unluckily, in golang, the packages installed are read-only resulting in this bug
image

For now, i'll recommend the following tempfix:

  script:
    - go build
    - |
      # HACK: https://github.com/firecow/gitlab-ci-local/issues/1170#issuecomment-2081111816
      if [[ $GITLAB_CI == "false" ]]; then
        find "${GOPATH}/pkg/mod/" -type d -exec chmod +w {} +
      fi

from gitlab-ci-local.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.