Code Monkey home page Code Monkey logo

Comments (6)

ericzzzzzzz avatar ericzzzzzzz commented on June 8, 2024 1

It seems that the sync failing for your case is due to the image mismatch between the built image and the container image in remote pods or pods are not running.

for _, ns := range namespaces {
pods, err := client.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{})
if err != nil {
return fmt.Errorf("getting pods for namespace %q: %w", ns, err)
}
for _, p := range pods.Items {
if p.Status.Phase != v1.PodRunning {
continue
}
for _, c := range p.Spec.Containers {
if c.Image != image {
continue
}
cmd := cmdFn(ctx, p, c, files)
errs.Go(func() error {
_, err := util.RunCmdOut(ctx, cmd)
return err
})
numSynced++
}
}
}

Sure I'll create another issue to add log to make debug easier

from skaffold.

hitstill avatar hitstill commented on June 8, 2024 1

Hey. @ericzzzzzzz
It seems your assumption was correct.
I added an extra line to my sync.go

				if c.Image != image {
					log.Entry(ctx).Warnf("c.Image = %s, image = %s", c.Image, image)
					continue
				}

Issued make and and see what I got in console (among other things)
WARN[0029] c.Image = dev:5000/symfony, image = dev:5000/symfony:latest@sha256:90efe8c14f641d63167a528df9257dead81860987ce85256df8b58638987be1d subtask=-1 task=DevLoop

Obviously those value aren't equal. Replacing (not) equality check with !strings.HasPrefix() fixed the problem for me. Not sure though fixing the symptom is the right thing to do here

from skaffold.

izemlyanskiy avatar izemlyanskiy commented on June 8, 2024

hmmmm.. with -vdebug flag I found these lines


WARN[0074] sync failed for artifact "my-image:0.1.9-01c818c@sha256:ec687110b5af7458c733a746035654fe9f95c3d15856a9e924212502de472a66"  subtask=-1 task=DevLoop
WARN[0074] Skipping deploy due to sync error:copying files: didn't sync any files: sync failed for artifact "my-image:0.1.9-01c818c@sha256:ec687110b5af7458c733a746035654fe9f95c3d15856a9e924212502de472a66"  subtask=-1 task=DevLoop

is there a way to find out why "sync failed"?
thanks

from skaffold.

ericzzzzzzz avatar ericzzzzzzz commented on June 8, 2024

Hi, @izemlyanskiy There are the limitations about file-sync https://skaffold.dev/docs/filesync/#limitations that may cause it fail, could you provide a minimal reproducible project to help us get a better understanding of this issue ? Thanks

from skaffold.

izemlyanskiy avatar izemlyanskiy commented on June 8, 2024

hey @ericzzzzzzz
thank you for the response. I'll try to compile one, but meanwhile, is there a way to debug it on my end?
I mean, you mentioned about the limitations, is there a way to find out which limitation we met exactly?
I have a theory, it might be because we don't use the root user inside our containers, will try later this week.

May I ask you to add more logging so users like me are able to dig around themselves before bothering you with an issue like this one?

from skaffold.

ericzzzzzzz avatar ericzzzzzzz commented on June 8, 2024

Created #9200

from skaffold.

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.