skaffold icon indicating copy to clipboard operation
skaffold copied to clipboard

Skaffold Cloud Builder fails fetching dependencies on first skaffold build when using jib + mvnw

Open aablsk opened this issue 2 years ago • 3 comments

Expected behavior

skaffold build should build java images with jib using mvnw when run inside the gcr.io/k8s-skaffold/skaffold:v1.37.1-lts image.

Actual behavior

skaffold build throws when run inside the gcr.io/k9s-skaffold/skaffold:v1.37.1-lts image while checking cache. This also applies to running this within Cloud Build.

Error message

getting hash for artifact "balancereader": getting dependencies for "balancereader": could not fetch dependencies for workspace /workspace: initial Jib dependency refresh failed: failed to get Jib dependencies: running [/workspace/mvnw jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=1.4.0 --projects src/ledger/balancereader --also-make jib:_skaffold-files-v2 --quiet --batch-mode]
 - stdout: ""
 - stderr: "Exception in thread \"main\" java.nio.file.NoSuchFileException: /root/.m2/wrapper/dists/apache-maven-3.8.5-bin/67203e94/apache-maven-3.8.5-bin.zip.part\n\tat java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)\n\tat java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)\n\tat java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)\n\tat java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:430)\n\tat java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:267)\n\tat java.base/java.nio.file.Files.move(Files.java:1422)\n\tat org.apache.maven.wrapper.Installer.createDist(Installer.java:95)\n\tat org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:151)\n\tat org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:76)\n"
 - cause: exit status 1

When running skaffold build AGAIN in the same container or if running the below command before skaffold build, the operation is successful: /workspace/mvnw jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=1.4.0 --projects src/ledger/balancereader --also-make jib:_skaffold-files-v2 --quiet --batch-mode

Workaround for Cloud Build: Setting MAVEN_USER_HOME to /workspace/.m2 in CloudBuild and running the above command before running skaffold build.

Information

  • Skaffold version: gcr.io/k8s-skaffold/skaffold:v1.37.1-lts
  • Operating system: Linux (Cloud Machine)
  • Installed via: Running docker container
  • Contents of skaffold.yaml: https://github.com/aablsk/bank-of-anthos/tree/cicd-skaffold-kustomize

This is just one of the java service yamls:

apiVersion: skaffold/v2beta26
kind: Config
metadata: 
  name: ledgerwriter
requires:
  - configs: [ledger-db]
    path: ../ledger-db/skaffold.yaml
build:
  artifacts:
    - image: ledgerwriter
      context: ../../../
      jib:
        project: src/ledger/ledgerwriter
deploy:
  kustomize:
    paths: ["k8s/base"]
profiles:
  - name: staging
    deploy:
      kustomize:
        paths: ["k8s/staging"]
  - name: production
    deploy:
      kustomize:
        paths: ["k8s/production"]

Steps to reproduce the behavior

  1. Clone repo and checkout cicd-skaffold-kustomize branch: https://github.com/aablsk/bank-of-anthos/tree/cicd-skaffold-kustomize
  2. docker run -it -v <ABSOLUT_PATH_TO_CLONED_REPO>:/workspace gcr.io/k8s-skaffold/skaffold:v1.37.1-lts /bin/bash - this will open up terminal inside the docker container
  3. cd /workspace
  4. skaffold config set default-repo <YOUR_CONTAINER_REGISTRY>
  5. skaffold build --module=ledger (fails)
  6. skaffold build --module=ledger (2nd run works)

Full stack trace

