Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development docker container broken with VSCode / WSL2 on Windows 10 #51

Closed
chipn opened this issue Feb 26, 2021 · 1 comment · Fixed by #73
Closed

Development docker container broken with VSCode / WSL2 on Windows 10 #51

chipn opened this issue Feb 26, 2021 · 1 comment · Fixed by #73
Assignees
Labels
type: bug Something isn't working as expected
Milestone

Comments

@chipn
Copy link
Contributor

chipn commented Feb 26, 2021

Environment

  • Python version: 3.8.5
  • Nautobot version: 1.0.0b1
  • VSCode version: 1.53.2
  • Windows 10
  • WSL2 / Ubuntu-20.04
  • Docker version: 20.10.3, build 48d30b5

Steps to Reproduce

  1. Clone develop branch of repo to WSL2 VM
  2. Open directory in VSCode from within WSL2 - code .
  3. Select "Reopen in Container" from the popup for the dev container

Expected Behavior

Workspace should be opened in Docker container for development

Observed Behavior

VSCode shows error "Cannot reconnected. Please reload the window." and shows "Disconnected from Dev Container".

development_nautobot_1 container shows "Exited" status, but all other containers are running.

11:38 $ docker ps -a
CONTAINER ID   IMAGE                  COMMAND                  CREATED          STATUS                      PORTS      NAMES
8a2908da6f59   nautobot/nautobot-py   "nautobot-server rqw…"   54 seconds ago   Up 53 seconds                          development_worker_1
562271b77719   nautobot/nautobot-py   "/tmp/nautobot/docke…"   54 seconds ago   Exited (2) 48 seconds ago              development_nautobot_1
96597bc37bc2   postgres:10            "docker-entrypoint.s…"   55 seconds ago   Up 54 seconds               5432/tcp   development_postgres_1
d67dd930db96   redis:5-alpine         "docker-entrypoint.s…"   55 seconds ago   Up 54 seconds               6379/tcp   development_redis_1
11:39 $ docker logs development_nautobot_1
Operations to perform:
  Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, sessions, taggit, tenancy, users, virtualization
Running migrations:
  No migrations to apply.
↩️ Skip creating the superuser
sleep: 1: sleep: Syntax error: end of file unexpected (expecting "do")

Possible Workaround / Fixes

This issue appears to be caused by this line:

command: >
/bin/sh -c "while sleep 1000; do :; done"

Changing these lines to command: "sleep infinity" resolves the issue.

Alternatively, removing the reference to "../development/docker-compose.debug.yml" from devcontainer.json also fixes the issue, but doesn't provide the desired behavior for debugging:

"dockerComposeFile": ["../development/docker-compose.yml", "../development/docker-compose.debug.yml"],

@glennmatthews
Copy link
Contributor

Thanks for the analysis! I think there's some more breakage in our vscode integration, caused by some of the late changes prior to 1.0.0b1, beyond just this - I'll try to look into it soon.

@glennmatthews glennmatthews added status: under review type: bug Something isn't working as expected labels Feb 26, 2021
@jathanism jathanism added this to the v1.0.0 milestone Mar 1, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants