Skip to content

Commit

Permalink
[build] Fix base OS compilation issue caused by incompatibility with …
Browse files Browse the repository at this point in the history
…requests >= 2.29.0. (#2830)

#### What I did
Fix SONiC image compilation issue:
```
[2023-05-03T17:54:00.146Z] + sudo cp files/build_templates/docker_image_ctl.j2 ./fs********-mellanox/usr/share/sonic/templates/docker_image_ctl.j2
[2023-05-03T17:54:00.146Z] + sudo LANG=C DOCKER_HOST= ch******** ./fs********-mellanox /usr/local/bin/generate_shutdown_order.py
[2023-05-03T17:54:00.146Z] Traceback (most recent call last):
[2023-05-03T17:54:00.146Z]   File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
[2023-05-03T17:54:00.146Z]     return self.version(api_version=False)["ApiVersion"]
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/docker/api/daemon.py", line 181, in version
[2023-05-03T17:54:00.147Z]     return self._result(self._get(url), json=True)
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/docker/utils/decorators.py", line 46, in inner
[2023-05-03T17:54:00.147Z]     return f(self, *args, **kwargs)
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 237, in _get
[2023-05-03T17:54:00.147Z]     return self.get(url, **self._set_request_timeout(kwargs))
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 600, in get
[2023-05-03T17:54:00.147Z]     return self.request("GET", url, **kwargs)
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 587, in request
[2023-05-03T17:54:00.147Z]     resp = self.send(prep, **send_kwargs)
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 701, in send
[2023-05-03T17:54:00.147Z]     r = adapter.send(request, **kwargs)
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 486, in send
[2023-05-03T17:54:00.147Z]     resp = conn.urlopen(
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 790, in urlopen
[2023-05-03T17:54:00.147Z]     response = self._make_request(
[2023-05-03T17:54:00.147Z]   File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 496, in _make_request
[2023-05-03T17:54:00.147Z]     conn.request(
[2023-05-03T17:54:00.147Z] TypeError: request() got an unexpected keyword argument 'chunked'
```

#### How I did it
Pin urllib to version < 2 as it was suggested in docker/docker-py#3113.

#### How to verify it
Run SONiC image compilation.
  • Loading branch information
oleksandrivantsiv authored May 8, 2023
1 parent 1097373 commit 71ef4f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
},
install_requires=[
'click==7.0',
'urllib3<2',
'click-log>=0.3.2',
'docker>=4.4.4',
'docker-image-py>=0.1.10',
Expand Down

0 comments on commit 71ef4f1

Please sign in to comment.