Skip to content

Too verbose output if writing in cache fails #2480

Closed

Description

@Stift

Description

When a user updates a package and some program blocks the the access to a file an error message is thrown in the output:

Source 'https://mynugetserver/api/odata' exception: System.IO.IOException: The process cannot access the file 'C:\Users\user\AppData\Local\Nuget\Cache\Snappy.NET.1.1.1.8.s314620838_v5.1.json' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
   at Paket.NuGetCache.get@175-3.Invoke(ODataSearchResult _arg1)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.args@825-1.Invoke(a a)
Something failed in GetPackageDetails, trying again with force: Couldn't get package details for package Snappy.NET 1.1.1.8 on https://mynugetserver/api/odata.

Repro steps

Cannot come up with a genuine repro.

Expected behavior

only show the call stack when in verbose mode, but not in normal mode.

Actual behavior

Too verbose output.

Known workarounds

Not a blocking issue.

Activity

  1. forki commented on Jul 4, 2017

    @forki
    Member
  2. Stift commented on Jul 4, 2017

    @Stift
    ContributorAuthor

    Ok. I'll do.

  3. added a commit that references this issue on Jul 4, 2017
    d78b249
  4. matthid commented on Jul 4, 2017

    @matthid
    Member

    Please only "blacklist" this one particular error instance and not everything as it was before. We can write a nice warning for this case and wait for others to be reported...
    Thanks for taking care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions