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

Warn when unable to snapshot locked files #313

Closed
sitano opened this issue Jun 5, 2015 · 13 comments
Closed

Warn when unable to snapshot locked files #313

sitano opened this issue Jun 5, 2015 · 13 comments

Comments

@sitano
Copy link

sitano commented Jun 5, 2015

The checksum snapshotting prevents service installation scenarios:

Package installation process looks like:

  1. chocolateyInstall.ps1 run
  2. download and unzip exe to choco/lib/package/something
  3. register service
  4. start service
    error here: 5) chocolatey checksum snapshot will fail to read ran exe file (service)
@sitano sitano changed the title Is there anyway to disable checksum snapshotting after package install? Is there any way to disable checksum snapshotting after package install? Jun 5, 2015
@ferventcoder
Copy link
Member

This is no bueno.

I wouldn't want to disable snapshotting, because otherwise it can't uninstall the files.

@ferventcoder
Copy link
Member

Rather add some fault tolerance around the snapshot and let it continue.

@sitano
Copy link
Author

sitano commented Jun 5, 2015

yeah, got it. anyway, this pushes developer to keep such files outside of choco package install path.

@ferventcoder
Copy link
Member

I'll be addressing this quickly, so hopefully you won't need to.

What I'm stating here is:

  1. Snapshotting is important.
  2. Ignore the files that won't snapshot correctly.
  3. Do not error and move on.

@sitano
Copy link
Author

sitano commented Jun 5, 2015

fully agree 👍 , but actually, it would be nice if those files will be snapshotted too! it just somehow had to be done before they start running and became unreadable. i think its complicated flow, coz snapshotting take place after package install script ran, and those kinda files became unavailable for reading (when it issues start-service call) inside chocoInstall script.

@ferventcoder
Copy link
Member

Yes - although if the files are inside the package, they will be removed by nuget core when uninstalled as long as they have not changed.

@sitano
Copy link
Author

sitano commented Jun 5, 2015

they actually are downloading during installation from the web by chocolateyInstall.ps1, so they are not there in advance

@ferventcoder
Copy link
Member

Well darn. That makes it a bit hard to capture. One thing we could do is explore the Volume Shadow Service to get those checksums if it errors. That would be a followup to this though.

@ferventcoder
Copy link
Member

Any chance you can provide a log so I can see where this happens at?

@ferventcoder ferventcoder changed the title Is there any way to disable checksum snapshotting after package install? Snapshot locked files Jun 8, 2015
@ferventcoder
Copy link
Member

In testing this, I don't see it as an error, just a warning. I've added code to add a special snapshot code for locked files, but without using something like Volume Shadow Copy Service there is no way to snapshot the locked file.

@ferventcoder
Copy link
Member

Was your package installation failing on this or just giving you a warning?

@ferventcoder ferventcoder changed the title Snapshot locked files Warn when unable to snapshot locked files Jun 8, 2015
@ferventcoder
Copy link
Member

I created #321 to followup on a VSS type of fix to snapshot locked files. It's not the easiest thing to achieve so it's move back. For now this issue is resolved with a special snapshot code and a warning when removing the file.

ferventcoder added a commit that referenced this issue Jun 8, 2015
When a locked file is detected, use a special code for it instead of
file too big. When cleaning up the files during uninstall, provide
messages for the user to take action on those locked files as they will
be in the best place to determine whether they should stick around or
get removed.
ferventcoder added a commit that referenced this issue Jun 8, 2015
* stable:
  (maint) formatting
  (GH-313) Snapshot detection of locked files
  (maint) formatting

Conflicts:
	src/chocolatey/infrastructure/filesystem/DotNetFileSystem.cs
@ferventcoder
Copy link
Member

Added messaging in 8a283d6

@ferventcoder ferventcoder self-assigned this Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants