Skaffold: Sync permission error for buildpacks

Created on 15 Nov 2019  路  6Comments  路  Source: GoogleContainerTools/skaffold

Expected behavior

Skaffold succeeds in synchronising local files

Actual behavior

Skaffold fails in synchronising local files

Information

  • Skaffold version: version v1.0.0-70-ga045e9d7
  • Operating system: Mac OS X Catalina 10.15.1 (19B88) Darwin Kernel Version 19.0.0
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1
kind: Config
build:
  artifacts:
  - image: gcr.io/k8s-skaffold/skaffold-buildpacks
    buildpack:
      builder: "heroku/buildpacks"
profiles:
- name: dev
  build:
    artifacts:
    - image: gcr.io/k8s-skaffold/skaffold-buildpacks
      sync:
        manual:
        - src: "**/*"
          dest: .
      buildpack:
        builder: heroku/buildpacks:18

Steps to reproduce the behavior

  1. git clone https://github.com/danacr/skaffold-buildpack-example
  2. skaffold dev --port-forward --profile dev -vdebug
  3. Edit main.go: Hello, World! 2
  4. Save file

Result:

Watching for changes...
DEBU[0270] Change detected notify.Write: "/Users/taaacda3/Dev/buildpack-example/main.go" 
INFO[0271] files modified: [main.go]                    
DEBU[0271] Using default workdir '/' for gcr.io/k8s-skaffold/skaffold-buildpacks:226a27f252db89d52fae02a0411c6ce9b7f2ba1cf18498a2b05993651abbae1b 
Syncing 1 files for gcr.io/k8s-skaffold/skaffold-buildpacks:226a27f252db89d52fae02a0411c6ce9b7f2ba1cf18498a2b05993651abbae1b
INFO[0271] Copying files: map[main.go:[/main.go]] to gcr.io/k8s-skaffold/skaffold-buildpacks:226a27f252db89d52fae02a0411c6ce9b7f2ba1cf18498a2b05993651abbae1b 
DEBU[0271] getting client config for kubeContext: ``    
DEBU[0271] Running command: [kubectl --context docker-desktop exec web-6b57c89c7d-5zcv5 --namespace default -c web -i -- tar xmf - -C / --no-same-owner] 
WARN[0271] Skipping deploy due to sync error: copying files: Running [kubectl --context docker-desktop exec web-6b57c89c7d-5zcv5 --namespace default -c web -i -- tar xmf - -C / --no-same-owner]: stdout , stderr: tar: Removing leading `/' from member names
tar: main.go: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
command terminated with exit code 2
, err: exit status 2: exit status 2 
Watching for changes...
aresync builbuildpacks kinbug

All 6 comments

oh, that makes sense that this fails now. Let me take a look!

@danacr can you try to change dest to /workspace? It should succeed to sync files.

The error no longer shows up, but the synchronisation does not work. These are the logs:

Handling connection for 8080 
DEBU[0194] Running command: [kubectl --context docker-desktop port-forward --pod-running-timeout 1s service/web 8080:8080 --namespace default] 
DEBU[0197] Change detected notify.Write: "/Users/taaacda3/Dev/buildpack-example/main.go" 
INFO[0198] files modified: [main.go]                    
DEBU[0198] Using default workdir '/' for gcr.io/k8s-skaffold/skaffold-buildpacks:f6818c8199fe0d112d1e22acb7b143e7f490f087d7790ac538fa6f92b5828508 
Syncing 1 files for gcr.io/k8s-skaffold/skaffold-buildpacks:f6818c8199fe0d112d1e22acb7b143e7f490f087d7790ac538fa6f92b5828508
INFO[0198] Copying files: map[main.go:[/workspace/main.go]] to gcr.io/k8s-skaffold/skaffold-buildpacks:f6818c8199fe0d112d1e22acb7b143e7f490f087d7790ac538fa6f92b5828508 
DEBU[0198] getting client config for kubeContext: ``    
DEBU[0198] Running command: [kubectl --context docker-desktop exec web-69ff47dd49-jlcp7 --namespace default -c web -i -- tar xmf - -C / --no-same-owner] 
DEBU[0198] Command output: [], stderr: tar: Removing leading `/' from member names 
Watching for changes...

I can only see changes when the container is rebuilt (by modifying skaffold.yaml). The new changes are reflected in the repository: https://github.com/danacr/skaffold-buildpack-example

This behaviour is unfortunately expected. Skaffold can sync files but won't retriever a go build. So for now, sync is only useful for static files or interpreted languages. Not so much for compiled languages.

Good to know. Fortunately, we are using rails for the skaffold use case, so that is not an issue. I just tested using /workspace there, and it works!

I think we can close the issue.

awesome, thank you for being one of the firsts to test our buildpacks support

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hudsonzp picture Hudsonzp  路  4Comments

Morriz picture Morriz  路  3Comments

garvincasimir picture garvincasimir  路  4Comments

nathkn picture nathkn  路  3Comments

emichaf picture emichaf  路  4Comments