Skip to content

Unable to mount volumes on Windows 10: UnboundLocalError: local variable 'cells_to_erase' referenced before assignment #5263

Closed

Description

@AkimaLunar

I am getting a persistent error on docker-compose up. I am getting the same error on two different Windows 10 Pro machines.

Traceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 68, in main
  File "compose\cli\main.py", line 121, in perform_command
  File "compose\cli\main.py", line 954, in up
  File "compose\cli\log_printer.py", line 105, in run
  File "compose\cli\log_printer.py", line 109, in write
  File "codecs.py", line 370, in write
  File "site-packages\colorama\ansitowin32.py", line 40, in write
  File "site-packages\colorama\ansitowin32.py", line 141, in write
  File "site-packages\colorama\ansitowin32.py", line 167, in write_and_convert
  File "site-packages\colorama\ansitowin32.py", line 181, in convert_ansi
  File "site-packages\colorama\ansitowin32.py", line 212, in call_win32
  File "site-packages\colorama\winterm.py", line 132, in erase_screen
UnboundLocalError: local variable 'cells_to_erase' referenced before assignment
Failed to execute script docker-compose

After the error the port is open and the application is running, but the volumes are not mounted. Here is my setup:

  • Edition: Windows 10 Pro

  • Version: 1703

  • OS Build 15063.674

  • Docker version 17.09.0-ce, build afdb6d4

  • docker-compose version 1.16.1, build 6d1ac21

Dockerfile

# Use an official Ubuntu Xenial as a parent image
FROM ubuntu:16.04

# Install Node.js 8 and npm 5
RUN apt-get update
RUN apt-get -qq upgrade
RUN apt-get install -y build-essential
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
RUN apt-get install -y nodejs

# Set the working directory to /pretty-prism
WORKDIR /pretty-prism

# Copy the package.json into the container at /pretty-prism
COPY package.json /pretty-prism

# Install any needed packages specified in package.json
RUN npm install

# Define environment variable

# Make port 8080 available to the world outside this container
EXPOSE 8080

# Run `npm start` when the container launches
CMD ["npm", "start"]

docker-compose.yml

version: '3'
services:
  preact:
    build: .
    command: npm start
    ports:
      - "8080:8080"
    volumes:
      - .:/pretty-prism

Activity

  1. shin- commented on Oct 13, 2017

    @shin-

    This looks to be a bug in one of our dependencies. I created an issue report upstream. In the meantime, You might be able to circumvent the issue using the --no-ansi flag. Let me know if that helps!

  2. AkimaLunar commented on Oct 14, 2017

    @AkimaLunar
    Author

    Thanks, @shin- ! Nope, getting the same error with the flag.

    First, the application in the container starts and the exposed port works fine too. But then after any change in files, I get that error.

  3. shin- commented on Oct 17, 2017

    @shin-

    @AkimaLunar Does this binary fix your issue?

  4. AkimaLunar commented on Oct 18, 2017

    @AkimaLunar
    Author

    Sorry, still getting the same error.

    Traceback (most recent call last):
      File "docker-compose", line 6, in <module>
      File "compose\cli\main.py", line 68, in main
      File "compose\cli\main.py", line 121, in perform_command
      File "compose\cli\main.py", line 954, in up
      File "compose\cli\log_printer.py", line 105, in run
      File "compose\cli\log_printer.py", line 109, in write
      File "codecs.py", line 370, in write
      File "site-packages\colorama\ansitowin32.py", line 40, in write
      File "site-packages\colorama\ansitowin32.py", line 141, in write
      File "site-packages\colorama\ansitowin32.py", line 167, in write_and_convert
      File "site-packages\colorama\ansitowin32.py", line 181, in convert_ansi
      File "site-packages\colorama\ansitowin32.py", line 212, in call_win32
      File "site-packages\colorama\winterm.py", line 132, in erase_screen
    UnboundLocalError: local variable 'cells_to_erase' referenced before assignment
    Failed to execute script docker-compose
    
  5. shin- commented on Oct 19, 2017

    @shin-

    That's odd. What's the output of the version subcommand with the alternative binary?

  6. AkimaLunar commented on Oct 23, 2017

    @AkimaLunar
    Author

    It's docker-compose version 1.16.1, build 6d1ac219.

  7. shin- commented on Oct 23, 2017

    @shin-

    @AkimaLunar 6d1ac219 is the commit for the 1.16.1 release, it doesn't correspond to the binary I linked to. To confirm, the build number you should see when testing is d601408c.

  8. aleho70 commented on Oct 24, 2017

    @aleho70

    d601408c is not working, --no-ansi is mentioned only in main help, but it is not possible to use it with build or up

  9. shin- commented on Oct 24, 2017

    @shin-

    @aleho70 Could you be more specific? What do you mean when you say d601408 is not working? Do you get the same error message? Something else?

    As for --no-ansi, it can be used with any subcommand.

  10. AkimaLunar commented on Oct 25, 2017

    @AkimaLunar
    Author

    @shin-, I am probably not installing it correctly. I am just running the .exe (as an admin) and restarting Docker. Is there something else/differently I need to do?

  11. AnnatarHe commented on Oct 29, 2017

    @AnnatarHe

    Same issue here.

  12. AkimaLunar commented on Nov 1, 2017

    @AkimaLunar
    Author

    Just wanted to clarify, that the same config works fine on a Mac, including volumes.

  13. shin- commented on Nov 1, 2017

    @shin-

    @AkimaLunar To test the binary you downloaded, you'll have to replace docker-compose in your commands with the full path to the new binary, so instead of docker-compose up, something like C:\Users\Username\Downloads\docker-compose.exe up

  14. AkimaLunar commented on Nov 2, 2017

    @AkimaLunar
    Author

    Yup! That solved the issue. I am now getting a more helpful error:

    ERROR: for preact  Cannot start service preact: error while creating mount source path '/C/Users/akima/Documents/GitHub/pretty-prism-preact': mkdir /C/Users/akima/Documents: permission denied
    ERROR: Encountered errors while bringing up the project.
    

    Thanks, @shin- ! I feel like this issue can be closed now.

  15. added this to the 1.18.0 milestone on Nov 2, 2017
  16. shin- commented on Nov 2, 2017

    @shin-

    Ah, good to hear, and thank you for the follow-up!

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions