GoogleContainerTools / GoogleContainerTools/skaffold

Explain why no files were synced

Open
#3,921 0 comments 4 reactions 0 assignees View on GitHub
area/logging help wanted kind/feature-request priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

I encountered a puzzling message when diagnosing [an error on Stack Overflow involving syncing](https://stackoverflow.com/q/60922073/600339). My file sync was failing with the following error:

```
Syncing 1 files for testappacr.azurecr.io/test-app-admin:4c76dec58e1ef426b89fd44e3b340810db96b6961c5cacfdb76f62c9dc6725b8
WARN[0043] Skipping deploy due to sync error: copying files: didn't sync any files
```

This error message comes from:

https://github.com/GoogleContainerTools/skaffold/blob/ba4a58dfaf2c42a5db13b580e3448387929415fc/pkg/skaffold/sync/sync.go#L370-L372

The message doesn't provide any real insight as to why nothing was synced.

Ultimately the root cause was that I had disabled the status checks while I was getting the setup to work as they prevent seeing useful logs. I only discovered the pod was failing due to a missing PVC there was a problem after poking around with `kubectl describe`. So there were no running containers to copy the file to.

So:
- [`sync.Perform()`](https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/sync/sync.go#L346-L372) could track and report some more information on exceptional conditions: _no running pods found_, _no matching containers found_
- perhaps the status checks could, perhaps after some amount of time, do a `describe` on the items that aren't healthy?

(This is related to #1571 but that issue was closed a while back and references different part of the code.)

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.