Skip to content

[cherry-pick][202305][build] Fix base OS compilation issue caused by incompatibility between urllib3 and requests packages (#3328) (#3337)#3351

Closed
oleksandrivantsiv wants to merge 1 commit intosonic-net:202305from
oleksandrivantsiv:202305
Closed

[cherry-pick][202305][build] Fix base OS compilation issue caused by incompatibility between urllib3 and requests packages (#3328) (#3337)#3351
oleksandrivantsiv wants to merge 1 commit intosonic-net:202305from
oleksandrivantsiv:202305

Conversation

@oleksandrivantsiv
Copy link
Copy Markdown
Collaborator

  • [build] Fix base OS compilation issue caused by incompatibility between urllib3 and requests packages

  • [pipeline] Pin request package to v2.31.0

What I did

How I did it

How to verify it

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

…en urllib3 and requests packages (sonic-net#3328) (sonic-net#3337)

* [build] Fix base OS compilation issue caused by incompatibility between urllib3 and requests packages

* [pipeline] Pin request package to v2.31.0
@dgsudharsan dgsudharsan requested a review from StormLiangMS May 31, 2024 23:37
@dgsudharsan
Copy link
Copy Markdown
Collaborator

@StormLiangMS Can you please merge this fix? This is required for us to build 202305 branch. This is cherry-pick of #3328

@StormLiangMS
Copy link
Copy Markdown
Contributor

hi @liushilongbuaa do we need this issue for build? I didn't see any build failures without this PR.

@dgsudharsan do we still need this PR? Seems no failure in recent builds.

@liushilongbuaa
Copy link
Copy Markdown
Contributor

It seems that requests 2.32.3 fixed this issue.

@StormLiangMS
Copy link
Copy Markdown
Contributor

hi @dgsudharsan @oleksandrivantsiv I think this is not needed any more, could you check, we can close this PR.

@nazariig
Copy link
Copy Markdown
Collaborator

Compilation still fails on 202305 without this fix:

19:49:38  + sudo cp files/build_templates/docker_image_ctl.j2 ./fs********-mellanox/usr/share/sonic/templates/docker_image_ctl.j2
19:49:38  + sudo LANG=C DOCKER_HOST= ch******** ./fs********-mellanox /usr/local/bin/generate_shutdown_order.py
19:49:38  Traceback (most recent call last):
19:49:38    File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 633, in send
19:49:38      conn = self.get_connection_with_tls_context(
19:49:38    File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 489, in get_connection_with_tls_context
19:49:38      conn = self.poolmanager.connection_from_host(
19:49:38    File "/usr/local/lib/python3.9/dist-packages/urllib3/poolmanager.py", line 303, in connection_from_host
19:49:38      return self.connection_from_context(request_context)
19:49:38    File "/usr/local/lib/python3.9/dist-packages/urllib3/poolmanager.py", line 325, in connection_from_context
19:49:38      raise URLSchemeUnknown(scheme)
19:49:38  urllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker
19:49:38  
19:49:38  During handling of the above exception, another exception occurred:
19:49:38  
19:49:38  Traceback (most recent call last):
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
19:49:38      return self.version(api_version=False)["ApiVersion"]
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/api/daemon.py", line 181, in version
19:49:38      return self._result(self._get(url), json=True)
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/utils/decorators.py", line 46, in inner
19:49:38      return f(self, *args, **kwargs)
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 237, in _get
19:49:38      return self.get(url, **self._set_request_timeout(kwargs))
19:49:38    File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 602, in get
19:49:38      return self.request("GET", url, **kwargs)
19:49:38    File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 589, in request
19:49:38      resp = self.send(prep, **send_kwargs)
19:49:38    File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 703, in send
19:49:38      r = adapter.send(request, **kwargs)
19:49:38    File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 637, in send
19:49:38      raise InvalidURL(e, request=request)
19:49:38  requests.exceptions.InvalidURL: Not supported URL scheme http+docker
19:49:38  
19:49:38  During handling of the above exception, another exception occurred:
19:49:38  
19:49:38  Traceback (most recent call last):
19:49:38    File "/usr/local/bin/generate_shutdown_order.py", line 15, in <module>
19:49:38      main()
19:49:38    File "/usr/local/bin/generate_shutdown_order.py", line 8, in main
19:49:38      manager = PackageManager.get_manager()
19:49:38    File "/usr/local/lib/python3.9/dist-packages/sonic_package_manager/manager.py", line 1015, in get_manager
19:49:38      docker_api = DockerApi(docker.from_env(), ProgressManager())
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/client.py", line 96, in from_env
19:49:38      return cls(
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/client.py", line 45, in __init__
19:49:38      self.api = APIClient(*args, **kwargs)
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 197, in __init__
19:49:38      self._version = self._retrieve_server_version()
19:49:38    File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version
19:49:38      raise DockerException(
19:49:38  docker.errors.DockerException: Error while fetching server API version: Not supported URL scheme http+docker

@dgsudharsan
Copy link
Copy Markdown
Collaborator

@saiarcot895 @StormLiangMS We are still noticing build failure in 202305 and hence require this change for the build to pass. Can you please prioritize to merge this?

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

Successfully merging this pull request may close these issues.

5 participants