Hi,
I am going through the steps for setting up DevContainers for CM development and am hitting an issue when re-opening the scaffold project in the DevContainer. A “task” prompt is eventually opened and it tries to execute “cmf login sync”, which results in the error below. I don’t understand where I’ve gone wrong. Any advice would be appreciated.
Executing task: cmf login sync
User successfully logged in
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Exception: Failed to store credentials into CMF Auth File /home/vscode/.cmf-auth.json
System.UnauthorizedAccessException: Access to the path ‘/home/vscode/.cmf-auth.json’ is denied.
System.IO.IOException: Permission denied
at void Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, string path, bool isDirError)
at SafeFileHandle Microsoft.Win32.SafeHandles.SafeFileHandle.Open(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions
options, long preallocationSize, UnixFileMode openPermissions, out long fileLength, out UnixFileMode filePermissions, bool failForSymlink, out
bool wasSymlink, Func<ErrorInfo, OpenFlags, string, Exception> createOpenException)
at SafeFileHandle System.IO.File.OpenHandle(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long
preallocationSize)
at async Task System.IO.File.WriteToFileAsync(string path, FileMode mode, string contents, Encoding encoding, CancellationToken cancellationToken)
at async Task Cmf.CLI.Core.Services.RepositoryAuthStore.WriteFile(CmfAuthFile authFile) in /home/runner/work/cli/cli/core/Services/
RepositoryAuthStore.cs:81
at async Task Cmf.CLI.Core.Services.RepositoryAuthStore.SaveInternal(IList credentials, bool sync) in
/home/runner/work/cli/cli/core/Services/RepositoryAuthStore.cs:446
at async Task Cmf.CLI.Core.Services.RepositoryAuthStore.SaveInternal(IList credentials, bool sync) in
/home/runner/work/cli/cli/core/Services/RepositoryAuthStore.cs:450
at async Task Cmf.CLI.Core.Services.RepositoryAuthStore.Save(IList credentials, bool sync) in
/home/runner/work/cli/cli/core/Services/RepositoryAuthStore.cs:364
at async Task Cmf.CLI.Commands.SyncCommand.ExecuteAsync(RepositoryCredentialsType? repositoryType, string repository) in
/home/runner/work/cli/cli/cmf-cli/Commands/login/SyncCommand.cs:84
at void Cmf.CLI.Commands.SyncCommand.Execute(RepositoryCredentialsType? repositoryType, string repository) in
/home/runner/work/cli/cli/cmf-cli/Commands/login/SyncCommand.cs:58
at object System.RuntimeMethodHandle.InvokeMethod(object target, Void** arguments, Signature sig, bool isConstructor)
at object System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(object obj, Span copyOfArgs, BindingFlags invokeAttr)
at object System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(object obj, Span copyOfArgs, BindingFlags invokeAttr)
at object System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(object obj, BindingFlags invokeAttr, Binder binder, object parameters, CultureInfo culture)
at object System.Delegate.DynamicInvokeImpl(object args)
at async Task System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at void System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<b__0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<b__0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<b__0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<b__0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__18_0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__5_0>d.MoveNext()
at void System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
- The terminal process “/bin/bash ‘-c’, ‘cmf login sync’” terminated with exit code: 255.
- Terminal will be reused by tasks, press any key to close it.