Skip to content

Troubleshooting

Cameron Durham edited this page May 12, 2021 · 12 revisions

Introduction

This page is for documenting past issues encountered when using the csci104 Docker environment. Please search the page with any specific error text to see if this matches your issue.

General Issues

Setup script fails: Docker not installed

Problem:

Setup script fails with the error message:

Looking for docker...
Docker is not installed or available on path!
Please make sure you have Docker installed before running this script

Solution:

Make sure you have Docker installed! This may happen if you've freshly installed Docker but have not started Docker Desktop. Make sure that you open the Docker Desktop application and see a green icon in the lower left side like the image below.

Cannot connect to the Docker daemon. Is the docker daemon running?

Problem:

Starting a Docker environment fails with the message:

Error response from daemon: dial unix docker.raw.sock: connect: connection refused
Cannot connect to the Docker daemon. Is the docker daemon running?

Solution:

Make sure Docker is running. You can make sure by opening the Docker Desktop application. Also see Setup script fails

Git commands in Docker

Problem:

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Solution:

Please do not use git commands in Docker since your SSH key is not persisted inside the container. Instead use your a normal terminal.

Cannot find homework folder in Docker

Problem:

You cannot find your hw-username folder when running ls (list directory) in the Docker shell:

ch shell csci104
root@docker:/work$ ls

root@docker:/work$

Solution:

Make sure that you have moved your hw-username folder into your csci104 folder created in Step 2: create a working directory.

You should also verify that your csci104 folder is mounted properly to the Docker container. Run the following command and verify that the path in Volumes is correct:

macOS

$ ch list
Name:   csci104
        Image:  usccsci104/docker:20.04
        Volume: /Users/Username/csci104:/work
        SecOpt: seccomp:unconfined
        CapAdd: SYS_PTRACE

$ ls /Users/Username/csci104
# this should be the folder that your hw-username is in

Windows

> ch list
Name:   csci104
        Image:  usccsci104/docker:20.04
        Volume: C:\Users\Username\csci104:/work
        SecOpt: seccomp:unconfined
        CapAdd: SYS_PTRACE

> Get-ChildItem C:\Users\Username\csci104
# this should be the folder that your hw-username is in

If this is the wrong path, you can try to fix this by rerunning the ./unix/setup.sh or .\windows\setup.ps1 scripts to re-enter the path. Alternatively, you could edit the path before :/work in your .ch.yaml if you know the right path and are feeling bold.

Editor shows errors but code compiles without errors

You may also see include errors detected for #include "gtest/gtest.h"`. Please see the Editors wiki for this issue.

macOS Issues

ch command not found

Problem:

$ ch start csci104
ch command not found

After running the ./unix/setup.sh script, you have to run source ~/.bashrc or source ~/.zshrc to use ch.

Note that it's possible that you have a more unique startup shell profile if you've made a fancy Powerline/Starship/Anaconda terminal and this has changed your shell environment. If this doesn't apply to you, please skip ahead to the solution. However if you have significantly changed your shell environment and do not know how to modify your PATH variable in Unix environments, you many need a CP to help you.

Solution:

# this should print out either "-bash" or "-zsh"
echo $0

# run this for "-bash"
source ~/.bashrc

# run this for "-zsh"
source ~/.zshrc

After running the commands above, retry the ch command.

If the source command fails with an error such as no such file or directory, it's possible that the setup script failed and you need to rerun it or create the file yourself with the command below:

# this should print out either "-bash" or "-zsh"
echo $0

# run this for "-bash"
echo "export PATH=\"\$PATH:\$HOME/ch-darwin-amd64\"" >> ~/.bashrc && source ~/.bashrc

# run this for "-zsh"
echo "export PATH=\"\$PATH:\$HOME/ch-darwin-amd64\"" >> ~/.zshrc && source ~/.zshrc

Windows Issues

Error running setup script

Error message:

.\windows\setup.ps1 : File ... cannot be loaded because running scripts is disabled on this system.
Powershell Error

Solution:

Open a PowerShell as Admin window and run this command and press A when prompted to enable PowerShell scripts:

Set-ExecutionPolicy RemoteSigned

WSL 2 Installation Is Incomplete

Error:

When installing and starting Docker, a window appears with WSL 2 Installation Is Incomplete.

WSL 2 Installation Is Incomplete

Solution:

Follow the link in the prompt: https://aka.ms/wsl2kernel

Follow instructions in the Microsoft Docs. Make sure you read them carefully and restart your computer for changes to take effect.

BIOS Virtualization Must Be Enabled

Problem:

Error screen appears when trying to launch Docker:

Virtualization Must Be Enabled

Solution:

You must enable Virtualization on your motherboard settings (BIOS). For example, if you have an ASUS motherboard/laptop, you can refer to this page Enabling ASUS Virtualization. Different brands have different configuration pages and you may need to search similar things for customization.

FYI. If you need to enter BIOS, save current status and reboot your computer following this tutorial Enter ASUS BIOS. Again, you may need customized ways for a different brand of computer.

Other Virtualization Error

Ensure you have Hyper-V enabled on your Windows Features. This quick start lists several way to do this. A quick way to check is opening Windows Features by pressing the Windows key and searching for "Features". Make sure Hyper-V Management Tools is checked.

Windows Features HyperV

If you are having issues starting Docker and do not see the Hyper-V option in Windows Features, you may be running Windows 10 Home Edition and will need to upgrade to Windows 10 Pro, Enterprise, or Education (Build 15063 or later).

If you are using Windows 10 Home, you can obtain a "free" license for Windows 10 Education here.

Archived Issues from Previous Semesters

This section is in case someone from Spring 2021 is running an old version of ch and is encountering this error.

error creating container: container name already in use

Problem:

The environment was not shut down properly and you cannot restart the container.

error creating container: Error response from daemon: Conflict. The container name "/csci104" is already in use by container

Solution:

Shutdown the environment, remove the unused conflicting container(s) and start again.

docker stop csci104
docker system prune -f
ch start csci104

Note: This seems to be an issue with only versions before v0.0.10-beta. If you encounter this issue, on this older version, please update by running the install script from the docker directory:

  • Windows: ./windows/install-ch.ps1
  • macOS: ./unix/install-ch.sh