New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 689359 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

CIPD client should reject package creation attempts which include a .cipd directory

Project Member Reported by iannucci@chromium.org, Feb 7 2017

Issue description

This can currently happen if you do:

cipd install <package> -version <something>
# update files in-place
cipd create ...

The `cipd install` command creates the internal .cipd directory when installing the package the first time, and the `cipd create` then foolishly vaccums' up the client's internal state into the new pacakge. When a cipd attempts to install this package later, it gets confused and believes that it's racing a concurrently-operating cipd client, even though it's not.

We could prevent this by having the create command do something like:
  * reject the package creation attempt; OR
  * warn + ignore the .cipd folder
 
Owner: dsansome@chromium.org
Cc: dsansome@chromium.org
Owner: ----
Oops wrong field.
(the .cipd directory would also get created by a cipd `ensure` command as well)
While we're fixing this, we should add a regression test for the 'install' logic so we can track the client's behavior if this DOES happen.
> warn + ignore the .cipd folder

We can't just ignore it if cipd-installed package uses symlink install method: the new package will contains all the symlinks, but not their targets (since targets are in .cipd/pkgs/*). I was considering to recognize such symlinks and put targets into the package. It'll allow to  "repackage" stuff safely.

Comment 6 by ukai@chromium.org, Feb 7 2017

we have a tool to release goma client that does

 1. cipd install to get canary package.
 2. write "no_auto_update" and "MANIFEST"
 3. upload compiler_proxy.sym to crash server
 4. cipd pkg-build --install-mode copy ..
 5. cipd pkg-register .. -ref release --tag ..

should it remove .cipd before step 4?


Yes, in your case it will be sufficient, since the package is using "--install-mode copy", and thus has no symlinks into .cipd/* guts.
that would happen to work, but it also would ONLY work because you're building the packages with --install-mode copy. If you ever switched to symlink, you'd end up building a package with a bunch of broken links :(.

It might be better to explicitly do a `cipd pkg-fetch` and explicitly unzip it somewhere rather than doing `cipd install`.

Vadim, WDYT?
Yes, cipd-fetch and unzipping would also work (even if using symlinks). Though in this case the script should remove .cipdpkg/* directory (that contains the package manifest).
To be clear: this is clearly cipd client issue. It should have warned or rejected packages with ".cipd/*" in it. The users of cipd client aren't supposed to know or care about ".cipd" directory.
Labels: -Pri-3 cit-pm-21 Pri-1
Owner: iannucci@chromium.org
Status: Assigned (was: Untriaged)
taking this
Status: Started (was: Assigned)
actually am working on this, should have patch shortly.
Project Member

Comment 16 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/external/github.com/luci/luci-go.git/+/c571b954b15cdf9132da0f08c355fdf2a600c2f2

commit c571b954b15cdf9132da0f08c355fdf2a600c2f2
Author: iannucci <iannucci@chromium.org>
Date: Thu Feb 09 02:58:55 2017

[cipd] ignore package folders missing current link.

For bad packages which include .cipd/pkgs guts, it's possible for empty
folders to pollute the pkgs space with description.json files such that
multiple pkg folders contain 'valid' contents for the same package.

R=vadimsh@chromium.org
BUG= 689359 

Review-Url: https://codereview.chromium.org/2681693004

[modify] https://crrev.com/c571b954b15cdf9132da0f08c355fdf2a600c2f2/cipd/client/cipd/local/deployer.go
[modify] https://crrev.com/c571b954b15cdf9132da0f08c355fdf2a600c2f2/cipd/client/cipd/local/deployer_test.go

Project Member

Comment 17 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/f1bc821ce6d1a223c2c3671c9be1cf69a13d717e

commit f1bc821ce6d1a223c2c3671c9be1cf69a13d717e
Author: Robert Iannucci <iannucci@chromium.org>
Date: Thu Feb 09 03:18:29 2017

Roll luci-go

infra/go/src/github.com/luci/luci-go:
c571b954 [cipd] ignore package folders missing current link.
27fda207 [cipd] ignore .cipd/* while extracting.
a3a9a22f Add a deadline for delegation token minting process.
845fd811 Add GetAccessToken function that performs JWT-based oauth flow.
41d1ef71 Rewrite LUCI RPC client in TypeScript.
9713e460 [cipd] make creating instances from cipd installations work.
48cb64fb Rewrite "luci-sleep-promise" in TypeScript.
a915f631 Add clang format to TypeScript presubmit.
0ba94003 Build TypeScript modules, use "--outFile".
0ab29a10 [cipd] Fix root read-only-ness of pkg directory.
64c2ca4b milo: Add a build info Swarming implementation.

BUG= 689359 

Change-Id: I0c1a489ee7ba9f07bea71c2b0f5453a082f39ca8
Reviewed-on: https://chromium-review.googlesource.com/439876
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>

[modify] https://crrev.com/f1bc821ce6d1a223c2c3671c9be1cf69a13d717e/DEPS

Project Member

Comment 18 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/508f70d14492573c37760381060bbb5fc7904bfd

commit 508f70d14492573c37760381060bbb5fc7904bfd
Author: Robert Iannucci <iannucci@chromium.org>
Date: Thu Feb 09 03:43:57 2017

Roll luci-go

infra/go/src/github.com/luci/luci-go:
20d2f231 [cipd] Bump user agent version

BUG= 689359 

Change-Id: Ia804ebd4bd301ed7369047cbd69b01bd6d393a89
Reviewed-on: https://chromium-review.googlesource.com/439788
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>

[modify] https://crrev.com/508f70d14492573c37760381060bbb5fc7904bfd/DEPS

Project Member

Comment 19 by bugdroid1@chromium.org, Feb 9 2017

Project Member

Comment 20 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/284af3255659442777e08898add8db24b13cd73e

commit 284af3255659442777e08898add8db24b13cd73e
Author: Robert Iannucci <iannucci@chromium.org>
Date: Thu Feb 09 20:06:25 2017

[cipd] bump cipd client version.

BUG= 689359 

Change-Id: I6d76a5ac1c51db903bcfd00d91215981e9608bc8
Reviewed-on: https://chromium-review.googlesource.com/439783
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>

[modify] https://crrev.com/284af3255659442777e08898add8db24b13cd73e/cipd_client_version
[modify] https://crrev.com/284af3255659442777e08898add8db24b13cd73e/recipe_modules/cipd/resources/bootstrap.py

Project Member

Comment 21 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/284af3255659442777e08898add8db24b13cd73e

commit 284af3255659442777e08898add8db24b13cd73e
Author: Robert Iannucci <iannucci@chromium.org>
Date: Thu Feb 09 20:06:25 2017

[cipd] bump cipd client version.

BUG= 689359 

Change-Id: I6d76a5ac1c51db903bcfd00d91215981e9608bc8
Reviewed-on: https://chromium-review.googlesource.com/439783
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>

[modify] https://crrev.com/284af3255659442777e08898add8db24b13cd73e/cipd_client_version
[modify] https://crrev.com/284af3255659442777e08898add8db24b13cd73e/recipe_modules/cipd/resources/bootstrap.py

Status: Fixed (was: Started)
This is fixed and deployed :)

Sign in to add a comment