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

SONiC Broadcom build failure in 202211 with error: "TypeError: request() got an unexpected keyword argument 'chunked'" #14974

Closed
thovikeerthi opened this issue May 7, 2023 · 6 comments · Fixed by #14993

Comments

@thovikeerthi
Copy link

Hi Team,
I am trying to compile SONiC Broadcom build using 202211 branch code. In this attempt, all compilation process is getting successful but the last stage of sonic-broadcom.bin generation is failing with below indicated error and hence final build is not getting generated.

Please suggest, what is the issue for this failure.

Error Snippet:

  • sudo cp files/build_templates/docker_image_ctl.j2 ./fsroot-broadcom/usr/share/sonic/templates/docker_image_ctl.j2
  • sudo LANG=C DOCKER_HOST= chroot ./fsroot-broadcom /usr/local/bin/generate_shutdown_order.py
    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
    File "/usr/local/lib/python3.9/dist-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
    File "/usr/local/lib/python3.9/dist-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
    File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
    File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
    File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
    File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
    File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
    File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
    File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
    TypeError: request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/generate_shutdown_order.py", line 15, in
main()
File "/usr/local/bin/generate_shutdown_order.py", line 8, in main
manager = PackageManager.get_manager()
File "/usr/local/lib/python3.9/dist-packages/sonic_package_manager/manager.py", line 1003, in get_manager
docker_api = DockerApi(docker.from_env(), ProgressManager())
File "/usr/local/lib/python3.9/dist-packages/docker/client.py", line 96, in from_env
return cls(
File "/usr/local/lib/python3.9/dist-packages/docker/client.py", line 45, in init
self.api = APIClient(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 197, in init
self._version = self._retrieve_server_version()
File "/usr/local/lib/python3.9/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version
raise DockerException(
docker.errors.DockerException: Error while fetching server API version: request() got an unexpected keyword argument 'chunked'

  • clean_sys
  • sudo chroot ./fsroot-broadcom umount /sys/fs/cgroup/blkio /sys/fs/cgroup/cpu /sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpuacct /sys/fs/cgroup/cpuset /sys/fs/cgroup/devices /sys/fs/cgroup/freezer /sys/fs/cgroup/hugetlb /sys/fs/cgroup/memory /sys/fs/cgroup/net_cls /sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/net_prio /sys/fs/cgroup/perf_event /sys/fs/cgroup/pids /sys/fs/cgroup/systemd /sys/fs/cgroup /sys
    umount: /sys/fs/cgroup/cpu: no mount point specified.
    umount: /sys/fs/cgroup/cpu,cpuacct: no mount point specified.
    umount: /sys/fs/cgroup/cpuacct: no mount point specified.
    umount: /sys/fs/cgroup/net_cls: no mount point specified.
    umount: /sys/fs/cgroup/net_cls,net_prio: no mount point specified.
    umount: /sys/fs/cgroup/net_prio: no mount point specified.
    umount: /sys/fs/cgroup/systemd: no mount point specified.
  • true
  • true
  • sudo LANG=C chroot ./fsroot-broadcom umount /proc
  • true
    [ FAIL LOG END ] [ target/sonic-broadcom.bin ]
    make: *** [slave.mk:1214: target/sonic-broadcom.bin] Error 1
    Makefile.work:549: recipe for target 'target/sonic-broadcom.bin' failed
    make[1]: *** [target/sonic-broadcom.bin] Error 2
    make[1]: Leaving directory '/home/sonic/sonic_ci/test/sonic-build-image'
    Makefile:39: recipe for target 'target/sonic-broadcom.bin' failed
    make: *** [target/sonic-broadcom.bin] Error 2
@thovikeerthi
Copy link
Author

I have check for docker software installed in the machine and accessibility is available.

+ sudo LANG=C DOCKER_HOST= chroot ./fsroot-broadcom docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.8.1-docker)

Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 20.10.14
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
Default Runtime: runc
Init Binary: docker-init
containerd version: 3df54a852345ae127d1fa3092b95168e4a88e2f8
runc version: v1.0.3-0-gf46b6ba
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 4.4.0-21-generic
Operating System: Debian GNU/Linux 11 (bullseye) (containerized)
OSType: linux
Architecture: x86_64
CPUs: 6
Total Memory: 31.31GiB
Name: 5ab392bc6755
ID: XYG7:RRYA:42HX:3KFD:XBIZ:MU4O:WPWS:7X7H:BCWJ:ATDI:5GKA:K632
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

$docker version
Client: Docker Engine - Community
Version: 20.10.7

API version: 1.41
Go version: go1.13.15
Git commit: f0df350
Built: Wed Jun 2 11:56:47 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.7

API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:54:58 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.6
GitCommit: d71fcd7d8303cbf684402823e425e9dd2e99285d
runc:
Version: 1.0.0-rc95
GitCommit: b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
docker-init:
Version: 0.19.0
GitCommit: de40ad0

@k-v1
Copy link
Contributor

k-v1 commented May 7, 2023

Need to install new docker-py (docker/docker-py#3116).
Instead of this

sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==5.0.3'

install docker>=6.1.0

Another solution: install urllib3<2 and requests<1.29

@RogerX87
Copy link
Contributor

RogerX87 commented May 8, 2023

similar as @k-v1

I used requests==2.28.1 in build_debian.sh as workaround now. can build pass.

sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'requests==2.28.1'
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==5.0.3'

like this.

@thovikeerthi
Copy link
Author

Thanks. Issue got resolved by updating the docker py version to 6.1.0 in build_debian.sh file.

@aparkhomenko-xsight
Copy link

I faced the same issue.
Why not to create a PR and merge it?

@thovikeerthi
Copy link
Author

Okay sure.

@thovikeerthi thovikeerthi reopened this May 9, 2023
k-v1 added a commit to k-v1/sonic-buildimage that referenced this issue May 9, 2023
yxieca pushed a commit that referenced this issue May 15, 2023
…15050)

Fix #14974
Refs: docker/docker-py#3116

Co-authored-by: Konstantin Vasin <126960927+k-v1@users.noreply.github.com>
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 a pull request may close this issue.

4 participants