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

New line in output_image_spec ends in 'Connection reset by peer #1320

Open
rgaiacs opened this issue Nov 8, 2023 · 3 comments
Open

New line in output_image_spec ends in 'Connection reset by peer #1320

rgaiacs opened this issue Nov 8, 2023 · 3 comments

Comments

@rgaiacs
Copy link

rgaiacs commented Nov 8, 2023

Use of

self.docker_repository = (
    f"magdalena/{self.domain}-{self.user_name}-{self.repository_name}"
).replace(".", "-").replace(" ", "-").lower()
self.docker_image_name = f"{self.docker_repository}:{self.git_commit_id}"
r2d.output_image_spec = self.docker_image_name
r2d.start()

is failing with

magdalena-magdalena-1  | [2023-11-08 09:29:47,708] INFO in methodshub: Repository: https://github.com/GESIS-Methods-Hub/minimal-example-ipynb-python.git
magdalena-magdalena-1  | [2023-11-08 09:29:47,708] INFO in methodshub: Docker image name: magdalena/github-com-gesis-methods-hub-minimal-example-ipynb-python:93a3b377f042298a65811a17356e25f30b276456
...
magdalena-magdalena-1  | [Repo2Docker] Using CondaBuildPack builder
magdalena-magdalena-1  | 
magdalena-magdalena-1  | [2023-11-08 09:29:50,473] ERROR in methodshub: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
magdalena-magdalena-1  | 172.25.0.1 - - [08/Nov/2023 09:29:50] "POST / HTTP/1.1" 500 -
magdalena-magdalena-1  | Traceback (most recent call last):
magdalena-magdalena-1  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1478, in __call__
magdalena-magdalena-1  |     return self.wsgi_app(environ, start_response)
magdalena-magdalena-1  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1458, in wsgi_app
magdalena-magdalena-1  |     response = self.handle_exception(e)
magdalena-magdalena-1  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1455, in wsgi_app
magdalena-magdalena-1  |     response = self.full_dispatch_request()
magdalena-magdalena-1  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 869, in full_dispatch_request
magdalena-magdalena-1  |     rv = self.handle_user_exception(e)
magdalena-magdalena-1  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 867, in full_dispatch_request
magdalena-magdalena-1  |     rv = self.dispatch_request()
magdalena-magdalena-1  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 852, in dispatch_request
magdalena-magdalena-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)

but hardcoding the name of the image like

self.docker_image_name = f'magdalena/github-com-gesis-methods-hub-minimal-example-ipynb-python:93a3b377f042298a65811a17356e25f30b276456'
r2d.output_image_spec = self.docker_image_name
r2d.start()

works as expected (image is built).

Any help to explain what is happening here?

@rgaiacs rgaiacs changed the title f-strings for output_image_spec ends in 'Connection reset by peer New line in output_image_spec ends in 'Connection reset by peer Nov 8, 2023
@rgaiacs
Copy link
Author

rgaiacs commented Nov 8, 2023

I realise that the problem was a new line at the end of the name of the image. Should we sanitise the input?

@manics
Copy link
Member

manics commented Nov 8, 2023

We could check and reject invalid names with an error? I think any sanitisation should be done by the caller not r2d.

@rgaiacs
Copy link
Author

rgaiacs commented Nov 8, 2023

Check and reject invalid names with an error will be great. I will try to send a PR.

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

2 participants