Compose: Bug: Unicode characters in volume path not handled correctly

Created on 2 Jun 2018  ·  10Comments  ·  Source: docker/compose

Description of the issue

Compose will fail for any user using VS 2017 and have a unicode character in the user home path.

Context information

When you add docker support for a .Net Core Application, VS 2017 adds a hidden .yml file that has all the information needed for VS debugging to work. This file can look like this:

version: '3.4'

services:
  mydocer21:
    image: mydocer21:dev
    build:
      target: base
    environment:
      - DOTNET_USE_POLLING_FILE_WATCHER=1
      - NUGET_PACKAGES=C:\.nuget\packages
      - NUGET_FALLBACK_PACKAGES=c:\.nuget\fallbackpackages
    volumes:
      - C:\Repos\MyDocer21\MyDocer21:C:\app
      - C:\Users\PerBornsjö\onecoremsvsmon\15.0.27703.2026:C:\remote_debugger:ro
      - C:\Users\PerBornsjö\.nuget\packages\:c:\.nuget\packages:ro
      - C:\Program Files\dotnet\sdk\NuGetFallbackFolder:c:\.nuget\fallbackpackages:ro
    entrypoint: C:\\remote_debugger\\x64\\msvsmon.exe /noauth /anyuser /silent /nostatus /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646
    labels:
      com.microsoft.visualstudio.debuggee.program: "\"C:\\Program Files\\dotnet\\dotnet.exe\""
      com.microsoft.visualstudio.debuggee.arguments: " --additionalProbingPath c:\\.nuget\\packages --additionalProbingPath c:\\.nuget\\fallbackpackages  bin\\Debug\\netcoreapp2.1\\MyDocer21.dll"
      com.microsoft.visualstudio.debuggee.workingdirectory: "C:\\app"
      com.microsoft.visualstudio.debuggee.killprogram: "C:\\remote_debugger\\x64\\utils\\KillProcess.exe dotnet.exe"

Notice my user name "PerBornsjö".
Becase I have a unicode character in my path, compose will fail to mount the volume
C:\Users\PerBornsjö\onecoremsvsmon:C:\remote_debugger:ro with the error message:

Cannot create container for service mydocer21: invalid volume specification: 'C:\Users\PerBornsj├Â\.nuget\packages:c:\.nuget\packages:ro': invalid mount config for type "bind": bind mount source path does not exist: c:\users\perbornsjÒÂ\.nuget\packages
Output of "docker-compose version"

docker-compose version 1.21.2, build a1334711
docker-py version: 3.3.0
CPython version: 3.6.4
OpenSSL version: OpenSSL 1.0.2k  26 Jan 2017
Output of "docker version"

Client:
 Version:      18.05.0-ce
 API version:  1.37
 Go version:   go1.9.5
 Git commit:   f150324
 Built:        Wed May  9 22:12:05 2018
 OS/Arch:      windows/amd64
 Experimental: false
 Orchestrator: swarm

Server:
 Engine:
  Version:      18.05.0-ce
  API version:  1.37 (minimum version 1.24)
  Go version:   go1.10.1
  Git commit:   f150324
  Built:        Wed May  9 22:29:00 2018
  OS/Arch:      windows/amd64
  Experimental: true
networks:
  default:
    external:
      name: nat
services:
  mydocer21:
    build:
      context: C:\Repos\MyDocer21
      dockerfile: MyDocer21\Dockerfile
    environment:
      ASPNETCORE_ENVIRONMENT: Development
    image: mydocer21
    ports:
    - target: 80
version: '3.4'



md5-269daefcd79822c576c8cab335b0524a



------ Build started: Project: docker-compose, Configuration: Debug Any CPU ------
1>MyDocer21 -> C:\Repos\MyDocer21\MyDocer21\bin\Debug\netcoreapp2.1\MyDocer21.dll
1>MyDocer21 -> C:\Repos\MyDocer21\MyDocer21\bin\Debug\netcoreapp2.1\MyDocer21.Views.dll
1>docker-compose  -f "C:\Repos\MyDocer21\docker-compose.yml" -f "C:\Repos\MyDocer21\docker-compose.override.yml" -f "C:\Repos\MyDocer21\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose12740336216825926529 --no-ansi config
1>The DOCKER_REGISTRY variable is not set. Defaulting to a blank string.
1>networks:
1>  default:
1>    external:
1>      name: nat
1>services:
1>  mydocer21:
1>    build:
1>      context: C:\Repos\MyDocer21
1>      dockerfile: MyDocer21\Dockerfile
1>      target: base
1>    entrypoint: C:\\remote_debugger\\x64\\msvsmon.exe /noauth /anyuser /silent /nostatus
1>      /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646
1>    environment:
1>      ASPNETCORE_ENVIRONMENT: Development
1>      DOTNET_USE_POLLING_FILE_WATCHER: '1'
1>      NUGET_FALLBACK_PACKAGES: c:\.nuget\fallbackpackages
1>      NUGET_PACKAGES: C:\.nuget\packages
1>    image: mydocer21:dev
1>    labels:
1>      com.microsoft.visualstudio.debuggee.arguments: ' --additionalProbingPath c:\.nuget\packages
1>        --additionalProbingPath c:\.nuget\fallbackpackages  bin\Debug\netcoreapp2.1\MyDocer21.dll'
1>      com.microsoft.visualstudio.debuggee.killprogram: C:\remote_debugger\x64\utils\KillProcess.exe
1>        dotnet.exe
1>      com.microsoft.visualstudio.debuggee.program: '"C:\Program Files\dotnet\dotnet.exe"'
1>      com.microsoft.visualstudio.debuggee.workingdirectory: C:\app
1>    ports:
1>    - target: 80
1>    volumes:
1>    - C:\Repos\MyDocer21\MyDocer21:C:\app:rw
1>    - C:\Users\PerBornsj├Â\onecoremsvsmon\15.0.27703.2026:C:\remote_debugger:ro
1>    - C:\Program Files\dotnet\sdk\NuGetFallbackFolder:c:\.nuget\fallbackpackages:ro
1>    - C:\Users\PerBornsj├Â\.nuget\packages:c:\.nuget\packages:ro
1>version: '3.4'
1>docker-compose  -f "C:\Repos\MyDocer21\docker-compose.yml" -f "C:\Repos\MyDocer21\docker-compose.override.yml" -f "C:\Repos\MyDocer21\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose12740336216825926529 --no-ansi up -d --build --force-recreate --remove-orphans
1>The DOCKER_REGISTRY variable is not set. Defaulting to a blank string.
1>Building mydocer21
1>Step 1/3 : FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1709 AS base
1> ---> bcc82bdd1d52
1>Step 2/3 : WORKDIR /app
1>Removing intermediate container c2cf3318b8b1
1> ---> 90a11cd8e7cf
1>Step 3/3 : EXPOSE 80
1> ---> Running in 4cc3cfc9c419
1>Removing intermediate container 4cc3cfc9c419
1> ---> b0a3d370c686
1>Successfully built b0a3d370c686
1>Successfully tagged mydocer21:dev
1>Creating dockercompose12740336216825926529_mydocer21_1 ...
1>Creating dockercompose12740336216825926529_mydocer21_1 ... error
1>ERROR: for dockercompose12740336216825926529_mydocer21_1  Cannot create container for service mydocer21: invalid volume specification: 'C:\Users\PerBornsj├Â\.nuget\packages:c:\.nuget\packages:ro': invalid mount config for type "bind": bind mount source path does not exist: c:\users\perbornsjÒÂ\.nuget\packages
1>ERROR: for mydocer21  Cannot create container for service mydocer21: invalid volume specification: 'C:\Users\PerBornsj├Â\.nuget\packages:c:\.nuget\packages:ro': invalid mount config for type "bind": bind mount source path does not exist: c:\users\perbornsjÒÂ\.nuget\packages
1>Encountered errors while bringing up the project.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : The DOCKER_REGISTRY variable is not set. Defaulting to a blank string.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Building mydocer21
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Creating dockercompose12740336216825926529_mydocer21_1 ... 
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Creating dockercompose12740336216825926529_mydocer21_1 ... error
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : ERROR: for dockercompose12740336216825926529_mydocer21_1  Cannot create container for service mydocer21: invalid volume specification: 'C:\Users\PerBornsj├Â\.nuget\packages:c:\.nuget\packages:ro': invalid mount config for type "bind": bind mount source path does not exist: c:\users\perbornsjÒÂ\.nuget\packages
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : ERROR: for mydocer21  Cannot create container for service mydocer21: invalid volume specification: 'C:\Users\PerBornsj├Â\.nuget\packages:c:\.nuget\packages:ro': invalid mount config for type "bind": bind mount source path does not exist: c:\users\perbornsjÒÂ\.nuget\packages
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Encountered errors while bringing up the project..
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : 
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting
1>Done building project "docker-compose.dcproj" -- FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

Additional information

Windows 10 x64, Windows Containers, Docker Stable version, VS 2017 15.7.2

grouwindows-client kinbug

All 10 comments

What encoding is your Compose file using? Try converting it to utf-8.

I think I have the same issue and my compose files are utf-8.

@Eneuman I found a workaround:

  1. Start command prompt and go to user directory
  2. Delete/Rename folder with wrong encoding
  3. Create Symlink: mklink /D PerBornsj├ PerBornsjö
  4. Clean solution/restart docker (Here I am not sure what exactly did the trick)
  5. Build and Start debugging

Hi
Yeah I think you are right. The symlink will fix the problem since docker compose will now find the folder. They really need to fix this quick since a lot of developers are going to be affected by this.


From: Jörg Weißbecker notifications@github.com
Sent: Monday, June 4, 2018 1:49:42 PM
To: docker/compose
Cc: Per Bornsjö; Author
Subject: Re: [docker/compose] Bug: Unicode characters in volume path not handled correctly (#5998)

I found a workaround:

  1. Start command prompt and go to user directory
  2. Delete/Rename folder with wrong encoding
  3. Create Symlink: mklink /D PerBornsj├ PerBornsjö
  4. Clean solution/restart docker (Here I am not sure what exactly did the trick)
  5. Build and Start debugging


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/docker/compose/issues/5998#issuecomment-394327538, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALiezao-kzITJO1QxWUnViP-ihMsP4MDks5t5R7WgaJpZM4UXuqd.

I was able to reproduce, looks like this was (re)introduced recently. I'll update once it's fixed.

Running some tests right now, it looks like 1.22.0 fixed the issue ; @Eneuman @IronMania are you able to confirm? Thanks!

@Eneuman @IronMania Hello there! This issue appears to be fixed. Can you please confirm that? If so, we can release 1.23.0 I believe 🙂

@ofek Sure, i’ll take a look in the morning and post my resultat.

@ofek @shin- I can confirm that this is now working! We can close this issue.

Sweet, thanks for checking!

Was this page helpful?
0 / 5 - 0 ratings