Azure / azure-kusto-dotnet

Azure Data Explorer (Kusto) SDK for .NET
MIT License
8 stars 5 forks source link

Could not get access to the shared lock file while trying to connect to Azure Data Explorer Cluster #4

Open tiaan-lg opened 2 years ago

tiaan-lg commented 2 years ago

I am getting the folowing error when trying to create my table

using (var kustoClient = KustoClientFactory.CreateCslAdminProvider(kustoConnectionStringBuilder)) { var command = CslCommandGenerator.GenerateTableCreateCommand(table,new[]{ Tuple.Create("StartTime", "System.DateTime"), Tuple.Create("Id", "System.Int64"), });

kustoClient.ExecuteControlCommand(databaseName, command);

System.InvalidOperationException: Could not get access to the shared lock file. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\72667\AppData\Roaming\Kusto\userTokenCache.data.lockfile'. 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) at Microsoft.Identity.Client.Extensions.Msal.CrossPlatLock..ctor(String lockfilePath, Int32 lockFileRetryDelay, Int32 lockFileRetryCount) --- End of inner exception stack trace --- at Microsoft.Identity.Client.Extensions.Msal.CrossPlatLock..ctor(String lockfilePath, Int32 lockFileRetryDelay, Int32 lockFileRetryCount) at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.CreateCrossPlatLock(StorageCreationProperties storageCreationProperties) at Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.<CreateAsync>d__23.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Kusto.Data.Security.UserTokenFileCache..ctor() "

chriswue commented 1 year ago

Does the directory C:\Users\72667\AppData\Roaming\Kusto exist and do you have access to it? Is this a persistent problem or does it only happen intermittently?