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

Autograder tool fails with Alpine-based image #20

Closed
kilbd opened this issue Feb 22, 2021 · 2 comments
Closed

Autograder tool fails with Alpine-based image #20

kilbd opened this issue Feb 22, 2021 · 2 comments

Comments

@kilbd
Copy link

kilbd commented Feb 22, 2021

The autograder tool works fine when using one of the standard, Debian-based Python images for my custom grader (e.g., python:3.8), but fails when I try to use an image based on Alpine Linux (e.g., python:3.8-alpine).

I'm running Docker Desktop 3.1.0 for macOS Big Sur. Here is the error I see:

ERROR:root:Problem when running command. Sorry!
Traceback (most recent call last):
  File "/Users/xxxx/Documents/projects/coursera_autograder/venv/lib/python3.8/site-packages/docker_py-1.10.4-py3.8.egg/docker/client.py", line 170, in _raise_for_status
    response.raise_for_status()
  File "/Users/xxxx/Documents/projects/coursera_autograder/venv/lib/python3.8/site-packages/requests-2.9.2-py3.8.egg/requests/models.py", line 844, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker://localunixsocket/v1.41/containers/2f442590f49957a335b0200e278dccecb3e836908d486aad5ba07a80e22e3132/archive?path=%2Fshared%2Ffeedback.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/xxxx/Documents/projects/coursera_autograder/coursera_autograder/main.py", line 101, in main
    return args.func(args)
  File "/Users/xxxx/Documents/projects/coursera_autograder/coursera_autograder/commands/grade.py", line 181, in command_grade_local
    run_container(d, container, args)
  File "/Users/xxxx/Documents/projects/coursera_autograder/coursera_autograder/commands/grade.py", line 53, in run_container
    get_feedback(docker, container, "feedback.json", args.dst_dir)
  File "/Users/xxxx/Documents/projects/coursera_autograder/coursera_autograder/commands/grade.py", line 41, in get_feedback
    raw_stream,status = docker.get_archive(container, "/shared/" + file_name)
  File "/Users/xxxx/Documents/projects/coursera_autograder/venv/lib/python3.8/site-packages/docker_py-1.10.4-py3.8.egg/docker/utils/decorators.py", line 21, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/Users/xxxx/Documents/projects/coursera_autograder/venv/lib/python3.8/site-packages/docker_py-1.10.4-py3.8.egg/docker/utils/decorators.py", line 35, in wrapper
    return f(self, *args, **kwargs)
  File "/Users/xxxx/Documents/projects/coursera_autograder/venv/lib/python3.8/site-packages/docker_py-1.10.4-py3.8.egg/docker/api/container.py", line 187, in get_archive
    self._raise_for_status(res)
  File "/Users/xxxx/Documents/projects/coursera_autograder/venv/lib/python3.8/site-packages/docker_py-1.10.4-py3.8.egg/docker/client.py", line 173, in _raise_for_status
    raise errors.NotFound(e, response, explanation=explanation)
docker.errors.NotFound: 404 Client Error: Not Found ("b'{"message":"Could not find the file /shared/feedback.json in container 2f442590f49957a335b0200e278dccecb3e836908d486aad5ba07a80e22e3132"}'")
Task Terminated with exit code 1
@kilbd
Copy link
Author

kilbd commented Feb 23, 2021

Now I'm not seeing a difference between Linux flavors. The Debian-based image is now returning the same error as above. I'm wondering if this is related to #16 or if this is unique to Docker Desktop for macOS (e.g., different location for Docker socket).

@kilbd
Copy link
Author

kilbd commented Mar 5, 2021

Ha, the problem appears to have been in my script. I didn't update the script shebang when moving to Alpine to avoid the Debian CVE. I do wish that the output of the autograder tool would have helped me troubleshoot the issue better.

Closing this issue.

@kilbd kilbd closed this as completed Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant