Triggered by Gerrit: https://gerrit.o-ran-sc.org/r/c/ric-plt/xapp-frame-py/+/12317 Running as SYSTEM [EnvInject] - Loading node environment variables. Building remotely on prd-ubuntu1804-builder-2c-2g-2154 (ubuntu1804-builder-2c-2g ubuntu2004-builder-2c-2g) in workspace /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) $ ssh-agent SSH_AUTH_SOCK=/tmp/ssh-zP3EZ8h8LCkP/agent.5746 SSH_AGENT_PID=5748 [ssh-agent] Started. Running ssh-add (command line suppressed) Identity added: /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master@tmp/private_key_8337496869508180518.key (jenkins-ssh) [ssh-agent] Using credentials jenkins (jenkins) The recommended git tool is: NONE using credential jenkins Wiping out workspace first. Cloning the remote Git repository Cloning repository ssh://oran-jobbuilder@gerrit.o-ran-sc.org:29418/ric-plt/xapp-frame-py > git init /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master # timeout=10 Fetching upstream changes from ssh://oran-jobbuilder@gerrit.o-ran-sc.org:29418/ric-plt/xapp-frame-py > git --version # timeout=10 > git --version # 'git version 2.25.1' using GIT_SSH to set credentials jenkins > git fetch --tags --force --progress -- ssh://oran-jobbuilder@gerrit.o-ran-sc.org:29418/ric-plt/xapp-frame-py +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config remote.origin.url ssh://oran-jobbuilder@gerrit.o-ran-sc.org:29418/ric-plt/xapp-frame-py # timeout=10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config remote.origin.url ssh://oran-jobbuilder@gerrit.o-ran-sc.org:29418/ric-plt/xapp-frame-py # timeout=10 Fetching upstream changes from ssh://oran-jobbuilder@gerrit.o-ran-sc.org:29418/ric-plt/xapp-frame-py using GIT_SSH to set credentials jenkins > git fetch --tags --force --progress -- ssh://oran-jobbuilder@gerrit.o-ran-sc.org:29418/ric-plt/xapp-frame-py refs/changes/17/12317/12 # timeout=10 > git rev-parse d0e8bfae4ec5928ef3cc217190d9572daaf0195e^{commit} # timeout=10 JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script Checking out Revision d0e8bfae4ec5928ef3cc217190d9572daaf0195e (refs/changes/17/12317/12) > git config core.sparsecheckout # timeout=10 > git checkout -f d0e8bfae4ec5928ef3cc217190d9572daaf0195e # timeout=10 Commit message: "RIC-1032: xapp-frame-py block xApp to register when communicating with Rtmgr" > git rev-parse FETCH_HEAD^{commit} # timeout=10 > git rev-list --no-walk e0de19a1c51e607b7e7a4a71a326a09486583539 # timeout=10 > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule init # timeout=10 > git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10 > git config --get submodule.nodeb-rnib.url # timeout=10 > git config -f .gitmodules --get submodule.nodeb-rnib.path # timeout=10 > git submodule update --init --recursive nodeb-rnib # timeout=10 provisioning config files... copy managed file [npmrc] to file:/home/jenkins/.npmrc copy managed file [pipconf] to file:/home/jenkins/.config/pip/pip.conf [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins6035364789680282499.sh ---> python-tools-install.sh Setup pyenv: * system (set by /opt/pyenv/version) * 3.8.13 (set by /opt/pyenv/version) * 3.9.13 (set by /opt/pyenv/version) * 3.10.6 (set by /opt/pyenv/version) lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-BkFA lf-activate-venv(): INFO: Save venv in file: /tmp/.os_lf_venv lf-activate-venv(): INFO: Installing: lftools lf-activate-venv(): INFO: Adding /tmp/venv-BkFA/bin to PATH Generating Requirements File Python 3.10.6 pip 23.3.2 from /tmp/venv-BkFA/lib/python3.10/site-packages/pip (python 3.10) appdirs==1.4.4 argcomplete==3.2.1 aspy.yaml==1.3.0 attrs==23.1.0 autopage==0.5.2 Babel==2.14.0 beautifulsoup4==4.12.2 boto3==1.34.8 botocore==1.34.8 bs4==0.0.1 cachetools==5.3.2 certifi==2023.11.17 cffi==1.16.0 cfgv==3.4.0 chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 cliff==4.4.0 cmd2==2.4.3 cryptography==3.3.2 debtcollector==2.5.0 decorator==5.1.1 defusedxml==0.7.1 Deprecated==1.2.14 distlib==0.3.8 dnspython==2.4.2 docker==4.2.2 dogpile.cache==1.3.0 email-validator==2.1.0.post1 filelock==3.13.1 future==0.18.3 gitdb==4.0.11 GitPython==3.1.40 google-auth==2.25.2 httplib2==0.22.0 identify==2.5.33 idna==3.6 importlib-metadata==7.0.1 importlib-resources==1.5.0 iso8601==2.1.0 Jinja2==3.1.2 jmespath==1.0.1 jsonpatch==1.33 jsonpointer==2.4 jsonschema==4.20.0 jsonschema-specifications==2023.12.1 keystoneauth1==5.4.0 kubernetes==28.1.0 lftools==0.37.8 lxml==4.9.4 MarkupSafe==2.1.3 msgpack==1.0.7 multi_key_dict==2.0.3 munch==4.0.0 netaddr==0.9.0 netifaces==0.11.0 niet==1.4.2 nodeenv==1.8.0 oauth2client==4.1.3 oauthlib==3.2.2 openstacksdk==0.62.0 os-client-config==2.1.0 os-service-types==1.7.0 osc-lib==2.9.0 oslo.config==9.2.0 oslo.context==5.3.0 oslo.i18n==6.2.0 oslo.log==5.4.0 oslo.serialization==5.2.0 oslo.utils==6.3.0 packaging==23.2 pbr==6.0.0 platformdirs==4.1.0 prettytable==3.9.0 pyasn1==0.5.1 pyasn1-modules==0.3.0 pycparser==2.21 pygerrit2==2.0.15 PyGithub==2.1.1 pyinotify==0.9.6 PyJWT==2.8.0 PyNaCl==1.5.0 pyparsing==2.4.7 pyperclip==1.8.2 pyrsistent==0.20.0 python-cinderclient==9.4.0 python-dateutil==2.8.2 python-heatclient==3.3.0 python-jenkins==1.8.2 python-keystoneclient==5.2.0 python-magnumclient==4.3.0 python-novaclient==18.4.0 python-openstackclient==6.0.0 python-swiftclient==4.4.0 pytz==2023.3.post1 PyYAML==6.0.1 referencing==0.32.0 requests==2.31.0 requests-oauthlib==1.3.1 requestsexceptions==1.4.0 rfc3986==2.0.0 rpds-py==0.15.2 rsa==4.9 ruamel.yaml==0.18.5 ruamel.yaml.clib==0.2.8 s3transfer==0.10.0 simplejson==3.19.2 six==1.16.0 smmap==5.0.1 soupsieve==2.5 stevedore==5.1.0 tabulate==0.9.0 toml==0.10.2 tomlkit==0.12.3 tqdm==4.66.1 typing_extensions==4.9.0 tzdata==2023.3 urllib3==1.26.18 virtualenv==20.25.0 wcwidth==0.2.12 websocket-client==1.7.0 wrapt==1.16.0 xdg==6.0.0 xmltodict==0.13.0 yq==3.2.3 zipp==3.17.0 [EnvInject] - Injecting environment variables from a build step. [EnvInject] - Injecting as environment variables the properties content PYTHON=python3 [EnvInject] - Variables injected successfully. [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash -l /tmp/jenkins10392507156957335941.sh ---> tox-install.sh + source /home/jenkins/lf-env.sh + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 ++ mktemp -d /tmp/venv-XXXX + lf_venv=/tmp/venv-5Mha + local venv_file=/tmp/.os_lf_venv + local python=python3 + local options + local set_path=true + local install_args= ++ getopt -o np:v: -l no-path,system-site-packages,python:,venv-file: -n lf-activate-venv -- --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 + true + case $1 in + venv_file=/tmp/.toxenv + shift 2 + true + case $1 in + shift + break + case $python in + local pkg_list= + [[ -d /opt/pyenv ]] + echo 'Setup pyenv:' Setup pyenv: + export PYENV_ROOT=/opt/pyenv + PYENV_ROOT=/opt/pyenv + export PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + pyenv versions system 3.8.13 3.9.13 * 3.10.6 (set by /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.python-version) + command -v pyenv ++ pyenv init - --no-rehash + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "'\''/opt/pyenv/shims'\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; fi; done; echo "${paths[*]}"'\'')" export PATH="/opt/pyenv/shims:${PATH}" export PYENV_SHELL=bash source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' pyenv() { local command command="${1:-}" if [ "$#" -gt 0 ]; then shift fi case "$command" in rehash|shell) eval "$(pyenv "sh-$command" "$@")" ;; *) command pyenv "$command" "$@" ;; esac }' +++ bash --norc -ec 'IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; fi; done; echo "${paths[*]}"' ++ PATH=/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin ++ export PYENV_SHELL=bash ++ PYENV_SHELL=bash ++ source /opt/pyenv/libexec/../completions/pyenv.bash +++ complete -F _pyenv pyenv ++ lf-pyver python3 ++ local py_version_xy=python3 ++ local py_version_xyz= ++ grep -E '^[0-9.]*[0-9]$' ++ awk '{ print $1 }' ++ sed 's/^[ *]* //' ++ pyenv versions ++ local command ++ command=versions ++ '[' 1 -gt 0 ']' ++ shift ++ case "$command" in ++ command pyenv versions ++ pyenv versions ++ [[ ! -s /tmp/.pyenv_versions ]] +++ grep '^3' /tmp/.pyenv_versions +++ tail -n 1 +++ sort -V ++ py_version_xyz=3.10.6 ++ [[ -z 3.10.6 ]] ++ echo 3.10.6 ++ return 0 + pyenv local 3.10.6 + local command + command=local + '[' 2 -gt 0 ']' + shift + case "$command" in + command pyenv local 3.10.6 + pyenv local 3.10.6 + for arg in "$@" + case $arg in + pkg_list+='tox ' + for arg in "$@" + case $arg in + pkg_list+='virtualenv ' + for arg in "$@" + case $arg in + pkg_list+='urllib3~=1.26.15 ' + [[ -f /tmp/.toxenv ]] + [[ ! -f /tmp/.toxenv ]] + [[ -n '' ]] + python3 -m venv /tmp/venv-5Mha + echo 'lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-5Mha' lf-activate-venv(): INFO: Creating python3 venv at /tmp/venv-5Mha + echo /tmp/venv-5Mha + echo 'lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv' lf-activate-venv(): INFO: Save venv in file: /tmp/.toxenv + /tmp/venv-5Mha/bin/python3 -m pip install --upgrade --quiet pip virtualenv + [[ -z tox virtualenv urllib3~=1.26.15 ]] + echo 'lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 ' lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 + /tmp/venv-5Mha/bin/python3 -m pip install --upgrade --quiet --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 + type python3 + true + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-5Mha/bin to PATH' lf-activate-venv(): INFO: Adding /tmp/venv-5Mha/bin to PATH + PATH=/tmp/venv-5Mha/bin:/opt/pyenv/shims:/opt/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + return 0 + python3 --version Python 3.10.6 + python3 -m pip --version pip 23.3.2 from /tmp/venv-5Mha/lib/python3.10/site-packages/pip (python 3.10) + python3 -m pip freeze cachetools==5.3.2 chardet==5.2.0 colorama==0.4.6 distlib==0.3.8 filelock==3.13.1 packaging==23.2 platformdirs==4.1.0 pluggy==1.3.0 pyproject-api==1.6.1 tomli==2.0.1 tox==4.11.4 urllib3==1.26.18 virtualenv==20.25.0 [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins17700990912085005355.sh ---> install-deb-rmr.sh + version_file=rmr-version.yaml + [[ -f rmr-version.yaml ]] ++ xargs ++ cut -d: -f2 ++ grep '^repo:' rmr-version.yaml + repo= ++ grep '^version:' rmr-version.yaml ++ cut -d: -f2 ++ xargs + ver=4.9.1 + [[ -z 4.9.1 ]] + repo=release + for deb in "rmr_${ver}_amd64.deb" "rmr-dev_${ver}_amd64.deb" + wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_4.9.1_amd64.deb/download.deb 2023-12-28 04:00:24 URL:https://d3fo0g5hm7lbuv.cloudfront.net/20756/10598/debian/package_files/4252893.deb?Expires=1703736324&Signature=mrW2-7QAvu3DCS6tuu3zZsAUxA0~j-GGkXcy9psOBdSkuvdJkE-otTDqfodkMEox8RQxGqMl-NT2efjxgk3INiuaEn5AjHx13h6zRZAL3SveAJJMXIrMCBZS2Ky8sbrYVoMnxOxK-Dga5hS-qAcrbjiP1WrYYo9wJpuQEpcDdC0c8AiFgecH~n0gpP88estXux7veAAXA13Sx58YGFQR~XARy6yKOG2XDy-n7Bi~i5QolOZzHYr-377Rl99qhsT6UPOz0TaYoKo5DG0FifdAP6MeSaNIShSL8BvfRRendaqzZrjCcWtJqVrbC8z3L0FWzfkyB-my1PyeLAeyhALZ8A__&Key-Pair-Id=K1ZMSF1EKC3AZL [243050/243050] -> "rmr_4.9.1_amd64.deb" [1] + sudo dpkg -i rmr_4.9.1_amd64.deb Selecting previously unselected package rmr. (Reading database ... 198606 files and directories currently installed.) Preparing to unpack rmr_4.9.1_amd64.deb ... Unpacking rmr (4.9.1) ... Setting up rmr (4.9.1) ... + rm -f rmr_4.9.1_amd64.deb + for deb in "rmr_${ver}_amd64.deb" "rmr-dev_${ver}_amd64.deb" + wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_4.9.1_amd64.deb/download.deb 2023-12-28 04:00:27 URL:https://d3fo0g5hm7lbuv.cloudfront.net/20756/10598/debian/package_files/4252891.deb?Expires=1703736327&Signature=mUdjSC4asVKVmfZMwVWiJY2cD4uvrLvlKKWqb3o4KYnrfGlNrOggOGokVeNSMpr9X6E38t-P2PBp4wBeKXjKBXZ6NemDPxxXTMXQBZmMogd6SgmthGGIC0jDkCPLNAOw84u3LEmbIMHmehAQPaUIcRZ3-CCr5O0oe9eYAjjiC2COsmzjNHjgptx1jul18KRcblFgsHtGvpR6EHamTg5zB5NOwYosUZpZbOsF3VAiUfEo79ObSAlBcAT9ECVK5S5flMK17~UsTJ1zTwr7q-uusYt8f1GSoFaKSNCbdo8xgteCmMKVWqiseAnkvhe5Y3VUbPjeKK7bVb7yDCuwoOiUnQ__&Key-Pair-Id=K1ZMSF1EKC3AZL [126164/126164] -> "rmr-dev_4.9.1_amd64.deb" [1] + sudo dpkg -i rmr-dev_4.9.1_amd64.deb Selecting previously unselected package rmr-dev. (Reading database ... 198614 files and directories currently installed.) Preparing to unpack rmr-dev_4.9.1_amd64.deb ... Unpacking rmr-dev (4.9.1) ... Setting up rmr-dev (4.9.1) ... + rm -f rmr-dev_4.9.1_amd64.deb + echo '---> install-deb-rmr.sh ends' ---> install-deb-rmr.sh ends + echo '---> install-deb-e2ap.sh' ---> install-deb-e2ap.sh + set -eux + version_file=e2ap-version.yaml + [[ -f e2ap-version.yaml ]] ++ grep '^repo:' e2ap-version.yaml ++ cut -d: -f2 ++ xargs + repo= ++ grep '^version:' e2ap-version.yaml ++ xargs ++ cut -d: -f2 + ver=1.1.0 + [[ -z 1.1.0 ]] + repo=release + for deb in "riclibe2ap_${ver}_amd64.deb" "riclibe2ap-dev_${ver}_amd64.deb" + wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/riclibe2ap_1.1.0_amd64.deb/download.deb 2023-12-28 04:00:27 URL:https://d3fo0g5hm7lbuv.cloudfront.net/20756/10598/debian/package_files/2517358.deb?Expires=1703736327&Signature=v~N3XoRPUxD-PLpi6bq9~vI8dKFgDiLtujEpGaB1I0Y-YcQotMT7u9pHUIRcsunAqcdCbIAFtnA0I8Ihdieg1FxkZuvnaYR1ZdbTkLjFP3o03jQu5kopBIuQ2CKt61yKhtzBC2tcnJugor4zJ~0Cp5ax0QGThFE2gfUUdPQrunfPOxxZ8lHbaHQ~af0CJbwrvufLTFjPiHK-69cHG7qY1QoQUfbIHhmN7HfpuTwv5q8H1AC16oiFVg9BOjagt9nDR5ZKLvwmllOE0bKxy-xbnOAd4q~m7NFDuln7cIJIc5tMsa7T0VbpFrtyskcjIe0DnrTQS4AQVc0JUZMxvYMp9Q__&Key-Pair-Id=K1ZMSF1EKC3AZL [341294/341294] -> "riclibe2ap_1.1.0_amd64.deb" [1] + sudo dpkg -i riclibe2ap_1.1.0_amd64.deb Selecting previously unselected package riclibe2ap. (Reading database ... 198621 files and directories currently installed.) Preparing to unpack riclibe2ap_1.1.0_amd64.deb ... Unpacking riclibe2ap (1.1.0) ... Setting up riclibe2ap (1.1.0) ... + rm -f riclibe2ap_1.1.0_amd64.deb + for deb in "riclibe2ap_${ver}_amd64.deb" "riclibe2ap-dev_${ver}_amd64.deb" + wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/riclibe2ap-dev_1.1.0_amd64.deb/download.deb 2023-12-28 04:00:27 URL:https://d3fo0g5hm7lbuv.cloudfront.net/20756/10598/debian/package_files/2517359.deb?Expires=1703736327&Signature=bpa0OLAoxZSkUlGRdxoQu7zuMKm7mgy3cY8NN81qqaai9GtQqOBLwM5k18bDGTyBw8cPeV~yjM61mKZndb3dBzbhFrq6meRhbUAAZxhEVmpdQs1OzOWop1FHjIiWa7iZVhmXk5CT1bJil8OW1TAThJgaiT5g4CKe6~UewQnPjsSf5OODWJsuKsKBGEfBZBm2QgsTaoXwCKHsapqoiVyKnMHPk1je9Kcn9f~KdD6RQkv2vuWY2PF-7FzM3YEfIr49ScoNKt4cTy70OmX5WAdZlX3DO4D69dMmr8AhuFpH-iEmGE4qmMJIc7YJKtMR7st7mmebgf8sXpoGn-Ar6cmS4A__&Key-Pair-Id=K1ZMSF1EKC3AZL [823070/823070] -> "riclibe2ap-dev_1.1.0_amd64.deb" [1] + sudo dpkg -i riclibe2ap-dev_1.1.0_amd64.deb Selecting previously unselected package riclibe2ap-dev. (Reading database ... 198624 files and directories currently installed.) Preparing to unpack riclibe2ap-dev_1.1.0_amd64.deb ... Unpacking riclibe2ap-dev (1.1.0) ... Setting up riclibe2ap-dev (1.1.0) ... + rm -f riclibe2ap-dev_1.1.0_amd64.deb + echo '---> install-deb-e2ap.sh ends' ---> install-deb-e2ap.sh ends [EnvInject] - Injecting environment variables from a build step. [EnvInject] - Injecting as environment variables the properties content PARALLEL=False [EnvInject] - Variables injected successfully. [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash -l /tmp/jenkins15736338701309751592.sh ---> tox-run.sh + PATH=/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + ARCHIVE_TOX_DIR=/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/archives/tox + ARCHIVE_DOC_DIR=/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/archives/docs + mkdir -p /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/archives/tox + cd /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/. + source /home/jenkins/lf-env.sh + lf-activate-venv --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 ++ mktemp -d /tmp/venv-XXXX + lf_venv=/tmp/venv-UCaD + local venv_file=/tmp/.os_lf_venv + local python=python3 + local options + local set_path=true + local install_args= ++ getopt -o np:v: -l no-path,system-site-packages,python:,venv-file: -n lf-activate-venv -- --venv-file /tmp/.toxenv tox virtualenv urllib3~=1.26.15 + options=' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' + eval set -- ' --venv-file '\''/tmp/.toxenv'\'' -- '\''tox'\'' '\''virtualenv'\'' '\''urllib3~=1.26.15'\''' ++ set -- --venv-file /tmp/.toxenv -- tox virtualenv urllib3~=1.26.15 + true + case $1 in + venv_file=/tmp/.toxenv + shift 2 + true + case $1 in + shift + break + case $python in + local pkg_list= + [[ -d /opt/pyenv ]] + echo 'Setup pyenv:' Setup pyenv: + export PYENV_ROOT=/opt/pyenv + PYENV_ROOT=/opt/pyenv + export PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + pyenv versions system 3.8.13 3.9.13 * 3.10.6 (set by /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.python-version) + command -v pyenv ++ pyenv init - --no-rehash + eval 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "'\''/opt/pyenv/shims'\''" ]]; then unset '\''\'\'''\''paths[i]'\''\'\'''\''; fi; done; echo "${paths[*]}"'\'')" export PATH="/opt/pyenv/shims:${PATH}" export PYENV_SHELL=bash source '\''/opt/pyenv/libexec/../completions/pyenv.bash'\'' pyenv() { local command command="${1:-}" if [ "$#" -gt 0 ]; then shift fi case "$command" in rehash|shell) eval "$(pyenv "sh-$command" "$@")" ;; *) command pyenv "$command" "$@" ;; esac }' +++ bash --norc -ec 'IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "/opt/pyenv/shims" ]]; then unset '\''paths[i]'\''; fi; done; echo "${paths[*]}"' ++ PATH=/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin ++ export PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin ++ PATH=/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin ++ export PYENV_SHELL=bash ++ PYENV_SHELL=bash ++ source /opt/pyenv/libexec/../completions/pyenv.bash +++ complete -F _pyenv pyenv ++ lf-pyver python3 ++ local py_version_xy=python3 ++ local py_version_xyz= ++ pyenv versions ++ local command ++ command=versions ++ '[' 1 -gt 0 ']' ++ shift ++ case "$command" in ++ command pyenv versions ++ pyenv versions ++ grep -E '^[0-9.]*[0-9]$' ++ sed 's/^[ *]* //' ++ awk '{ print $1 }' ++ [[ ! -s /tmp/.pyenv_versions ]] +++ grep '^3' /tmp/.pyenv_versions +++ tail -n 1 +++ sort -V ++ py_version_xyz=3.10.6 ++ [[ -z 3.10.6 ]] ++ echo 3.10.6 ++ return 0 + pyenv local 3.10.6 + local command + command=local + '[' 2 -gt 0 ']' + shift + case "$command" in + command pyenv local 3.10.6 + pyenv local 3.10.6 + for arg in "$@" + case $arg in + pkg_list+='tox ' + for arg in "$@" + case $arg in + pkg_list+='virtualenv ' + for arg in "$@" + case $arg in + pkg_list+='urllib3~=1.26.15 ' + [[ -f /tmp/.toxenv ]] ++ cat /tmp/.toxenv + lf_venv=/tmp/venv-5Mha + echo 'lf-activate-venv(): INFO: Reuse venv:/tmp/venv-5Mha from' file:/tmp/.toxenv lf-activate-venv(): INFO: Reuse venv:/tmp/venv-5Mha from file:/tmp/.toxenv + /tmp/venv-5Mha/bin/python3 -m pip install --upgrade --quiet pip virtualenv + [[ -z tox virtualenv urllib3~=1.26.15 ]] + echo 'lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 ' lf-activate-venv(): INFO: Installing: tox virtualenv urllib3~=1.26.15 + /tmp/venv-5Mha/bin/python3 -m pip install --upgrade --quiet --upgrade-strategy eager tox virtualenv urllib3~=1.26.15 + type python3 + true + echo 'lf-activate-venv(): INFO: Adding /tmp/venv-5Mha/bin to PATH' lf-activate-venv(): INFO: Adding /tmp/venv-5Mha/bin to PATH + PATH=/tmp/venv-5Mha/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + return 0 + [[ -d /opt/pyenv ]] + echo '---> Setting up pyenv' ---> Setting up pyenv + export PYENV_ROOT=/opt/pyenv + PYENV_ROOT=/opt/pyenv + export PATH=/opt/pyenv/bin:/tmp/venv-5Mha/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin + PATH=/opt/pyenv/bin:/tmp/venv-5Mha/bin:/opt/pyenv/shims:/opt/pyenv/bin:/home/jenkins/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/puppetlabs/bin ++ pwd + PYTHONPATH=/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master + export PYTHONPATH + export TOX_TESTENV_PASSENV=PYTHONPATH + TOX_TESTENV_PASSENV=PYTHONPATH + tox --version 4.11.4 from /tmp/venv-5Mha/lib/python3.10/site-packages/tox/__init__.py + PARALLEL=False + TOX_OPTIONS_LIST= + [[ -n code,flake8 ]] + TOX_OPTIONS_LIST=' -e code,flake8' + case ${PARALLEL,,} in + tee -a /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/archives/tox/tox.log + tox -e code,flake8 code: install_deps> python -I -m pip install coverage pytest pytest-cov six .pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel .pkg: _optional_hooks> python /tmp/venv-5Mha/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_sdist> python /tmp/venv-5Mha/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_wheel> python /tmp/venv-5Mha/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: install_requires_for_build_wheel> python -I -m pip install wheel .pkg: freeze> python -m pip freeze --all .pkg: pip==23.3.1,setuptools==69.0.2,wheel==0.42.0 .pkg: prepare_metadata_for_build_wheel> python /tmp/venv-5Mha/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: build_sdist> python /tmp/venv-5Mha/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ code: install_package_deps> python -I -m pip install inotify inotify-simple mdclogpy msgpack 'protobuf<3.21.0' requests 'ricsdl<4.0.0,>=3.0.0' code: install_package> python -I -m pip install --force-reinstall --no-deps /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.tox/.tmp/package/1/ricxappframe-3.2.2.tar.gz code: freeze> python -m pip freeze --all code: async-timeout==4.0.3,certifi==2023.11.17,charset-normalizer==3.3.2,coverage==7.3.4,exceptiongroup==1.2.0,hiredis==2.0.0,idna==3.6,iniconfig==2.0.0,inotify==0.2.10,inotify-simple==1.3.5,mdclogpy==1.1.4,msgpack==1.0.7,nose==1.3.7,packaging==23.2,pip==23.3.1,pluggy==1.3.0,protobuf==3.20.3,pytest==7.4.3,pytest-cov==4.1.0,redis==4.3.6,requests==2.31.0,ricsdl==3.1.3,ricxappframe @ file:///w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.tox/.tmp/package/1/ricxappframe-3.2.2.tar.gz#sha256=29f3253066e75dc01e8ce24bb46d98f4d2674231160a469f38acd5b25a02e918,setuptools==69.0.2,six==1.16.0,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 code: commands[0]> pytest --cov ricxappframe --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml ============================= test session starts ============================== platform linux -- Python 3.10.6, pytest-7.4.3, pluggy-1.3.0 cachedir: .tox/code/.pytest_cache rootdir: /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master plugins: cov-4.1.0 collected 75 items tests/test_Logger.py .............. [ 18%] tests/test_alarm.py .. [ 21%] tests/test_config.py FFF [ 25%] tests/test_e2ap.py ........ [ 36%] tests/test_init.py .F1703736246131 28073/RMR [INFO] sends: ts=1703736246 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736246131 28073/RMR [INFO] sends: ts=1703736246 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736246131 28073/RMR [INFO] sends: ts=1703736246 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736246131 28073/RMR [INFO] sends: ts=1703736246 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) F [ 40%] tests/test_metric.py .. [ 42%] tests/test_rest.py . [ 44%] tests/test_rmr.py 1703736253714 28073/RMR [INFO] sends: ts=1703736253 src=prd-ubuntu1804-builder-2c-2g-2154:3564 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736253714 28073/RMR [INFO] sends: ts=1703736253 src=prd-ubuntu1804-builder-2c-2g-2154:3564 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736253714 28073/RMR [INFO] sends: ts=1703736253 src=prd-ubuntu1804-builder-2c-2g-2154:3564 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736253714 28073/RMR [INFO] sends: ts=1703736253 src=prd-ubuntu1804-builder-2c-2g-2154:3564 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ............. [ 61%] tests/test_rmr_mocks.py ... [ 65%] tests/test_rmrclib.py .. [ 68%] tests/test_sdl.py ..... [ 74%] tests/test_subscribe.py .... [ 80%] tests/test_symptomdata.py .... [ 85%] tests/test_xapps.py FFFFFFFFFFF [100%] =================================== FAILURES =================================== ______________________________ test_config_no_env ______________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac994d8610> def test_config_no_env(monkeypatch): init_config_file() monkeypatch.delenv(Constants.CONFIG_FILE_ENV, raising=False) def default_rmr_handler(self, summary, sbuf): pass config_event_seen = False def config_handler(self, json): nonlocal config_event_seen config_event_seen = True global rmr_xapp_noconfig rmr_xapp_noconfig = RMRXapp(default_rmr_handler, config_handler=config_handler, rmr_port=4652, use_fake_sdl=True) # in unit tests we need to thread here or else execution is not returned! rmr_xapp_noconfig.run(thread=True, rmr_timeout=1) write_config_file() # give the work loop a chance to timeout on RMR and process the config event time.sleep(3) assert not config_event_seen > rmr_xapp_noconfig.stop() tests/test_config.py:66: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:965: in stop super().stop() ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736052490, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 1703736053488 28073/RMR [INFO] sends: ts=1703736053 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736053488 28073/RMR [INFO] sends: ts=1703736053 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736053488 28073/RMR [INFO] sends: ts=1703736053 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736053488 28073/RMR [INFO] sends: ts=1703736053 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736084492 28073/RMR [INFO] sends: ts=1703736084 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736084492 28073/RMR [INFO] sends: ts=1703736084 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736084492 28073/RMR [INFO] sends: ts=1703736084 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736084492 28073/RMR [INFO] sends: ts=1703736084 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister _________________________ test_default_config_handler __________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac9061a7d0> def test_default_config_handler(monkeypatch): """Just for coverage""" init_config_file() monkeypatch.setenv(Constants.CONFIG_FILE_ENV, config_file_path) def default_rmr_handler(self, summary, sbuf): pass # listen port is irrelevant, no messages arrive global rmr_xapp_defconfig rmr_xapp_defconfig = RMRXapp(default_rmr_handler, rmr_port=4567, use_fake_sdl=True) # in unit tests we need to thread here or else execution is not returned! rmr_xapp_defconfig.run(thread=True, rmr_timeout=1) write_config_file() # give the work loop a chance to timeout on RMR and process the config event time.sleep(3) > rmr_xapp_defconfig.stop() tests/test_config.py:86: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:965: in stop super().stop() ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stderr call ----------------------------- 1703736087029 28073/RMR [INFO] sends: ts=1703736087 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736087030 28073/RMR [INFO] sends: ts=1703736087 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736087030 28073/RMR [INFO] sends: ts=1703736087 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736087030 28073/RMR [INFO] sends: ts=1703736087 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736115495 28073/RMR [INFO] sends: ts=1703736115 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736115495 28073/RMR [INFO] sends: ts=1703736115 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736115495 28073/RMR [INFO] sends: ts=1703736115 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736115495 28073/RMR [INFO] sends: ts=1703736115 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736118033 28073/RMR [INFO] sends: ts=1703736118 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736118033 28073/RMR [INFO] sends: ts=1703736118 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736118033 28073/RMR [INFO] sends: ts=1703736118 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736118033 28073/RMR [INFO] sends: ts=1703736118 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister __________________________ test_custom_config_handler __________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fac9a0615d0> def test_custom_config_handler(monkeypatch): # point watcher at the file init_config_file() monkeypatch.setenv(Constants.CONFIG_FILE_ENV, config_file_path) def default_handler(self, summary, sbuf): pass startup_config_event = False change_config_event = False def config_handler(self, json): mdc_logger.info("config_handler: json {}".format(json)) nonlocal startup_config_event nonlocal change_config_event if "start" in json: startup_config_event = True if "change" in json: change_config_event = True # listen port is irrelevant, no messages arrive global rmr_xapp_config rmr_xapp_config = RMRXapp(default_handler, config_handler=config_handler, rmr_port=4567, use_fake_sdl=True) assert startup_config_event rmr_xapp_config.run(thread=True, rmr_timeout=1) # in unit tests we need to thread here or else execution is not returned! write_config_file() # give the work loop a chance to timeout on RMR and process the config event time.sleep(3) assert change_config_event > rmr_xapp_config.stop() tests/test_config.py:119: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:965: in stop super().stop() ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stderr call ----------------------------- 1703736120552 28073/RMR [INFO] sends: ts=1703736120 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736120553 28073/RMR [INFO] sends: ts=1703736120 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736120553 28073/RMR [INFO] sends: ts=1703736120 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736120553 28073/RMR [INFO] sends: ts=1703736120 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736146498 28073/RMR [INFO] sends: ts=1703736146 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736146498 28073/RMR [INFO] sends: ts=1703736146 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736146498 28073/RMR [INFO] sends: ts=1703736146 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736146498 28073/RMR [INFO] sends: ts=1703736146 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736149036 28073/RMR [INFO] sends: ts=1703736149 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736149036 28073/RMR [INFO] sends: ts=1703736149 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736149036 28073/RMR [INFO] sends: ts=1703736149 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736149036 28073/RMR [INFO] sends: ts=1703736149 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736151556 28073/RMR [INFO] sends: ts=1703736151 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736151556 28073/RMR [INFO] sends: ts=1703736151 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736151556 28073/RMR [INFO] sends: ts=1703736151 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736151556 28073/RMR [INFO] sends: ts=1703736151 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister --------------------------- Captured stderr teardown --------------------------- 1703736177501 28073/RMR [INFO] sends: ts=1703736177 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736177501 28073/RMR [INFO] sends: ts=1703736177 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736177501 28073/RMR [INFO] sends: ts=1703736177 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736177501 28073/RMR [INFO] sends: ts=1703736177 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736180039 28073/RMR [INFO] sends: ts=1703736180 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736180040 28073/RMR [INFO] sends: ts=1703736180 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736180040 28073/RMR [INFO] sends: ts=1703736180 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736180040 28073/RMR [INFO] sends: ts=1703736180 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736182559 28073/RMR [INFO] sends: ts=1703736182 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736182560 28073/RMR [INFO] sends: ts=1703736182 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736182560 28073/RMR [INFO] sends: ts=1703736182 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736182560 28073/RMR [INFO] sends: ts=1703736182 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ---------------------------- Captured log teardown ----------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ____________________________ test_init_general_xapp ____________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: def test_init_general_xapp(): def entry(self): # normally we would have some kind of loop here print("bye") gen_xapp = Xapp(xapp_ready_cb=entry, rmr_wait_for_ready=False, use_fake_sdl=True) gen_xapp.run() time.sleep(1) > gen_xapp.stop() # pytest will never return without this. tests/test_init.py:49: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736183125, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} bye ----------------------------- Captured stderr call ----------------------------- 1703736184125 28073/RMR [INFO] sends: ts=1703736184 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736184125 28073/RMR [INFO] sends: ts=1703736184 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736184125 28073/RMR [INFO] sends: ts=1703736184 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736184125 28073/RMR [INFO] sends: ts=1703736184 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736208505 28073/RMR [INFO] sends: ts=1703736208 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736208505 28073/RMR [INFO] sends: ts=1703736208 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736208505 28073/RMR [INFO] sends: ts=1703736208 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736208505 28073/RMR [INFO] sends: ts=1703736208 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736211043 28073/RMR [INFO] sends: ts=1703736211 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736211043 28073/RMR [INFO] sends: ts=1703736211 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736211043 28073/RMR [INFO] sends: ts=1703736211 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736211043 28073/RMR [INFO] sends: ts=1703736211 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736213564 28073/RMR [INFO] sends: ts=1703736213 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736213564 28073/RMR [INFO] sends: ts=1703736213 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736213564 28073/RMR [INFO] sends: ts=1703736213 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736213564 28073/RMR [INFO] sends: ts=1703736213 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ______________________________ test_init_rmr_xapp ______________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: def test_init_rmr_xapp(): def post_init(self): print("hey") def foo(self, _summary, _sbuf): pass rmr_xapp = RMRXapp(foo, post_init=post_init, rmr_wait_for_ready=False, use_fake_sdl=True) # pytest will never return without thread and stop rmr_xapp.run(thread=True) time.sleep(1) > rmr_xapp.stop() tests/test_init.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:965: in stop super().stop() ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736214693, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} hey ----------------------------- Captured stderr call ----------------------------- 1703736215128 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736215128 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736215128 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736215128 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736215704 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736215704 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736215704 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736215704 28073/RMR [INFO] sends: ts=1703736215 src=prd-ubuntu1804-builder-2c-2g-2154:4562 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736239510 28073/RMR [INFO] sends: ts=1703736239 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736239510 28073/RMR [INFO] sends: ts=1703736239 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736239510 28073/RMR [INFO] sends: ts=1703736239 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736239510 28073/RMR [INFO] sends: ts=1703736239 src=prd-ubuntu1804-builder-2c-2g-2154:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736242046 28073/RMR [INFO] sends: ts=1703736242 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736242046 28073/RMR [INFO] sends: ts=1703736242 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736242046 28073/RMR [INFO] sends: ts=1703736242 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736242046 28073/RMR [INFO] sends: ts=1703736242 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736244568 28073/RMR [INFO] sends: ts=1703736244 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736244568 28073/RMR [INFO] sends: ts=1703736244 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736244568 28073/RMR [INFO] sends: ts=1703736244 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703736244568 28073/RMR [INFO] sends: ts=1703736244 src=prd-ubuntu1804-builder-2c-2g-2154:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ________________________________ test_rmr_init _________________________________ def test_rmr_init(): # test variables def_pay = None sixty_pay = None # create rmr app def default_handler(self, summary, sbuf): nonlocal def_pay def_pay = json.loads(summary["payload"]) self.rmr_free(sbuf) def sixtythou_handler(self, summary, sbuf): nonlocal sixty_pay sixty_pay = json.loads(summary["payload"]) self.rmr_free(sbuf) global rmr_xapp rmr_xapp = RMRXapp(default_handler, rmr_port=4564, use_fake_sdl=True) rmr_xapp.register_callback(sixtythou_handler, 60000) rmr_xapp.run(thread=True) # in unit tests we need to thread here or else execution is not returned! time.sleep(1) # create a general xapp that will demonstrate some SDL functionality and launch some requests against the rmr xapp def entry(self): time.sleep(1) self.sdl_set("testns", "mykey", 6) assert self.sdl_get("testns", "mykey") == 6 assert self.sdl_find_and_get("testns", "myk") == {"mykey": 6} assert self.healthcheck() val = json.dumps({"test send 60000": 1}).encode() self.rmr_send(val, 60000) val = json.dumps({"test send 60001": 2}).encode() self.rmr_send(val, 60001) self.sdl_delete("testns", "bogus") global gen_xapp > gen_xapp = Xapp(entrypoint=entry, use_fake_sdl=True) E TypeError: Xapp.__init__() got an unexpected keyword argument 'entrypoint' tests/test_xapps.py:78: TypeError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736261669, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} _____________________________ test_rmr_healthcheck _____________________________ def test_rmr_healthcheck(): # thanos uses the rmr xapp to healthcheck the rmr xapp # test variables health_pay = None def post_init(self): self.rmr_send(b"", Constants.RIC_HEALTH_CHECK_REQ) def default_handler(self, summary, sbuf): pass global rmr_xapp_health rmr_xapp_health = RMRXapp(default_handler, post_init=post_init, rmr_port=4666, use_fake_sdl=True) def health_handler(self, summary, sbuf): nonlocal health_pay health_pay = summary["payload"] self.rmr_free(sbuf) rmr_xapp_health.register_callback(health_handler, Constants.RIC_HEALTH_CHECK_RESP) rmr_xapp_health.run(thread=True) # in unit tests we need to thread here or else execution is not returned! time.sleep(1) > assert health_pay == b"OK\n" E AssertionError: assert None == b'OK\n' tests/test_xapps.py:112: AssertionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736262694, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ___________________________ test_rnib_get_list_nodeb ___________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_information = [b'\n\nnodeb_5678\x12\x14\n\tplmn_5678\x12\x07nb_5678\x18\x06', b''] def test_rnib_get_list_nodeb(rnib_information): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) # Test there is no rnib information. gnb_list = rnib_xapp.get_list_gnb_ids() enb_list = rnib_xapp.get_list_enb_ids() assert len(gnb_list) == 0 assert len(enb_list) == 0 # Add rnib information directly. for rnib in rnib_information: rnib_xapp.sdl.add_member(sdl_namespaces.E2_MANAGER, "ENB", rnib, usemsgpack=False) rnib_xapp.sdl.add_member(sdl_namespaces.E2_MANAGER, "GNB", rnib, usemsgpack=False) gnb_list = rnib_xapp.get_list_gnb_ids() assert len(gnb_list) == len(rnib_information) for gnb in gnb_list: assert gnb.SerializeToString() in rnib_information enb_list = rnib_xapp.get_list_enb_ids() assert len(enb_list) == len(rnib_information) for enb in enb_list: assert enb.SerializeToString() in rnib_information > rnib_xapp.stop() tests/test_xapps.py:140: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736263720, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:23,725 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:25,731 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:29,742 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:37,752 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:53,768 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister _________________________ test_rnib_get_list_all_nodeb _________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_information = [b'\n\nnodeb_5678\x12\x14\n\tplmn_5678\x12\x07nb_5678\x18\x06', b''] def test_rnib_get_list_all_nodeb(rnib_information): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) # Add rnib information directly. for rnib in rnib_information: rnib_xapp.sdl.add_member(sdl_namespaces.E2_MANAGER, "GNB", rnib, usemsgpack=False) nb_list = rnib_xapp.GetListNodebIds() assert len(nb_list) == 2 for rnib in rnib_information: rnib_xapp.sdl.add_member(sdl_namespaces.E2_MANAGER, "ENB", rnib, usemsgpack=False) nb_list = rnib_xapp.GetListNodebIds() assert len(nb_list) == 4 > rnib_xapp.stop() tests/test_xapps.py:160: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736294260, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:54,267 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:04:56,273 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:00,283 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:08,291 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,303 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ___________________________ test_rnib_get_list_cells ___________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_cellinformation = [b'\x08\x01', b'\x08\x01'] def test_rnib_get_list_cells(rnib_cellinformation): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) mynb = pb_nb.NbIdentity() mynb.inventory_name = "nodeb_1234" mynb.global_nb_id.plmn_id = "plmn_1234" mynb.global_nb_id.nb_id = "nb_1234" mynb.connection_status = 1 rnib_xapp.sdl.add_member(sdl_namespaces.E2_MANAGER, "ENB", mynb.SerializeToString(), usemsgpack=False) # Add rnib information directly. for rnib in rnib_cellinformation: rnib_xapp.sdl.add_member(sdl_namespaces.E2_MANAGER, "ENBCELL1", rnib, usemsgpack=False) rnib_xapp.sdl.add_member(sdl_namespaces.E2_MANAGER, "ENBCELL2", rnib, usemsgpack=False) > rnib_xapp.stop() tests/test_xapps.py:179: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ---------------------------- Captured stdout setup ----------------------------- ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736324757, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:24,762 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:26,768 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:30,778 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:38,792 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:54,810 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister _____________________________ test_rnib_get_nodeb ______________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_helpers = def test_rnib_get_nodeb(rnib_helpers): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) nb1 = rnib_helpers.createNodebInfo('nodeb_1234', 'GNB', '192.168.1.1', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1234', nb1.SerializeToString(), usemsgpack=False) nb2 = rnib_helpers.createNodebInfo('nodeb_1234', 'ENB', '192.168.1.2', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1235', nb2.SerializeToString(), usemsgpack=False) gnb = rnib_xapp.GetNodeb('nodeb_1235') assert gnb == nb2 gnb = rnib_xapp.GetNodeb('nodeb_1234') assert gnb == nb1 gnb = rnib_xapp.GetNodeb('nodeb_1230') assert gnb is None > rnib_xapp.stop() tests/test_xapps.py:196: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736355286, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:55,290 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:05:57,297 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:01,308 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:09,321 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,335 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ______________________________ test_rnib_get_cell ______________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_helpers = def test_rnib_get_cell(rnib_helpers): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) c1 = rnib_helpers.createCell('c1234', 8) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "PCI:c1234:08", c1.SerializeToString(), usemsgpack=False) c2 = rnib_helpers.createCell('c1235', 11) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "PCI:c1235:0b", c2.SerializeToString(), usemsgpack=False) cell = rnib_xapp.GetCell('c1235', 11) assert cell == c2 cell = rnib_xapp.GetCell('c1234', 8) assert cell == c1 cell = rnib_xapp.GetCell('c1236', 11) assert cell is None > rnib_xapp.stop() tests/test_xapps.py:213: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736385797, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:25,803 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:27,809 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:31,818 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:39,830 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:55,839 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ___________________________ test_rnib_get_cell_by_id ___________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_helpers = def test_rnib_get_cell_by_id(rnib_helpers): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) c1 = rnib_helpers.createCell('c1234', 8) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "CELL:c1234", c1.SerializeToString(), usemsgpack=False) c2 = rnib_helpers.createCell('c1235', 11) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "CELL:c1235", c2.SerializeToString(), usemsgpack=False) cell = rnib_xapp.GetCellById('LTE_CELL', 'c1235') assert cell == c2 cell = rnib_xapp.GetCellById('LTE_CELL', 'c1234') assert cell == c1 cell = rnib_xapp.GetCellById('LTE_CELL', 'c1236') assert cell is None > rnib_xapp.stop() tests/test_xapps.py:230: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736416299, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:56,305 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:06:58,311 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:02,319 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:10,327 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,346 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister _____________________________ test_rnib_get_cells ______________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_helpers = def test_rnib_get_cells(rnib_helpers): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) nb1 = rnib_helpers.createNodebInfo('nodeb_1234', 'GNB', '192.168.1.1', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1234', nb1.SerializeToString(), usemsgpack=False) nb2 = rnib_helpers.createNodebInfo('nodeb_1234', 'ENB', '192.168.1.2', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1235', nb2.SerializeToString(), usemsgpack=False) sc = rnib_xapp.GetCellList('nodeb_1235') assert sc == nb2.enb.served_cells sc = rnib_xapp.GetCellList('nodeb_1234') assert sc == nb1.gnb.served_nr_cells sc = rnib_xapp.GetCellList('nodeb_1230') assert sc is None > rnib_xapp.stop() tests/test_xapps.py:247: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736446818, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:26,823 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:28,831 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:32,839 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:40,853 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:56,868 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister __________________________ test_rnib_get_global_nodeb __________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_helpers = def test_rnib_get_global_nodeb(rnib_helpers): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) nb1 = rnib_helpers.createNodeb('nodeb_1234', '358', 'nb_1234') rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "GNB:" + '358:' + 'nodeb_1234', nb1.SerializeToString(), usemsgpack=False) nb2 = rnib_helpers.createNodeb('nodeb_1235', '356', 'nb_1235') rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "GNB:" + '356:' + 'nodeb_1235', nb2.SerializeToString(), usemsgpack=False) gnb = rnib_xapp.GetNodebByGlobalNbId('GNB', '356', 'nodeb_1235') assert gnb == nb2 gnb = rnib_xapp.GetNodebByGlobalNbId('GNB', '358', 'nodeb_1234') assert gnb == nb1 gnb = rnib_xapp.GetNodebByGlobalNbId('GNB', '356', 'nodeb_1230') assert gnb is None > rnib_xapp.stop() tests/test_xapps.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736477311, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:57,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:07:59,321 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:03,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:11,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,356 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister __________________________ test_rnib_get_ranfunction ___________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: rnib_helpers = def test_rnib_get_ranfunction(rnib_helpers): global rnib_xapp rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) nb1 = rnib_helpers.createNodebInfo('nodeb_1234', 'GNB', '192.168.1.1', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1234', nb1.SerializeToString(), usemsgpack=False) nb2 = rnib_helpers.createNodebInfo('nodeb_1235', 'GNB', '192.168.1.2', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1235', nb2.SerializeToString(), usemsgpack=False) nb3 = rnib_helpers.createNodebInfo('nodeb_1236', 'GNB', '192.168.1.2', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1236', nb3.SerializeToString(), usemsgpack=False) nb4 = rnib_helpers.createNodebInfo('nodeb_1237', 'GNB', '192.168.1.2', 8088) rnib_xapp.sdl.set(sdl_namespaces.E2_MANAGER, "RAN:" + 'nodeb_1237', nb4.SerializeToString(), usemsgpack=False) sc = rnib_xapp.GetRanFunctionDefinition('nodeb_1235', "1.3.6.1.4.1.1.2.2.2") assert sc == ['te524367153'] sc = rnib_xapp.GetRanFunctionDefinition('nodeb_1235', "1.3.6.1.4.1.1.2.2.5") assert sc == [] > rnib_xapp.stop() tests/test_xapps.py:283: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:793: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:268: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:245: in deregister self._do_post(dereg_url, request_string) ricxappframe/xapp_frame.py:179: in _do_post resp = session.post(url, msg) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stdout call ----------------------------- {"ts": 1703736507812, "crit": "ERROR", "id": "ricxappframe.xapp_frame", "mdc": {}, "msg": "__init__: Cannot Read config file for xapp Registration"} ----------------------------- Captured stderr call ----------------------------- 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:27,816 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:29,821 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:33,831 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:41,845 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:57,863 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister --------------------------- Captured stderr teardown --------------------------- 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:08:58,316 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:00,323 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:04,331 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:12,339 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,359 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:28,373 WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:30,379 WARNING Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:34,390 WARNING Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:42,400 WARNING Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister 2023-12-28 04:09:58,418 WARNING Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ---------------------------- Captured log teardown ----------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister =============================== warnings summary =============================== tests/test_config.py::test_custom_config_handler /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.tox/code/lib/python3.10/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-6 (loop) Traceback (most recent call last): File "/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/ricxappframe/xapp_frame.py", line 948, in loop with open(self._config_path) as json_file: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/file.json' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/pyenv/versions/3.10.6/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/opt/pyenv/versions/3.10.6/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/ricxappframe/xapp_frame.py", line 954, in loop raise XappError(f"Error occurred during polling configuration handler: {error}") ricxappframe.xapp_frame.XappError: Error occurred during polling configuration handler: [Errno 2] No such file or directory: '/tmp/file.json' warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg)) tests/test_init.py::test_init_general_xapp /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.tox/code/lib/python3.10/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8 (register) Traceback (most recent call last): File "/opt/pyenv/versions/3.10.6/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/opt/pyenv/versions/3.10.6/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/ricxappframe/xapp_frame.py", line 203, in register raise XappError("Couldn't resolve service endpoints: empty http_endpoint or rmr_endpoint") ricxappframe.xapp_frame.XappError: Couldn't resolve service endpoints: empty http_endpoint or rmr_endpoint warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg)) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ---------------------- generated xml file: /tmp/tests.xml ---------------------- ---------- coverage: platform linux, python 3.10.6-final-0 ----------- Name Stmts Miss Cover Missing ----------------------------------------------------------------------- ricxappframe/__init__.py 0 0 100% ricxappframe/alarm/__init__.py 0 0 100% ricxappframe/alarm/alarm.py 94 2 98% 250-251 ricxappframe/alarm/exceptions.py 2 0 100% ricxappframe/constants.py 5 0 100% ricxappframe/e2ap/__init__.py 0 0 100% ricxappframe/e2ap/asn1.py 224 0 100% ricxappframe/e2ap/asn1clib/__init__.py 0 0 100% ricxappframe/e2ap/asn1clib/asn1clib.py 2 0 100% ricxappframe/e2ap/asn1clib/types.py 16 0 100% ricxappframe/logger/__init__.py 0 0 100% ricxappframe/logger/mdclogger.py 133 22 83% 83-87, 95, 188-189, 196, 198, 200, 202, 220-224, 227-234 ricxappframe/metric/__init__.py 0 0 100% ricxappframe/metric/exceptions.py 2 0 100% ricxappframe/metric/metric.py 58 3 95% 122, 201-202 ricxappframe/rmr/__init__.py 0 0 100% ricxappframe/rmr/exceptions.py 4 0 100% ricxappframe/rmr/helpers.py 28 0 100% ricxappframe/rmr/rmr.py 156 3 98% 257, 454, 544 ricxappframe/rmr/rmr_mocks/__init__.py 0 0 100% ricxappframe/rmr/rmr_mocks/rmr_mocks.py 78 6 92% 39, 59, 79, 115, 133, 148 ricxappframe/rmr/rmrclib/__init__.py 0 0 100% ricxappframe/rmr/rmrclib/rmrclib.py 38 1 97% 53 ricxappframe/util/__init__.py 0 0 100% ricxappframe/util/constants.py 11 0 100% ricxappframe/xapp_frame.py 278 57 79% 147-152, 181-184, 205-224, 247-251, 262, 269-270, 282-284, 313-314, 339-345, 388, 447, 463, 658-659, 747, 753, 791, 795, 866-869, 935-939, 959, 966-967 ricxappframe/xapp_rest.py 91 12 87% 66, 72-74, 131-132, 142-143, 155-156, 191-193 ricxappframe/xapp_rmr.py 45 14 69% 90, 94-95, 108-114, 127, 131-133 ricxappframe/xapp_sdl.py 94 2 98% 53, 655 ricxappframe/xapp_subscribe.py 54 3 94% 64, 103, 171 ricxappframe/xapp_symptomdata.py 119 20 83% 43, 111-116, 152, 154-156, 160-161, 200-201, 221-224, 228 ----------------------------------------------------------------------- TOTAL 1532 145 91% Coverage HTML written to dir htmlcov Coverage XML written to file coverage.xml Required test coverage of 70% reached. Total coverage: 90.54% =========================== short test summary info ============================ FAILED tests/test_config.py::test_config_no_env - requests.exceptions.Connect... FAILED tests/test_config.py::test_default_config_handler - requests.exception... FAILED tests/test_config.py::test_custom_config_handler - requests.exceptions... FAILED tests/test_init.py::test_init_general_xapp - requests.exceptions.Conne... FAILED tests/test_init.py::test_init_rmr_xapp - requests.exceptions.Connectio... FAILED tests/test_xapps.py::test_rmr_init - TypeError: Xapp.__init__() got an... FAILED tests/test_xapps.py::test_rmr_healthcheck - AssertionError: assert Non... FAILED tests/test_xapps.py::test_rnib_get_list_nodeb - requests.exceptions.Co... FAILED tests/test_xapps.py::test_rnib_get_list_all_nodeb - requests.exception... FAILED tests/test_xapps.py::test_rnib_get_list_cells - requests.exceptions.Co... FAILED tests/test_xapps.py::test_rnib_get_nodeb - requests.exceptions.Connect... FAILED tests/test_xapps.py::test_rnib_get_cell - requests.exceptions.Connecti... FAILED tests/test_xapps.py::test_rnib_get_cell_by_id - requests.exceptions.Co... FAILED tests/test_xapps.py::test_rnib_get_cells - requests.exceptions.Connect... FAILED tests/test_xapps.py::test_rnib_get_global_nodeb - requests.exceptions.... FAILED tests/test_xapps.py::test_rnib_get_ranfunction - requests.exceptions.C... ============ 16 failed, 59 passed, 2 warnings in 552.57s (0:09:12) ============= Build timed out (after 15 minutes). Marking the build as failed. $ ssh-agent -k unset SSH_AUTH_SOCK; unset SSH_AGENT_PID; echo Agent pid 5748 killed; [ssh-agent] Stopped. Build was aborted [PostBuildScript] - [INFO] Executing post build scripts. [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins17894047958619340014.sh ---> sysstat.sh [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins3950564360146978411.sh ---> package-listing.sh ++ facter osfamily ++ tr '[:upper:]' '[:lower:]' + OS_FAMILY=debian + workspace=/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master + START_PACKAGES=/tmp/packages_start.txt + END_PACKAGES=/tmp/packages_end.txt + DIFF_PACKAGES=/tmp/packages_diff.txt + PACKAGES=/tmp/packages_start.txt + '[' /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master ']' + PACKAGES=/tmp/packages_end.txt + case "${OS_FAMILY}" in + dpkg -l + grep '^ii' + '[' -f /tmp/packages_start.txt ']' + '[' -f /tmp/packages_end.txt ']' + diff /tmp/packages_start.txt /tmp/packages_end.txt + true + '[' /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master ']' + mkdir -p /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/archives/ + cp -f /tmp/packages_diff.txt /tmp/packages_end.txt /tmp/packages_start.txt /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/archives/ [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins14317031728651315594.sh ---> capture-instance-metadata.sh Setup pyenv: system 3.8.13 3.9.13 * 3.10.6 (set by /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.python-version) lf-activate-venv(): INFO: Reuse venv:/tmp/venv-BkFA from file:/tmp/.os_lf_venv lf-activate-venv(): INFO: Installing: lftools code: exit -15 (782.59 seconds) /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master> pytest --cov ricxappframe --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml pid=28073 .pkg: _exit> python /tmp/venv-5Mha/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: error while trying to close <_io.BufferedWriter name=6> with BrokenPipeError(32, 'Broken pipe') + tox_status=143 + echo '---> Completed tox runs' ---> Completed tox runs + for i in .tox/*/log ++ awk -F/ '{print $2}' ++ echo .tox/code/log + tox_env=code + cp -r .tox/code/log /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/archives/tox/code lf-activate-venv(): INFO: Adding /tmp/venv-BkFA/bin to PATH INFO: Running in OpenStack, capturing instance metadata [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins17064218656057397208.sh provisioning config files... copy managed file [jenkins-log-archives-settings] to file:/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master@tmp/config10408460414311672515tmp Regular expression run condition: Expression=[^.*logs-s3.*], Label=[] Run condition [Regular expression match] preventing perform for step [Provide Configuration files] [EnvInject] - Injecting environment variables from a build step. [EnvInject] - Injecting as environment variables the properties content SERVER_ID=logs [EnvInject] - Variables injected successfully. [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins10830875132091047935.sh ---> create-netrc.sh [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins6913866191492991130.sh ---> python-tools-install.sh Setup pyenv: system 3.8.13 3.9.13 * 3.10.6 (set by /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.python-version) lf-activate-venv(): INFO: Reuse venv:/tmp/venv-BkFA from file:/tmp/.os_lf_venv lf-activate-venv(): INFO: Installing: lftools lf-activate-venv(): INFO: Adding /tmp/venv-BkFA/bin to PATH [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins16317745886979562270.sh ---> sudo-logs.sh Archiving 'sudo' log.. [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash /tmp/jenkins11131668371209038344.sh ---> job-cost.sh Setup pyenv: system 3.8.13 3.9.13 * 3.10.6 (set by /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.python-version) lf-activate-venv(): INFO: Reuse venv:/tmp/venv-BkFA from file:/tmp/.os_lf_venv lf-activate-venv(): INFO: Installing: zipp==1.1.0 python-openstackclient urllib3~=1.26.15 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. lftools 0.37.8 requires openstacksdk<1.5.0, but you have openstacksdk 2.0.0 which is incompatible. lf-activate-venv(): INFO: Adding /tmp/venv-BkFA/bin to PATH INFO: No Stack... INFO: Retrieving Pricing Info for: v2-highcpu-2 INFO: Archiving Costs [ric-plt-xapp-frame-py-pypi-verify-master] $ /bin/bash -l /tmp/jenkins11562624671170868292.sh ---> logs-deploy.sh Setup pyenv: system 3.8.13 3.9.13 * 3.10.6 (set by /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.python-version) lf-activate-venv(): INFO: Reuse venv:/tmp/venv-BkFA from file:/tmp/.os_lf_venv lf-activate-venv(): INFO: Installing: lftools ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. python-openstackclient 6.4.0 requires openstacksdk>=2.0.0, but you have openstacksdk 1.4.0 which is incompatible. lf-activate-venv(): INFO: Adding /tmp/venv-BkFA/bin to PATH INFO: Nexus URL https://nexus.o-ran-sc.org path production/vex-sjc-oran-jenkins-prod-1/ric-plt-xapp-frame-py-pypi-verify-master/262 INFO: archiving workspace using pattern(s): Archives upload complete. INFO: archiving logs to Nexus ---> uname -a: Linux prd-ubuntu1804-builder-2c-2g-2154 5.4.0-146-generic #163-Ubuntu SMP Fri Mar 17 18:26:02 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux ---> lscpu: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 40 bits physical, 48 bits virtual CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 2 NUMA node(s): 1 Vendor ID: AuthenticAMD CPU family: 23 Model: 49 Model name: AMD EPYC-Rome Processor Stepping: 0 CPU MHz: 2800.000 BogoMIPS: 5600.00 Virtualization: AMD-V Hypervisor vendor: KVM Virtualization type: full L1d cache: 64 KiB L1i cache: 64 KiB L2 cache: 1 MiB L3 cache: 32 MiB NUMA node0 CPU(s): 0,1 Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Retbleed: Vulnerable Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP disabled, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Not affected Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt nrip_save umip rdpid arch_capabilities ---> nproc: 2 ---> df -h: Filesystem Size Used Avail Use% Mounted on udev 975M 0 975M 0% /dev tmpfs 199M 1012K 198M 1% /run /dev/vda1 20G 8.5G 11G 45% / tmpfs 992M 0 992M 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 992M 0 992M 0% /sys/fs/cgroup /dev/loop1 62M 62M 0 100% /snap/core20/1405 /dev/loop2 68M 68M 0 100% /snap/lxd/22753 /dev/vda15 105M 6.1M 99M 6% /boot/efi tmpfs 199M 0 199M 0% /run/user/1001 /dev/loop3 41M 41M 0 100% /snap/snapd/20290 /dev/loop4 92M 92M 0 100% /snap/lxd/24061 ---> free -m: total used free shared buff/cache available Mem: 1983 426 134 2 1421 1361 Swap: 1023 1 1022 ---> ip addr: 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens3: mtu 1450 qdisc fq_codel state UP group default qlen 1000 link/ether fa:16:3e:7f:8a:03 brd ff:ff:ff:ff:ff:ff inet 10.32.6.201/23 brd 10.32.7.255 scope global dynamic ens3 valid_lft 85405sec preferred_lft 85405sec inet6 fe80::f816:3eff:fe7f:8a03/64 scope link valid_lft forever preferred_lft forever ---> sar -b -r -n DEV: Linux 5.4.0-146-generic (prd-ubuntu1804-builder-2c-2g-2154) 12/28/23 _x86_64_ (2 CPU) 03:58:15 LINUX RESTART (2 CPU) 03:59:02 tps rtps wtps dtps bread/s bwrtn/s bdscd/s 04:00:01 162.76 66.57 96.19 0.00 1764.96 13464.86 0.00 04:01:01 90.07 29.96 60.11 0.00 1060.62 8901.45 0.00 04:02:01 7.37 0.08 7.28 0.00 3.07 1722.65 0.00 04:03:01 1.42 0.00 1.42 0.00 0.00 17.46 0.00 04:04:01 74.52 35.66 38.86 0.00 5959.81 9112.08 0.00 04:05:01 5.68 0.07 5.62 0.00 1.60 112.91 0.00 04:06:01 1.73 0.00 1.73 0.00 0.00 22.27 0.00 04:07:01 1.70 0.00 1.70 0.00 0.00 22.26 0.00 04:08:01 1.18 0.00 1.18 0.00 0.00 14.40 0.00 04:09:01 2.13 0.00 2.13 0.00 0.00 26.93 0.00 04:10:01 1.35 0.13 1.22 0.00 18.00 19.46 0.00 04:11:01 2.10 0.00 2.10 0.00 0.00 117.58 0.00 04:12:01 0.88 0.00 0.88 0.00 0.00 9.73 0.00 04:13:01 1.17 0.00 1.17 0.00 0.00 14.00 0.00 04:14:01 10.95 5.22 5.73 0.00 312.61 299.68 0.00 Average: 24.18 9.12 15.07 0.00 606.77 2246.18 0.00 03:59:02 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 04:00:01 78340 1365348 435828 21.46 58168 1308172 884952 28.74 518640 1240172 3520 04:01:01 99768 1379564 415116 20.44 69188 1272848 1019652 33.11 525012 1187708 49964 04:02:01 92744 1372596 422004 20.78 69252 1272936 1090364 35.41 532840 1187520 136 04:03:01 92796 1372696 421960 20.78 69292 1272932 1090364 35.41 533332 1187524 96 04:04:01 135316 1359236 414424 20.41 93204 1206384 1102096 35.79 724224 943848 1112 04:05:01 131740 1354044 419556 20.66 91780 1206432 1372576 44.57 730812 942028 316 04:06:01 131016 1353376 420196 20.69 91816 1206424 1422188 46.19 732052 942044 212 04:07:01 129424 1351860 421648 20.76 91872 1206424 1472860 47.83 733444 942044 168 04:08:01 129652 1352128 421328 20.75 91900 1206432 1520468 49.38 732784 942044 120 04:09:01 127376 1349904 423512 20.86 91956 1206432 1545288 50.18 735212 942020 120 04:10:01 123724 1349608 423400 20.85 92036 1209668 1554888 50.50 735052 944616 2852 04:11:01 123228 1349148 423820 20.87 92056 1209676 1554888 50.50 735072 944624 96 04:12:01 123472 1349416 423632 20.86 92080 1209676 1554888 50.50 735096 944624 92 04:13:01 123252 1349224 423788 20.87 92100 1209680 1554888 50.50 735196 944628 156 04:14:01 80404 1350292 423388 20.85 94188 1250920 848004 27.54 751332 974532 44416 Average: 114817 1357229 422240 20.79 85393 1230336 1305891 42.41 679340 1013998 6892 03:59:02 IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil 04:00:01 lo 0.81 0.81 0.07 0.07 0.00 0.00 0.00 0.00 04:00:01 ens3 75.47 63.15 960.80 12.53 0.00 0.00 0.00 0.00 04:01:01 lo 2.47 2.47 0.28 0.28 0.00 0.00 0.00 0.00 04:01:01 ens3 33.43 35.53 93.18 12.71 0.00 0.00 0.00 0.00 04:02:01 lo 1.07 1.07 0.10 0.10 0.00 0.00 0.00 0.00 04:02:01 ens3 1.15 1.18 0.13 0.13 0.00 0.00 0.00 0.00 04:03:01 lo 1.67 1.67 0.15 0.15 0.00 0.00 0.00 0.00 04:03:01 ens3 1.62 1.65 0.17 0.17 0.00 0.00 0.00 0.00 04:04:01 lo 2.07 2.07 0.19 0.19 0.00 0.00 0.00 0.00 04:04:01 ens3 282.90 144.03 2086.01 10.00 0.00 0.00 0.00 0.00 04:05:01 lo 4.70 4.70 0.63 0.63 0.00 0.00 0.00 0.00 04:05:01 ens3 3.33 3.18 1.19 0.66 0.00 0.00 0.00 0.00 04:06:01 lo 1.60 1.60 0.15 0.15 0.00 0.00 0.00 0.00 04:06:01 ens3 1.72 1.70 0.18 0.18 0.00 0.00 0.00 0.00 04:07:01 lo 1.67 1.67 0.15 0.15 0.00 0.00 0.00 0.00 04:07:01 ens3 1.67 1.68 0.18 0.18 0.00 0.00 0.00 0.00 04:08:01 lo 1.60 1.60 0.15 0.15 0.00 0.00 0.00 0.00 04:08:01 ens3 1.72 1.70 0.18 0.18 0.00 0.00 0.00 0.00 04:09:01 lo 1.80 1.80 0.17 0.17 0.00 0.00 0.00 0.00 04:09:01 ens3 1.88 1.85 0.26 0.25 0.00 0.00 0.00 0.00 04:10:01 lo 1.20 1.20 0.11 0.11 0.00 0.00 0.00 0.00 04:10:01 ens3 22.73 18.68 4.57 14.17 0.00 0.00 0.00 0.00 04:11:01 lo 0.20 0.20 0.01 0.01 0.00 0.00 0.00 0.00 04:11:01 ens3 0.12 0.12 0.01 0.01 0.00 0.00 0.00 0.00 04:12:01 lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:12:01 ens3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:13:01 lo 0.20 0.20 0.01 0.01 0.00 0.00 0.00 0.00 04:13:01 ens3 0.12 0.10 0.01 0.01 0.00 0.00 0.00 0.00 04:14:01 lo 0.43 0.43 0.03 0.03 0.00 0.00 0.00 0.00 04:14:01 ens3 6.70 6.02 4.93 3.06 0.00 0.00 0.00 0.00 Average: lo 1.43 1.43 0.15 0.15 0.00 0.00 0.00 0.00 Average: ens3 28.92 18.66 209.29 3.61 0.00 0.00 0.00 0.00 ---> sar -P ALL: Linux 5.4.0-146-generic (prd-ubuntu1804-builder-2c-2g-2154) 12/28/23 _x86_64_ (2 CPU) 03:58:15 LINUX RESTART (2 CPU) 03:59:02 CPU %user %nice %system %iowait %steal %idle 04:00:01 all 35.31 13.48 11.49 8.13 0.13 31.47 04:00:01 0 31.98 12.74 10.87 6.53 0.12 37.75 04:00:01 1 38.65 14.22 12.10 9.73 0.14 25.16 04:01:01 all 30.78 0.00 3.41 5.83 0.10 59.89 04:01:01 0 38.82 0.00 3.48 3.68 0.12 53.90 04:01:01 1 22.76 0.00 3.34 7.97 0.08 65.86 04:02:01 all 1.08 0.00 0.28 0.16 0.05 98.43 04:02:01 0 0.57 0.00 0.32 0.23 0.05 98.83 04:02:01 1 1.59 0.00 0.25 0.08 0.05 98.03 04:03:01 all 1.63 0.00 0.24 0.02 0.05 98.06 04:03:01 0 2.17 0.00 0.18 0.00 0.05 97.60 04:03:01 1 1.09 0.00 0.30 0.03 0.05 98.53 04:04:01 all 8.75 0.00 4.78 3.56 0.08 82.82 04:04:01 0 9.87 0.00 4.31 3.01 0.08 82.72 04:04:01 1 7.62 0.00 5.26 4.10 0.08 82.93 04:05:01 all 2.27 0.00 0.45 0.27 0.06 96.94 04:05:01 0 1.47 0.00 0.37 0.27 0.07 97.82 04:05:01 1 3.06 0.00 0.53 0.28 0.05 96.08 04:06:01 all 1.11 0.00 0.30 0.02 0.08 98.50 04:06:01 0 0.33 0.00 0.37 0.00 0.07 99.23 04:06:01 1 1.88 0.00 0.24 0.03 0.08 97.77 04:07:01 all 1.08 0.00 0.29 0.05 0.06 98.52 04:07:01 0 1.87 0.00 0.27 0.03 0.07 97.76 04:07:01 1 0.30 0.00 0.30 0.07 0.05 99.28 04:08:01 all 1.49 0.00 0.32 0.02 0.06 98.12 04:08:01 0 1.20 0.00 0.40 0.03 0.07 98.30 04:08:01 1 1.77 0.00 0.23 0.00 0.05 97.94 04:09:01 all 2.06 0.00 0.36 0.03 0.07 97.48 04:09:01 0 3.03 0.00 0.35 0.07 0.07 96.49 04:09:01 1 1.07 0.00 0.37 0.00 0.07 98.49 04:10:01 all 1.59 0.00 0.48 0.03 0.07 97.83 04:10:01 0 1.32 0.00 0.50 0.05 0.08 98.04 04:10:01 1 1.86 0.00 0.45 0.02 0.05 97.62 04:10:01 CPU %user %nice %system %iowait %steal %idle 04:11:01 all 0.29 0.00 0.30 0.02 0.07 99.33 04:11:01 0 0.30 0.00 0.34 0.03 0.07 99.26 04:11:01 1 0.27 0.00 0.27 0.00 0.07 99.40 04:12:01 all 0.86 0.00 0.34 0.02 0.07 98.71 04:12:01 0 1.41 0.00 0.42 0.03 0.08 98.05 04:12:01 1 0.30 0.00 0.27 0.00 0.05 99.38 04:13:01 all 0.34 0.00 0.31 0.02 0.07 99.26 04:13:01 0 0.37 0.00 0.27 0.03 0.05 99.28 04:13:01 1 0.32 0.00 0.35 0.00 0.08 99.25 04:14:01 all 12.94 0.00 3.32 0.53 0.08 83.13 04:14:01 0 6.02 0.00 2.63 0.72 0.07 90.56 04:14:01 1 19.85 0.00 4.02 0.34 0.08 75.72 Average: all 6.74 0.88 1.77 1.24 0.07 89.30 Average: 0 6.70 0.84 1.66 0.98 0.07 89.76 Average: 1 6.79 0.93 1.87 1.50 0.07 88.84