docker-py not working with requests-2.12.2
See original GitHub issueI’m not sure whether it’s requests’ issue or something change should be made in docker-py
requests-2.12.1 works fine
It might be something related with requests/models.py line 350 in https://github.com/kennethreitz/requests/compare/v2.12.1...v2.12.2
in this commit
import docker
import os
import requests
print(requests.__version__)
print(docker.__version__)
os.system('docker version')
client = docker.AutoVersionClient()
client.tag('ubuntu', 'ubuntu-test')
~/qb/qb_playground > python docker-client.py
2.12.2
1.10.6
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 21:44:32 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 21:44:32 2016
OS/Arch: linux/amd64
Traceback (most recent call last):
File "/home/tyz/.pyenv/versions/3.5.0/lib/python3.5/site-packages/docker/client.py", line 170, in _raise_for_status
response.raise_for_status()
File "/home/tyz/.pyenv/versions/3.5.0/lib/python3.5/site-packages/requests/models.py", line 893, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localunixsocket/v1.24/images/ubuntu/tag
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-client.py", line 8, in <module>
client.tag('ubuntu', 'ubuntu-test')
File "/home/tyz/.pyenv/versions/3.5.0/lib/python3.5/site-packages/docker/utils/decorators.py", line 21, in wrapped
return f(self, resource_id, *args, **kwargs)
File "/home/tyz/.pyenv/versions/3.5.0/lib/python3.5/site-packages/docker/api/image.py", line 240, in tag
self._raise_for_status(res)
File "/home/tyz/.pyenv/versions/3.5.0/lib/python3.5/site-packages/docker/client.py", line 174, in _raise_for_status
raise errors.APIError(e, response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'{"message":"invalid reference format"}'")
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Issues · docker/docker-py - GitHub
A Python library for the Docker Engine API. Contribute to docker/docker-py development by creating an account on GitHub.
Read more >docker python requests not working - You.com | The AI Search ...
Problem. I have a 2-container docker-compose.yml file. One of the containers is a small FastAPI app. The other is just trying to hit...
Read more >Change Log - docker-py Documentation
When a resource identifier (image or container ID) is passed to a Client method, we now check for None values to avoid crashing...
Read more >python 3.x - GET request not responding in docker container
I often use python requests inside my python containers, and have come across this problem a couple of times.
Read more >docker-sdk-python Documentation - Read the Docs
To communicate with the Docker daemon, you first need to instantiate a client. The easiest way to do that is by calling.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Relevant Requests issue is kennethreitz/requests#3734. Temporary workaround is to pin to v2.12.1.
@westsouthnight you already have an workaround: use requests 2.12.3