root@7952cd408d74:/workspace# skaffold build --module=ledger --verbosity debug
DEBU[0000] skaffold API not starting as it's not requested  subtask=-1 task=DevLoop
INFO[0000] Skaffold &{Version:v1.37.1 ConfigVersion:skaffold/v2beta28 GitVersion: GitCommit:0c33da624a8dc2c8539f4abdda631acf0ce5c1e0 BuildDate:2022-04-01T19:03:38Z GoVersion:go1.17.3 Compiler:gc Platform:linux/amd64 User:}  subtask=-1 task=DevLoop
INFO[0000] Loaded Skaffold defaults from "/root/.skaffold/config"  subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/accounts/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/accounts/accounts-db/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/k8s/config/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/accounts/contacts/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/accounts/accounts-db/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/accounts/userservice/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/accounts/accounts-db/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/ledger-db/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/k8s/config/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/balancereader/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/ledger-db/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/ledgerwriter/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/ledger-db/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/transactionhistory/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/ledger/ledger-db/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/frontend/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] parsed 1 configs from configuration file /workspace/src/loadgenerator/skaffold.yaml  subtask=-1 task=DevLoop
DEBU[0000] Defaulting build type to local build          subtask=-1 task=DevLoop
INFO[0000] map entry found when executing locate for &{ledger-db /workspace/src/ledger/ledger-db <nil> {0xc00076c4d0 <nil> <nil> <nil> <nil> <nil> <nil>} [] {[] []} []} of type *v1.Artifact and pointer: 824641341312  subtask=-1 task=DevLoop
INFO[0000] map entry found when executing locate for &{balancereader /workspace <nil> {<nil> <nil> <nil> 0xc000a10690 <nil> <nil> <nil>} [] {[] []} []} of type *v1.Artifact and pointer: 824641344000  subtask=-1 task=DevLoop
INFO[0000] map entry found when executing locate for &{ledgerwriter /workspace <nil> {<nil> <nil> <nil> 0xc000a10910 <nil> <nil> <nil>} [] {[] []} []} of type *v1.Artifact and pointer: 824648393472  subtask=-1 task=DevLoop
INFO[0000] map entry found when executing locate for &{transactionhistory /workspace <nil> {<nil> <nil> <nil> 0xc000a10be0 <nil> <nil> <nil>} [] {[] []} []} of type *v1.Artifact and pointer: 824648397696  subtask=-1 task=DevLoop
INFO[0000] Using kubectl context:                        subtask=-1 task=DevLoop
DEBU[0000] Running command: [minikube version --output=json]  subtask=-1 task=DevLoop
DEBU[0000] setting Docker user agent to skaffold-v1.37.1  subtask=-1 task=DevLoop
DEBU[0000] CLI platforms provided: ""                    subtask=-1 task=DevLoop
DEBU[0000] platforms detected from active kubernetes cluster nodes: ""  subtask=-1 task=DevLoop
DEBU[0000] platforms selected for artifact "ledger-db": ""  subtask=-1 task=DevLoop
DEBU[0000] platforms selected for artifact "balancereader": ""  subtask=-1 task=DevLoop
DEBU[0000] platforms selected for artifact "ledgerwriter": ""  subtask=-1 task=DevLoop
DEBU[0000] platforms selected for artifact "transactionhistory": ""  subtask=-1 task=DevLoop
DEBU[0000] Using builder: local                          subtask=-1 task=DevLoop
DEBU[0000] push value not present in NewBuilder, defaulting to true because cluster.PushImages is true  subtask=-1 task=DevLoop
DEBU[0000] Using builder: local                          subtask=-1 task=DevLoop
DEBU[0000] push value not present in NewBuilder, defaulting to true because cluster.PushImages is true  subtask=-1 task=DevLoop
DEBU[0000] Using builder: local                          subtask=-1 task=DevLoop
DEBU[0000] push value not present in NewBuilder, defaulting to true because cluster.PushImages is true  subtask=-1 task=DevLoop
DEBU[0000] Using builder: local                          subtask=-1 task=DevLoop
DEBU[0000] push value not present in NewBuilder, defaulting to true because cluster.PushImages is true  subtask=-1 task=DevLoop
DEBU[0000] Using builder: local                          subtask=-1 task=DevLoop
DEBU[0000] push value not present in NewBuilder, defaulting to true because cluster.PushImages is true  subtask=-1 task=DevLoop
DEBU[0000] Using builder: local                          subtask=-1 task=DevLoop
DEBU[0000] push value not present in NewBuilder, defaulting to true because cluster.PushImages is true  subtask=-1 task=DevLoop
INFO[0000] build concurrency first set to 1 parsed from *local.Builder[0]  subtask=-1 task=DevLoop
INFO[0000] build concurrency value 1 parsed from *local.Builder[1] is ignored since it's not less than previously set value 1  subtask=-1 task=DevLoop
INFO[0000] build concurrency value 1 parsed from *local.Builder[2] is ignored since it's not less than previously set value 1  subtask=-1 task=DevLoop
INFO[0000] build concurrency value 1 parsed from *local.Builder[3] is ignored since it's not less than previously set value 1  subtask=-1 task=DevLoop
INFO[0000] build concurrency value 1 parsed from *local.Builder[4] is ignored since it's not less than previously set value 1  subtask=-1 task=DevLoop
INFO[0000] build concurrency value 1 parsed from *local.Builder[5] is ignored since it's not less than previously set value 1  subtask=-1 task=DevLoop
INFO[0000] final build concurrency value is 1            subtask=-1 task=DevLoop
Generating tags...
 - ledger-db -> DEBU[0000] Running command: [git describe --tags --always]  subtask=-1 task=Build
