GoogleContainerTools / GoogleContainerTools/skaffold

Seeing sync errors in attempting to sync *.html files

Open
#6,845 3 comments 0 reactions 0 assignees View on GitHub
area/sync bugbash/q4-2022 help wanted kind/bug priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

I am currently attempting to add file sync support to the application below for it's *.html files (one file - index.html):
https://github.com/GoogleCloudPlatform/golden-path-for-app-delivery

In attempted to modify the app to use both `infer` and `manual` file syncing I get some `File exists` errors during the sync:
- using infer sync via:
```
# skaffod.yaml file
... # other parts of the file
build:
artifacts:
- image: sample-app
context: ./
sync:
infer:
- '*.html'
```
I see error:
```
$ skaffold dev
... # other output
Watching for changes...
Syncing 1 files for sample-app:96f218a6a3a5ae91385aedda1607584bfd4f025b90478242e8dc13bae71b2a15
WARN[0047] Skipping deploy due to sync error:copying files: running [kubectl --context minikube exec sample-app-dev-cdf9f4f8d-7vfbm --namespace default -c sample-app -i -- tar xmf - -C / --no-same-owner]
- stdout: ""
- stderr: "tar: Removing leading `/' from member names\ntar: go/src/app/index.html: Cannot open: File exists\ntar: Exiting with failure status due to previous errors\ncommand terminated with exit code 2\n"
- cause: exit status 2 subtask=-1 task=DevLoop
```

I attempting to use manual sync as well and saw the same error although with some different paths
```
# skaffold.yaml
... # other parts of the file
build:
artifacts:
- image: sample-app
context: ./
sync:
manual:
- src: 'index.html'
dest: /index.html
```
The error:
```
Syncing 1 files for sample-app:d72084a3f558bb761d1291b589e3d3a1de41352395bc09e89ef9f5fa0b34e088
WARN[0093] Skipping deploy due to sync error:copying files: running [kubectl --context minikube exec sample-app-dev-86fc868b9-txkzl --namespace default -c sample-app -i -- tar xmf - -C / --no-same-owner]
- stdout: ""
- stderr: "tar: Removing leading `/' from member names\ntar: index.html: Cannot mkdir: Permission denied\ntar: index.html/index.html: Cannot open: No such file or directory\ntar: Exiting with failure status due to previous errors\ncommand terminated with exit code 2\n"
- cause: exit status 2 subtask=-1 task=DevLoop
```

I also tried removing the file from the Dockerfile (to see of if this was related to the file previously existing in the image) but I saw the same errors

Not sure what I might be doing wrong here, my understanding is that this should work with both sync types `infer` and `manual` and not require any additional changes to other files (Dockerfile, etc) but I seem to have this issue in all attempts

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.