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

Package Backup Improvements #87

Closed
5 tasks done
ferventcoder opened this issue Feb 9, 2015 · 4 comments
Closed
5 tasks done

Package Backup Improvements #87

ferventcoder opened this issue Feb 9, 2015 · 4 comments

Comments

@ferventcoder
Copy link
Member

  • Do not fail when backup fails, detect errors
  • Move the directory, then copy back. This will allow running applications/services to continue functioning during upgrade.
  • When backing up, split into phases and if Move fails, attempt to copy those files back and fail a second time.
  • FileSystem move_directory should use built-in Directory.Move and fail back to the old method.
  • Shorten rollback suffix to handle longer path issues

Original error reported:

"C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.36\tools\node_modules\bower\node_module
s\insight\node_modules\inquirer\node_modules\cli-color\node_modules\memoizee\node_modules\es6-weak-map\node_modules\es
6-iterator\valid-iterable.js" to "C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.36._.previous\tools\node_modul
es\bower\node_modules\insight\node_modules\inquirer\node_modules\cli-color\node_modules\memoizee\node_modules\es6-weak
-map\node_modules\es6-iterator\valid-iterable.js".

results in

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, a
nd the directory name must be less than 248 characters.
Exiting with 1

Reference: https://gist.github.com/rpavlik/3f399974d9e1f9455f1e

@ferventcoder
Copy link
Member Author

@rpavlik Did I capture this sufficiently?

@rpavlik
Copy link

rpavlik commented Feb 9, 2015

Wow, that was quick, I was just doing the same. Yeah, I think that pretty much handles it, though I'd like the ability to choose if a backup failure is an upgrade failure. For instance, I really don't care if I have a backup of the globally-installed node modules, I can install them again anyway.

<backseatcoder>Is there a reason the files are being copied individually by name vs. moving the tree?</backseatcoder>

@ferventcoder
Copy link
Member Author

@rpavlik for individual versus moving the tree, Probably a limit of C# or something I don't know about. If the question is why copy over move, we need a copy of the files b/c in place upgrade and there may be existing files that the user has created that should continue to exist.

@ferventcoder
Copy link
Member Author

However, I did find Directory.Move so using that definitely for the move phase. 👍

@ferventcoder ferventcoder changed the title When path is too long (during backup) - bail without error (but fail the package) When path is too long (during backup) - bail without error Feb 10, 2015
@ferventcoder ferventcoder changed the title When path is too long (during backup) - bail without error When path is too long (during backup) - bail with a logged error Feb 10, 2015
ferventcoder added a commit that referenced this issue Feb 10, 2015
This leads to path to long issues
ferventcoder added a commit that referenced this issue Feb 10, 2015
- Do not fail when backup fails, detect errors
- Move the directory, then copy back. This will allow running
applications/services to continue functioning during upgrade.
- When backing up, split into phases and if Move fails, attempt to copy
those files back and fail a second time.
- FileSystem move_directory should use built-in Directory.Move and fail
back to the old method.
- FileSystem copy_directory should not log what copy file already logs
(no double entry logging).
- FileSystem copy_file log should split from and to to separate lines.
@ferventcoder ferventcoder changed the title When path is too long (during backup) - bail with a logged error Package Backup Improvements Feb 10, 2015
ferventcoder added a commit to ferventcoder/choco that referenced this issue Feb 12, 2015
* stable:
  (version) 0.9.9-rc6
  (chocolateyGH-7) Upgrade improvements
  (chocolateyGH-99) Warn when admin is not elevated
  (log) update what confirm (`-y`) does
  (chocolateyGH-82) Set Modify for Installing User
  (chocolateyGH-91) Terminating errors - choco upgrade fail
  (chocolateyGH-7) Check debug env var for 'true'
  (maint) fix logging message
  (chocolateyGH-97) Noop shows number of upgrades available
  (chocolateyGH-91) Remove global ErrorActionPreference Stop
  (command) accept features as alias
  (chocolateyGH-7) warn when install is not done in admin mode
  (doc) add changelog for 0.9.8.33
  (posh) dynamically export helpers
  (chocolateyGH-87) Backup improvements
  (chocolateyGH-94) Remove rollback on success
  (chocolateyGH-87) shorten rollback suffix
  (chocolateyGH-93) Avoid CS0200 Serialization w/private set
  (chocolateyGH-92) PowerShell - handle spaces in module path
  (shimgen) Fix company name on shims
@ferventcoder ferventcoder self-assigned this Jan 29, 2016
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