DEBU[0000] Running command: [git describe --tags --always]  subtask=-1 task=Build
DEBU[0000] Running command: [git describe --tags --always]  subtask=-1 task=Build
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] config version out of date: upgrading to latest "skaffold/v2beta28"  subtask=-1 task=DevLoop
DEBU[0000] Running command: [git describe --tags --always]  subtask=-1 task=Build
DEBU[0000] Command output: [v0.5.1-233-g6856dac
]        subtask=-1 task=Build
DEBU[0000] Running command: [git status . --porcelain]   subtask=-1 task=Build
DEBU[0000] Command output: [v0.5.1-233-g6856dac
]        subtask=-1 task=Build
DEBU[0000] Command output: [v0.5.1-233-g6856dac
]        subtask=-1 task=Build
DEBU[0000] Running command: [git status . --porcelain]   subtask=-1 task=Build
DEBU[0000] Running command: [git status . --porcelain]   subtask=-1 task=Build
DEBU[0000] Command output: []                            subtask=-1 task=Build
INFO[0000] Using default-repo=default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos from config  subtask=-1 task=DevLoop
default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos/ledger-db:v0.5.1-233-g6856dac
 - balancereader -> DEBU[0000] Command output: []                            subtask=-1 task=Build
DEBU[0000] Command output: []                            subtask=-1 task=Build
INFO[0000] Using default-repo=default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos from config  subtask=-1 task=DevLoop
default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos/balancereader:v0.5.1-233-g6856dac
 - ledgerwriter -> INFO[0000] Using default-repo=default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos from config  subtask=-1 task=DevLoop
default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos/ledgerwriter:v0.5.1-233-g6856dac
 - transactionhistory -> DEBU[0000] Command output: [v0.5.1-233-g6856dac
]        subtask=-1 task=Build
DEBU[0000] Running command: [git status . --porcelain]   subtask=-1 task=Build
DEBU[0000] Command output: []                            subtask=-1 task=Build
INFO[0000] Using default-repo=default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos from config  subtask=-1 task=DevLoop
default-repo=europe-west3-docker.pkg.dev/skaffold-build-cache/bank-of-anthos/transactionhistory:v0.5.1-233-g6856dac
INFO[0000] Tags generated in 47.547451ms                 subtask=-1 task=Build
Checking cache...
DEBU[0000] Running command: [java -version]              subtask=-1 task=Build
DEBU[0000] Using wrapper for mvnw: mvn                   subtask=-1 task=Build
DEBU[0000] Running command: [/workspace/mvnw jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=1.4.0 --projects src/ledger/transactionhistory --also-make jib:_skaffold-files-v2 --quiet --batch-mode]  subtask=-1 task=Build
DEBU[0000] Using wrapper for mvnw: mvn                   subtask=-1 task=Build
DEBU[0000] Running command: [/workspace/mvnw jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=1.4.0 --projects src/ledger/balancereader --also-make jib:_skaffold-files-v2 --quiet --batch-mode]  subtask=-1 task=Build
DEBU[0000] Using wrapper for mvnw: mvn                   subtask=-1 task=Build
DEBU[0000] Running command: [/workspace/mvnw jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=1.4.0 --projects src/ledger/ledgerwriter --also-make jib:_skaffold-files-v2 --quiet --batch-mode]  subtask=-1 task=Build
DEBU[0001] Found dependencies for dockerfile: [{initdb/0_init_tables.sql /docker-entrypoint-initdb.d/0_init_tables.sql false 19 19} {initdb/1_create_transactions.sh /docker-entrypoint-initdb.d/1_create_transactions.sh false 22 22}]  subtask=-1 task=DevLoop
DEBU[0001] Could not import artifact from Docker, building instead (import of missing images disabled)  subtask=-1 task=Build
DEBU[0019] Command output: [
BEGIN JIB JSON
{"build":["/workspace/src/ledger/transactionhistory/pom.xml"],"inputs":["/workspace/src/ledger/transactionhistory/src/main/java","/workspace/src/ledger/transactionhistory/src/main/resources","/workspace/src/ledger/transactionhistory/src/main/resources","/workspace/src/ledger/transactionhistory/src/main/jib"],"ignore":[]}
]  subtask=-1 task=Build
DEBU[0019] could not stat dependency: stat /workspace/src/ledger/transactionhistory/src/main/jib: no such file or directory  subtask=-1 task=DevLoop
DEBU[0019] Found dependencies for jib maven artifact: [src/ledger/transactionhistory/pom.xml src/ledger/transactionhistory/src/main/java/anthos/samples/bankofanthos/transactionhistory/JWTVerifierGenerator.java src/ledger/transactionhistory/src/main/java/anthos/samples/bankofanthos/transactionhistory/LedgerReader.java src/ledger/transactionhistory/src/main/java/anthos/samples/bankofanthos/transactionhistory/Transaction.java src/ledger/transactionhistory/src/main/java/anthos/samples/bankofanthos/transactionhistory/TransactionCache.java src/ledger/transactionhistory/src/main/java/anthos/samples/bankofanthos/transactionhistory/TransactionHistoryApplication.java src/ledger/transactionhistory/src/main/java/anthos/samples/bankofanthos/transactionhistory/TransactionHistoryController.java src/ledger/transactionhistory/src/main/java/anthos/samples/bankofanthos/transactionhistory/TransactionRepository.java src/ledger/transactionhistory/src/main/resources/application.properties src/ledger/transactionhistory/src/main/resources/application.properties src/ledger/transactionhistory/src/main/resources/banner.txt src/ledger/transactionhistory/src/main/resources/banner.txt src/ledger/transactionhistory/src/main/resources/log4j2.xml src/ledger/transactionhistory/src/main/resources/log4j2.xml]  subtask=-1 task=Build
DEBU[0019] Could not import artifact from Docker, building instead (import of missing images disabled)  subtask=-1 task=Build
 - ledger-db: Not found. Building
 - balancereader: Error checking cache.
DEBU[0019] Running command: [tput colors]                subtask=-1 task=DevLoop
DEBU[0019] Command output: [8
]                          subtask=-1 task=DevLoop
getting hash for artifact "balancereader": getting dependencies for "balancereader": could not fetch dependencies for workspace /workspace: initial Jib dependency refresh failed: failed to get Jib dependencies: running [/workspace/mvnw jib:_skaffold-fail-if-jib-out-of-date -Djib.requiredVersion=1.4.0 --projects src/ledger/balancereader --also-make jib:_skaffold-files-v2 --quiet --batch-mode]
 - stdout: ""
 - stderr: "Exception in thread \"main\" java.nio.file.NoSuchFileException: /root/.m2/wrapper/dists/apache-maven-3.8.5-bin/67203e94/apache-maven-3.8.5-bin.zip.part\n\tat java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)\n\tat java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)\n\tat java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)\n\tat java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:430)\n\tat java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:267)\n\tat java.base/java.nio.file.Files.move(Files.java:1422)\n\tat org.apache.maven.wrapper.Installer.createDist(Installer.java:95)\n\tat org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:151)\n\tat org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:76)\n"
 - cause: exit status 1

Happy to help and provide more information if relevant!

aablsk avatar May 16 '22 10:05 aablsk

This is strange and should not happen. Increasing the priority for this.

tejal29 avatar Sep 12 '22 18:09 tejal29

@aablsk Looks like you have forked the official sample. Can you tell us what is different in your fork?

tejal29 avatar Sep 12 '22 18:09 tejal29

@tejal29 There are multiple differences in my fork (e.g. folder restructure, iac, kustomize, skaffold.yaml split). I have just successfully reproduced the issue with the official bank-of-anthos repository with both skaffold:v1.37.2-lts and skaffold:v1.37.1-lts

Steps to reproduce the behavior

  1. Clone repo: https://github.com/GoogleCloudPlatform/bank-of-anthos
  2. docker run -it -v <ABSOLUT_PATH_TO_CLONED_REPO>:/workspace gcr.io/k8s-skaffold/skaffold:v1.37.2-lts /bin/bash - this will open up terminal inside the docker container
  3. cd /workspace
  4. skaffold config set default-repo <YOUR_CONTAINER_REGISTRY>
  5. skaffold build (fails)
  6. skaffold build (2nd run works)

aablsk avatar Sep 13 '22 10:09 aablsk

I'm not seeing this issue in v2.1.0, but I am seeing it in v2.2.0 and v2.3.0 (I have not tested v.2.4.0 yet). I am not seeing the issue go away on a "second run" for v2.x though, so. that workaround doesn't work for me.

This is the Cloud Build step that fails for me: https://github.com/GoogleCloudPlatform/bank-of-anthos/blob/main/src/ledger/cloudbuild.yaml#L19-L27 (I'm locked to using v2.1.0 because any versions released after fails)

And an example of the Skaffold config that fails: https://github.com/GoogleCloudPlatform/bank-of-anthos/blob/main/src/ledger/balancereader/skaffold.yaml#L26-L32

bourgeoisor avatar May 01 '23 21:05 bourgeoisor

The issue is caused by skaffold does cache-lookup concurrently and build concurrency flag doesn't have effect on it, the workaround is to disable cache lookup for jib project has multiple modules with cache-artifacts flag, so example command , skaffold build --cache-artifacts=false, I'll work on a fix later.

ericzzzzzzz avatar May 30 '23 16:05 ericzzzzzzz