Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid not-modified ETag with local network ADD in docker #784

Closed
vytools opened this issue Jan 15, 2019 · 8 comments
Closed

invalid not-modified ETag with local network ADD in docker #784

vytools opened this issue Jan 15, 2019 · 8 comments

Comments

@vytools
Copy link

vytools commented Jan 15, 2019

I have a local network tarball that I'm adding in a dockerfile.

FROM alpine
ADD https://10.10..../...tar.gz package

when I build the dockerfile with buildkit I get an "invalid not-modified ETag" error anytime I rebuild even when I remove the old image before building. I'm suspicious this is not a buildkit issue but I thought I'd check just in case. Any help would be much appreciated.

Just FYI it rebuilds fine when I don't use buildkit.

@tonistiigi
Copy link
Member

I think this should be misbehaving http server. Your server should only return 304 if it matches one of the previous Etag values. And from the spec it is supposed to send the matched Etag value back with the 304 response https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match but atm it doesn't seem to do that.

@tonistiigi
Copy link
Member

If you have a way to trace the requests between your server and buildkit we could be sure. If you do that start the trace with empty buildkit state.

@vytools
Copy link
Author

vytools commented Jan 15, 2019

I'm sorry I'm not sure what you mean by "start the trace with an empty buildkit state" could you expound a bit?

@tonistiigi
Copy link
Member

If you have a way to trace the traffic (for example in your server or with a mitm proxy) start dockerd with empty /var/lib/docker before doing that. Otherwise, the requests could be using cache from your previous runs and we don't get the full picture.

@ezpuzz
Copy link

ezpuzz commented Apr 22, 2019

+1 on this issue, it's blocking me from using buildkit. remote server in my case is api.github.com if that helps in debugging.

@hmage
Copy link

hmage commented Aug 3, 2019

Also having problems. Using it to invalidate cache if there are new commits to the repo as per solution posted here.

FROM golang

## this line invalidates cache if there are new commits
ADD https://api.github.com/repos/hmage/norm/compare/master...HEAD /dev/null
RUN git clone https://github.com/hmage/norm /norm

@rwe
Copy link
Contributor

rwe commented Sep 4, 2019

I think this is a duplicate of #905 (ADD from url fails with 'invalid not-modified ETag'). Or rather that is a duplicate of this, though that issue's title is more general. I don't think this is "local network"-specific.

Note that I've included an analysis of the cause and fix in that other issue thread.

@rwe
Copy link
Contributor

rwe commented Sep 10, 2019

I believe this can be closed now that #1159 is merged in. Not sure why GitHub didn't close this one when that was merged.

thaJeztah added a commit to thaJeztah/docker that referenced this issue Oct 24, 2019
full diff: moby/buildkit@f704282...ae10b29

fixes:

- moby/buildkit#1144 Fix socket handling
    - fsutil: Handle copying unix sockets in local sources
    - update github.com/containerd/continuity to 75bee3e2ccb6
    - update github.com/tonistiigi/fsutil to 3d2716dd0a4d
- moby/buildkit#1150 ssh: Fix file descriptor leak when doing SSH forwarding
    - fixes moby/buildkit#1146 SSH Forwarding Doesn't Release File Descriptors
- moby/buildkit#1156 llbsolver: Fix using multiple remote cache importers
- moby/buildkit#1159 http: Handle missing but unambiguous ETags in response
    - fixes moby/buildkit#905 ADD from url fails with 'invalid not-modified ETag'
    - fixes moby/buildkit#784 invalid not-modified ETag with local network ADD in docker
- moby/buildkit#1166 solver: Fix possible inefficient parallelization in solver
    - fix cases where some events were dropped resulting inefficient parallelization.
- moby/buildkit#1168 vendor: update go-runc to e029b79d
- moby/buildkit#1140 contenthash: Fix bug with symlink in source path of a copy operation
    - fixes moby/buildkit#974 COPY --from fails when source path involves a symlink
    - fixes moby/buildkit#785 COPY rpc error: code = Unknown desc = not found: not found
    - fixes moby/buildkit#958 Issue COPY a file to a symlink directory
- moby/buildkit#1139 executor: oom_score_adj is no longer set from main process

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants