# Error during DevContainer setup

**URL:** <https://community.criticalmanufacturing.com/t/error-during-devcontainer-setup/530>\
**Category:** Deployment\
**Tags:** installation, v11.3\
**Created:** [December 1, 2025, 8:25pm UTC](https://community.criticalmanufacturing.com/t/error-during-devcontainer-setup/530 "2025-12-01T20:25:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Hines](https://avatars.discourse-cdn.com/v4/letter/b/ac8455/32.png) [@Ben\_Hines](https://community.criticalmanufacturing.com/u/Ben_Hines)\
**Post date:** [December 1, 2025, 8:25pm UTC](https://community.criticalmanufacturing.com/t/error-during-devcontainer-setup/530/1 "2025-12-01T20:25:07Z")

</div>

Hi,

I am going through the steps for setting up [DevContainers for CM development](https://developer.criticalmanufacturing.com/learn/getting-started/) 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.

---

<div class="post-metadata">

**Author:** ![Joao\_Moreira](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@Joao\_Moreira](https://community.criticalmanufacturing.com/u/Joao_Moreira)\
**Post date:** [December 19, 2025, 10:21am UTC](https://community.criticalmanufacturing.com/t/error-during-devcontainer-setup/530/2 "2025-12-19T10:21:38Z")

</div>

Hi Ben,

It looks like a permission mismatch between your host machine and the DevContainer. The path `/home/vscode/.cmf-auth.json` inside the container is typically a mount point linked to a file in your local environment (likely your WSL profile).

Here are a few things to check to resolve the `UnauthorizedAccessException`:

- 

## **Host File Permissions:** Ensure the `.cmf-auth.json` file exists on your local machine and that your local user has full read/write permissions to it.

## **User Mapping (UID/GID):** If you are running as `root` on your host machine, the `vscode` user inside the container may not have permission to modify the mounted file. You can test this by temporarily granting broader permissions to the file on your host (`chmod 666 ~/.cmf-auth.json`) to see if the error clears.

## **DevContainer Lifecycle Logs:** Check the **Remote-Containers** output log in VS Code during the “Reopening in Container” process. Look for any warnings related to “Bind Mounts” or “Mounting failures.”

**Pre-create the file:** the mount fails if the file doesn’t exist yet on the host. Create an empty file on your host before launching the container.

Best regards,

João Moreira
