Skip to content

Exception in static ctor creating history mutex #746

Closed

Description

@piddeman75

Environment data

Steps to reproduce or exception report

Last 0 Keys:


Exception:
System.UnauthorizedAccessException: Access to the path 'PSReadlineHistoryFile_46696421' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.Mutex.CreateMutexWithGuaranteedCleanup(Boolean initiallyOwned, String name, Boolean& createdNew, SECURITY_ATTRIBUTES secAttrs)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

problem.txt

Activity

  1. changed the title [-]Windows admin center[/-] [+]Exception in static ctor creating history mutex[/+] on Oct 23, 2018
  2. daxian-dbw commented on Feb 22, 2021

    @daxian-dbw
    Member

    #1061 and #1602 were made to improve how PSReadLine uses mutex for history file. Also, it's been a long time that I don't see new issues reporting about UnauthorizedAccessException regarding the mutex. So I think the issue was resolved. Please upgrade to the 2.1.0 version of PSReadLine from PowerShell Gallery.
    See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.

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

    Issue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions