Warning: Permanently added '2620:52:3:1:dead:beef:cafe:c108' (ED25519) to the list of known hosts. You can reproduce this build on your computer by running: sudo dnf install copr-rpmbuild /usr/bin/copr-rpmbuild --verbose --drop-resultdir --task-url https://copr.fedorainfracloud.org/backend/get-build-task/6228863-fedora-rawhide-x86_64 --chroot fedora-rawhide-x86_64 Version: 0.68 PID: 5388 Logging PID: 5389 Task: {'appstream': False, 'background': True, 'build_id': 6228863, 'buildroot_pkgs': [], 'chroot': 'fedora-rawhide-x86_64', 'enable_net': False, 'fedora_review': False, 'git_hash': '7f6edca7cc67d7ef1cd262c12de133a39d46898c', 'git_repo': 'https://copr-dist-git.fedorainfracloud.org/git/torsava/automatic-obsoletes:pr:5/python-sqlalchemy-utils', 'isolation': 'default', 'memory_reqs': 2048, 'package_name': 'python-sqlalchemy-utils', 'package_version': '0.41.1-2', 'project_dirname': 'automatic-obsoletes:pr:5', 'project_name': 'automatic-obsoletes', 'project_owner': 'torsava', 'repos': [{'baseurl': 'https://download.copr.fedorainfracloud.org/results/torsava/automatic-obsoletes/fedora-rawhide-x86_64/', 'id': 'copr_base', 'name': 'Copr repository'}], 'sandbox': 'torsava/automatic-obsoletes--https://src.fedoraproject.org/user/praiskup', 'source_json': {}, 'source_type': None, 'submitter': 'https://src.fedoraproject.org/user/praiskup', 'tags': [], 'task_id': '6228863-fedora-rawhide-x86_64', 'timeout': 18000, 'uses_devel_repo': False, 'with_opts': [], 'without_opts': []} Running: git clone https://copr-dist-git.fedorainfracloud.org/git/torsava/automatic-obsoletes:pr:5/python-sqlalchemy-utils /var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils --depth 500 --no-single-branch --recursive cmd: ['git', 'clone', 'https://copr-dist-git.fedorainfracloud.org/git/torsava/automatic-obsoletes:pr:5/python-sqlalchemy-utils', '/var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils', '--depth', '500', '--no-single-branch', '--recursive'] cwd: . rc: 0 stdout: stderr: Cloning into '/var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils'... Running: git checkout 7f6edca7cc67d7ef1cd262c12de133a39d46898c -- cmd: ['git', 'checkout', '7f6edca7cc67d7ef1cd262c12de133a39d46898c', '--'] cwd: /var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils rc: 0 stdout: stderr: Note: switching to '7f6edca7cc67d7ef1cd262c12de133a39d46898c'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -c Or undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 7f6edca automatic import of python-sqlalchemy-utils Running: copr-distgit-client sources Dload Upload Total Spent Left Speed 100 133k 100 133k 0 0 275k 0 --:--:-- --:--:-- --:--:-- 275k INFO: Reading stdout from command: md5sum SQLAlchemy-Utils-0.41.1.tar.gz /usr/bin/tail: /var/lib/copr-rpmbuild/main.log: file truncated Running (timeout=18000): unbuffer mock --buildsrpm --spec /var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils/python-sqlalchemy-utils.spec --sources /var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils --resultdir /var/lib/copr-rpmbuild/results --uniqueext 1690883357.281448 -r /var/lib/copr-rpmbuild/results/configs/child.cfg INFO: mock.py version 4.1 starting (python version = 3.11.3, NVR = mock-4.1-1.fc38)... Start(bootstrap): init plugins INFO: tmpfs initialized INFO: selinux enabled INFO: chroot_scan: initialized INFO: compress_logs: initialized Finish(bootstrap): init plugins Start: init plugins INFO: tmpfs initialized INFO: selinux enabled INFO: chroot_scan: initialized INFO: compress_logs: initialized Finish: init plugins INFO: Signal handler active Start: run INFO: Start(/var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils/python-sqlalchemy-utils.spec) Config(fedora-rawhide-x86_64) Start: clean chroot Finish: clean chroot Start(bootstrap): chroot init INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-bootstrap-1690883357.281448/root. INFO: calling preinit hooks INFO: enabled root cache INFO: enabled package manager cache Start(bootstrap): cleaning package manager metadata Finish(bootstrap): cleaning package manager metadata INFO: enabled HW Info plugin Mock Version: 4.1 INFO: Mock Version: 4.1 INFO: Package manager dnf detected and used (fallback) Start(bootstrap): installing dnf tooling No matches found for the following disable plugin patterns: local, spacewalk, versionlock Updating Subscription Management repositories. Unable to read consumer identity This system is not registered with an entitlement server. You can use subscription-manager to register. Copr repository 9.9 MB/s | 14 MB 00:01 fedora 9.9 MB/s | 73 MB 00:07 Last metadata expiration check: 0:00:03 ago on Tue Aug 1 09:49:27 2023. Dependencies resolved. ================================================================================ Package Arch Version Repo Size ================================================================================ Installing: dnf-plugins-core noarch 4.4.2-1.fc39 copr_base 39 k python3-dnf noarch 4.16.2-1.fc39 copr_base 547 k Installing dependencies: alternatives x86_64 1.24-2.fc39 fedora 39 k audit-libs x86_64 3.1.1-4.fc39 copr_base 117 k basesystem noarch 11-18.fc39 fedora 7.2 k bash x86_64 5.2.15-5.fc39 fedora 1.8 M bzip2-libs x86_64 1.0.8-16.fc39 fedora 41 k ca-certificates noarch 2023.2.60-3.fc39 fedora 840 k coreutils x86_64 9.3-2.fc39 fedora 1.1 M coreutils-common x86_64 9.3-2.fc39 fedora 2.1 M crypto-policies noarch 20230614-2.git5f3458e.fc39 fedora 93 k curl x86_64 8.2.1-1.fc39 fedora 346 k cyrus-sasl-lib x86_64 2.1.28-11.fc39 fedora 793 k dbus-libs x86_64 1:1.14.8-2.fc39 fedora 156 k dnf-data noarch 4.16.2-1.fc39 copr_base 39 k elfutils-default-yama-scope noarch 0.189-4.fc39 fedora 13 k elfutils-libelf x86_64 0.189-4.fc39 fedora 194 k elfutils-libs x86_64 0.189-4.fc39 fedora 258 k expat x86_64 2.5.0-3.fc39 fedora 110 k fedora-gpg-keys noarch 39-0.4 fedora 128 k fedora-release noarch 39-0.21 fedora 6.9 k fedora-release-common noarch 39-0.21 fedora 17 k fedora-release-identity-basic noarch 39-0.21 fedora 7.6 k fedora-repos noarch 39-0.4 fedora 9.3 k fedora-repos-rawhide noarch 39-0.4 fedora 8.9 k file-libs x86_64 5.44-5.fc39 copr_base 730 k filesystem x86_64 3.18-6.fc39 fedora 1.1 M findutils x86_64 1:4.9.0-5.fc39 fedora 492 k fmt x86_64 10.0.0-3.fc39 fedora 127 k gawk x86_64 5.2.2-2.fc39 fedora 1.1 M gdbm-libs x86_64 1:1.23-4.fc39 fedora 56 k glib2 x86_64 2.77.0-8.fc39 fedora 2.8 M glibc x86_64 2.37.9000-18.fc39 fedora 2.2 M glibc-common x86_64 2.37.9000-18.fc39 fedora 346 k glibc-minimal-langpack x86_64 2.37.9000-18.fc39 fedora 64 k gmp x86_64 1:6.2.1-5.fc39 fedora 313 k gnupg2 x86_64 2.4.3-2.fc39 fedora 2.6 M gnutls x86_64 3.8.0-7.fc39 fedora 1.1 M gpgme x86_64 1.20.0-5.fc39 fedora 210 k grep x86_64 3.11-3.fc39 fedora 298 k ima-evm-utils x86_64 1.5-2.fc39 fedora 63 k json-c x86_64 0.16-5.fc39 fedora 41 k keyutils-libs x86_64 1.6.1-7.fc39 fedora 31 k krb5-libs x86_64 1.21-3.fc39 fedora 765 k libacl x86_64 2.3.1-8.fc39 fedora 23 k libarchive x86_64 3.7.0-1.fc39 fedora 408 k libassuan x86_64 2.5.6-2.fc39 fedora 67 k libattr x86_64 2.5.1-8.fc39 fedora 18 k libb2 x86_64 0.98.1-9.fc39 fedora 25 k libblkid x86_64 2.39.1-3.fc39 copr_base 116 k libbrotli x86_64 1.0.9-13.fc39 copr_base 317 k libcap x86_64 2.48-7.fc39 fedora 68 k libcap-ng x86_64 0.8.3-7.fc39 copr_base 33 k libcom_err x86_64 1.47.0-2.fc39 fedora 26 k libcomps x86_64 0.1.19-3.fc39 copr_base 77 k libcurl x86_64 8.2.1-1.fc39 fedora 324 k libdnf x86_64 0.70.2-1.fc39 copr_base 658 k libdnf5 x86_64 5.1.0-2.fc39 fedora 879 k libeconf x86_64 0.4.0-6.fc39 fedora 27 k libevent x86_64 2.1.12-9.fc39 fedora 258 k libffi x86_64 3.4.4-4.fc39 fedora 40 k libfsverity x86_64 1.4-10.fc39 fedora 19 k libgcc x86_64 13.2.1-1.fc39 fedora 109 k libgcrypt x86_64 1.10.2-2.fc39 fedora 507 k libgomp x86_64 13.2.1-1.fc39 fedora 319 k libgpg-error x86_64 1.47-2.fc39 fedora 230 k libidn2 x86_64 2.3.4-3.fc39 fedora 117 k libksba x86_64 1.6.4-2.fc39 fedora 159 k libmodulemd x86_64 2.15.0-5.fc39 copr_base 232 k libmount x86_64 2.39.1-3.fc39 copr_base 155 k libnghttp2 x86_64 1.55.1-2.fc39 fedora 75 k libnsl2 x86_64 2.0.0-6.fc39 fedora 30 k libpsl x86_64 0.21.2-4.fc39 fedora 63 k librepo x86_64 1.15.2-1.fc39 copr_base 96 k libreport-filesystem noarch 2.17.11-3.fc39 copr_base 15 k libselinux x86_64 3.5-5.fc39 copr_base 87 k libsemanage x86_64 3.5-4.fc39 copr_base 120 k libsepol x86_64 3.5-2.fc39 fedora 324 k libsigsegv x86_64 2.14-5.fc39 fedora 27 k libsmartcols x86_64 2.39.1-3.fc39 copr_base 67 k libsolv x86_64 0.7.24-8.fc39 copr_base 426 k libssh x86_64 0.10.5-2.fc39 fedora 211 k libssh-config noarch 0.10.5-2.fc39 fedora 9.2 k libstdc++ x86_64 13.2.1-1.fc39 fedora 860 k libtasn1 x86_64 4.19.0-3.fc39 fedora 74 k libtirpc x86_64 1.3.3-1.rc1.fc39.1 fedora 94 k libunistring x86_64 1.1-4.fc39 fedora 543 k libuuid x86_64 2.39.1-3.fc39 copr_base 29 k libverto x86_64 0.3.2-6.fc39 fedora 20 k libxcrypt x86_64 4.4.36-2.fc39 fedora 119 k libxml2 x86_64 2.10.4-3.fc39 copr_base 701 k libyaml x86_64 0.2.5-12.fc39 fedora 59 k libzstd x86_64 1.5.5-4.fc39 fedora 309 k lua-libs x86_64 5.4.4-9.fc39 fedora 133 k lz4-libs x86_64 1.9.4-4.fc39 fedora 67 k mpdecimal x86_64 2.5.1-7.fc39 fedora 89 k mpfr x86_64 4.2.0-3.fc39 fedora 344 k ncurses-base noarch 6.4-6.20230520.fc39 fedora 88 k ncurses-libs x86_64 6.4-6.20230520.fc39 fedora 336 k nettle x86_64 3.9.1-2.fc39 fedora 425 k npth x86_64 1.6-14.fc39 fedora 25 k openldap x86_64 2.6.5-1.fc39 fedora 254 k openssl-libs x86_64 1:3.0.8-4.fc39 fedora 2.1 M p11-kit x86_64 0.25.0-2.fc39 fedora 486 k p11-kit-trust x86_64 0.25.0-2.fc39 fedora 142 k pcre2 x86_64 10.42-1.fc39.2 fedora 233 k pcre2-syntax noarch 10.42-1.fc39.2 fedora 143 k popt x86_64 1.19-3.fc39 fedora 66 k publicsuffix-list-dafsa noarch 20230614-2.fc39 fedora 57 k python-pip-wheel noarch 23.1.2-5.fc39 copr_base 1.4 M python3 x86_64 3.12.0~b4-2.fc39 fedora 26 k python3-dateutil noarch 1:2.8.2-10.fc39 fedora 355 k python3-dbus x86_64 1.3.2-4.fc39 fedora 157 k python3-distro noarch 1.8.0-6.fc39 fedora 49 k python3-dnf-plugins-core noarch 4.4.2-1.fc39 copr_base 279 k python3-gpg x86_64 1.20.0-5.fc39 fedora 298 k python3-hawkey x86_64 0.70.2-1.fc39 copr_base 107 k python3-libcomps x86_64 0.1.19-3.fc39 copr_base 48 k python3-libdnf x86_64 0.70.2-1.fc39 copr_base 823 k python3-libs x86_64 3.12.0~b4-2.fc39 fedora 9.2 M python3-rpm x86_64 4.18.91-9.fc39 copr_base 68 k python3-six noarch 1.16.0-12.fc39 fedora 41 k python3-systemd x86_64 235-5.fc39 fedora 107 k readline x86_64 8.2-4.fc39 fedora 213 k rpm x86_64 4.18.91-9.fc39 copr_base 499 k rpm-build-libs x86_64 4.18.91-9.fc39 copr_base 96 k rpm-libs x86_64 4.18.91-9.fc39 copr_base 310 k rpm-sequoia x86_64 1.4.1-2.fc39 fedora 869 k rpm-sign-libs x86_64 4.18.91-9.fc39 copr_base 27 k sed x86_64 4.8-14.fc39 fedora 306 k setup noarch 2.14.4-1.fc39 fedora 154 k shadow-utils x86_64 2:4.13-8.fc39 fedora 1.3 M sqlite-libs x86_64 3.42.0-7.fc39 fedora 678 k systemd-libs x86_64 254-1.fc39 fedora 685 k tpm2-tss x86_64 4.0.1-4.fc39 fedora 676 k tzdata noarch 2023c-2.fc39 fedora 717 k xz-libs x86_64 5.4.3-2.fc39 fedora 108 k zchunk-libs x86_64 1.3.1-2.fc39 fedora 51 k zlib x86_64 1.2.13-4.fc39 fedora 94 k Transaction Summary ================================================================================ Install 139 Packages Total download size: 57 M Installed size: 200 M Downloading Packages: (1/139): dnf-data-4.16.2-1.fc39.noarch.rpm 365 kB/s | 39 kB 00:00 (2/139): dnf-plugins-core-4.4.2-1.fc39.noarch.r 364 kB/s | 39 kB 00:00 (3/139): audit-libs-3.1.1-4.fc39.x86_64.rpm 1.0 MB/s | 117 kB 00:00 (4/139): libblkid-2.39.1-3.fc39.x86_64.rpm 1.9 MB/s | 116 kB 00:00 (5/139): file-libs-5.44-5.fc39.x86_64.rpm 6.5 MB/s | 730 kB 00:00 (6/139): libbrotli-1.0.9-13.fc39.x86_64.rpm 2.8 MB/s | 317 kB 00:00 (7/139): libcap-ng-0.8.3-7.fc39.x86_64.rpm 567 kB/s | 33 kB 00:00 (8/139): libcomps-0.1.19-3.fc39.x86_64.rpm 5.1 MB/s | 77 kB 00:00 (9/139): libmodulemd-2.15.0-5.fc39.x86_64.rpm 13 MB/s | 232 kB 00:00 (10/139): libdnf-0.70.2-1.fc39.x86_64.rpm 27 MB/s | 658 kB 00:00 (11/139): libmount-2.39.1-3.fc39.x86_64.rpm 8.8 MB/s | 155 kB 00:00 (12/139): librepo-1.15.2-1.fc39.x86_64.rpm 7.5 MB/s | 96 kB 00:00 (13/139): libreport-filesystem-2.17.11-3.fc39.n 1.3 MB/s | 15 kB 00:00 (14/139): libselinux-3.5-5.fc39.x86_64.rpm 7.1 MB/s | 87 kB 00:00 (15/139): libsemanage-3.5-4.fc39.x86_64.rpm 8.9 MB/s | 120 kB 00:00 (16/139): libsmartcols-2.39.1-3.fc39.x86_64.rpm 4.5 MB/s | 67 kB 00:00 (17/139): libsolv-0.7.24-8.fc39.x86_64.rpm 22 MB/s | 426 kB 00:00 (18/139): libuuid-2.39.1-3.fc39.x86_64.rpm 1.9 MB/s | 29 kB 00:00 (19/139): libxml2-2.10.4-3.fc39.x86_64.rpm 32 MB/s | 701 kB 00:00 (20/139): python-pip-wheel-23.1.2-5.fc39.noarch 48 MB/s | 1.4 MB 00:00 (21/139): python3-dnf-4.16.2-1.fc39.noarch.rpm 15 MB/s | 547 kB 00:00 (22/139): python3-dnf-plugins-core-4.4.2-1.fc39 11 MB/s | 279 kB 00:00 (23/139): python3-hawkey-0.70.2-1.fc39.x86_64.r 6.7 MB/s | 107 kB 00:00 (24/139): python3-libcomps-0.1.19-3.fc39.x86_64 4.0 MB/s | 48 kB 00:00 (25/139): python3-libdnf-0.70.2-1.fc39.x86_64.r 40 MB/s | 823 kB 00:00 (26/139): python3-rpm-4.18.91-9.fc39.x86_64.rpm 4.2 MB/s | 68 kB 00:00 (27/139): rpm-4.18.91-9.fc39.x86_64.rpm 24 MB/s | 499 kB 00:00 (28/139): rpm-build-libs-4.18.91-9.fc39.x86_64. 5.4 MB/s | 96 kB 00:00 (29/139): rpm-libs-4.18.91-9.fc39.x86_64.rpm 15 MB/s | 310 kB 00:00 (30/139): rpm-sign-libs-4.18.91-9.fc39.x86_64.r 1.5 MB/s | 27 kB 00:00 (31/139): alternatives-1.24-2.fc39.x86_64.rpm 261 kB/s | 39 kB 00:00 (32/139): basesystem-11-18.fc39.noarch.rpm 36 kB/s | 7.2 kB 00:00 (33/139): bzip2-libs-1.0.8-16.fc39.x86_64.rpm 270 kB/s | 41 kB 00:00 (34/139): ca-certificates-2023.2.60-3.fc39.noar 2.3 MB/s | 840 kB 00:00 (35/139): coreutils-common-9.3-2.fc39.x86_64.rp 5.7 MB/s | 2.1 MB 00:00 (36/139): crypto-policies-20230614-2.git5f3458e 492 kB/s | 93 kB 00:00 (37/139): coreutils-9.3-2.fc39.x86_64.rpm 978 kB/s | 1.1 MB 00:01 (38/139): curl-8.2.1-1.fc39.x86_64.rpm 822 kB/s | 346 kB 00:00 (39/139): dbus-libs-1.14.8-2.fc39.x86_64.rpm 645 kB/s | 156 kB 00:00 (40/139): elfutils-default-yama-scope-0.189-4.f 88 kB/s | 13 kB 00:00 (41/139): elfutils-libelf-0.189-4.fc39.x86_64.r 1.3 MB/s | 194 kB 00:00 (42/139): elfutils-libs-0.189-4.fc39.x86_64.rpm 1.2 MB/s | 258 kB 00:00 (43/139): expat-2.5.0-3.fc39.x86_64.rpm 1.1 MB/s | 110 kB 00:00 (44/139): bash-5.2.15-5.fc39.x86_64.rpm 735 kB/s | 1.8 MB 00:02 (45/139): fedora-gpg-keys-39-0.4.noarch.rpm 607 kB/s | 128 kB 00:00 (46/139): fedora-release-39-0.21.noarch.rpm 55 kB/s | 6.9 kB 00:00 (47/139): fedora-release-identity-basic-39-0.21 90 kB/s | 7.6 kB 00:00 (48/139): fedora-repos-39-0.4.noarch.rpm 131 kB/s | 9.3 kB 00:00 (49/139): fedora-repos-rawhide-39-0.4.noarch.rp 158 kB/s | 8.9 kB 00:00 (50/139): fedora-release-common-39-0.21.noarch. 44 kB/s | 17 kB 00:00 (51/139): filesystem-3.18-6.fc39.x86_64.rpm 2.5 MB/s | 1.1 MB 00:00 (52/139): cyrus-sasl-lib-2.1.28-11.fc39.x86_64. 409 kB/s | 793 kB 00:01 (53/139): findutils-4.9.0-5.fc39.x86_64.rpm 969 kB/s | 492 kB 00:00 (54/139): fmt-10.0.0-3.fc39.x86_64.rpm 446 kB/s | 127 kB 00:00 (55/139): gdbm-libs-1.23-4.fc39.x86_64.rpm 425 kB/s | 56 kB 00:00 (56/139): gawk-5.2.2-2.fc39.x86_64.rpm 515 kB/s | 1.1 MB 00:02 (57/139): glib2-2.77.0-8.fc39.x86_64.rpm 1.4 MB/s | 2.8 MB 00:02 (58/139): glibc-2.37.9000-18.fc39.x86_64.rpm 1.1 MB/s | 2.2 MB 00:01 (59/139): glibc-minimal-langpack-2.37.9000-18.f 545 kB/s | 64 kB 00:00 (60/139): gmp-6.2.1-5.fc39.x86_64.rpm 1.0 MB/s | 313 kB 00:00 (61/139): gnutls-3.8.0-7.fc39.x86_64.rpm 1.6 MB/s | 1.1 MB 00:00 (62/139): gnupg2-2.4.3-2.fc39.x86_64.rpm 2.2 MB/s | 2.6 MB 00:01 (63/139): gpgme-1.20.0-5.fc39.x86_64.rpm 531 kB/s | 210 kB 00:00 (64/139): ima-evm-utils-1.5-2.fc39.x86_64.rpm 340 kB/s | 63 kB 00:00 (65/139): glibc-common-2.37.9000-18.fc39.x86_64 193 kB/s | 346 kB 00:01 (66/139): keyutils-libs-1.6.1-7.fc39.x86_64.rpm 148 kB/s | 31 kB 00:00 (67/139): json-c-0.16-5.fc39.x86_64.rpm 68 kB/s | 41 kB 00:00 (68/139): grep-3.11-3.fc39.x86_64.rpm 322 kB/s | 298 kB 00:00 (69/139): libarchive-3.7.0-1.fc39.x86_64.rpm 1.3 MB/s | 408 kB 00:00 (70/139): libassuan-2.5.6-2.fc39.x86_64.rpm 931 kB/s | 67 kB 00:00 (71/139): libacl-2.3.1-8.fc39.x86_64.rpm 53 kB/s | 23 kB 00:00 (72/139): libattr-2.5.1-8.fc39.x86_64.rpm 329 kB/s | 18 kB 00:00 (73/139): libb2-0.98.1-9.fc39.x86_64.rpm 224 kB/s | 25 kB 00:00 (74/139): libcom_err-1.47.0-2.fc39.x86_64.rpm 223 kB/s | 26 kB 00:00 (75/139): libcap-2.48-7.fc39.x86_64.rpm 300 kB/s | 68 kB 00:00 (76/139): krb5-libs-1.21-3.fc39.x86_64.rpm 645 kB/s | 765 kB 00:01 (77/139): libcurl-8.2.1-1.fc39.x86_64.rpm 785 kB/s | 324 kB 00:00 (78/139): libdnf5-5.1.0-2.fc39.x86_64.rpm 2.1 MB/s | 879 kB 00:00 (79/139): libeconf-0.4.0-6.fc39.x86_64.rpm 84 kB/s | 27 kB 00:00 (80/139): libfsverity-1.4-10.fc39.x86_64.rpm 344 kB/s | 19 kB 00:00 (81/139): libffi-3.4.4-4.fc39.x86_64.rpm 83 kB/s | 40 kB 00:00 (82/139): libgcc-13.2.1-1.fc39.x86_64.rpm 137 kB/s | 109 kB 00:00 (83/139): libgcrypt-1.10.2-2.fc39.x86_64.rpm 892 kB/s | 507 kB 00:00 (84/139): libgomp-13.2.1-1.fc39.x86_64.rpm 902 kB/s | 319 kB 00:00 (85/139): libidn2-2.3.4-3.fc39.x86_64.rpm 535 kB/s | 117 kB 00:00 (86/139): libgpg-error-1.47-2.fc39.x86_64.rpm 336 kB/s | 230 kB 00:00 (87/139): libnghttp2-1.55.1-2.fc39.x86_64.rpm 515 kB/s | 75 kB 00:00 (88/139): libksba-1.6.4-2.fc39.x86_64.rpm 313 kB/s | 159 kB 00:00 (89/139): libnsl2-2.0.0-6.fc39.x86_64.rpm 104 kB/s | 30 kB 00:00 (90/139): libpsl-0.21.2-4.fc39.x86_64.rpm 207 kB/s | 63 kB 00:00 (91/139): libevent-2.1.12-9.fc39.x86_64.rpm 104 kB/s | 258 kB 00:02 (92/139): libsigsegv-2.14-5.fc39.x86_64.rpm 13 kB/s | 27 kB 00:02 (93/139): libssh-config-0.10.5-2.fc39.noarch.rp 32 kB/s | 9.2 kB 00:00 (94/139): libssh-0.10.5-2.fc39.x86_64.rpm 71 kB/s | 211 kB 00:02 (95/139): libtasn1-4.19.0-3.fc39.x86_64.rpm 211 kB/s | 74 kB 00:00 (96/139): libstdc++-13.2.1-1.fc39.x86_64.rpm 733 kB/s | 860 kB 00:01 (97/139): libtirpc-1.3.3-1.rc1.fc39.1.x86_64.rp 244 kB/s | 94 kB 00:00 (98/139): libverto-0.3.2-6.fc39.x86_64.rpm 241 kB/s | 20 kB 00:00 (99/139): libunistring-1.1-4.fc39.x86_64.rpm 928 kB/s | 543 kB 00:00 (100/139): libxcrypt-4.4.36-2.fc39.x86_64.rpm 357 kB/s | 119 kB 00:00 (101/139): libsepol-3.5-2.fc39.x86_64.rpm 73 kB/s | 324 kB 00:04 (102/139): libyaml-0.2.5-12.fc39.x86_64.rpm 176 kB/s | 59 kB 00:00 (103/139): lz4-libs-1.9.4-4.fc39.x86_64.rpm 186 kB/s | 67 kB 00:00 (104/139): libzstd-1.5.5-4.fc39.x86_64.rpm 491 kB/s | 309 kB 00:00 (105/139): mpdecimal-2.5.1-7.fc39.x86_64.rpm 206 kB/s | 89 kB 00:00 (106/139): lua-libs-5.4.4-9.fc39.x86_64.rpm 123 kB/s | 133 kB 00:01 (107/139): ncurses-base-6.4-6.20230520.fc39.noa 476 kB/s | 88 kB 00:00 (108/139): ncurses-libs-6.4-6.20230520.fc39.x86 529 kB/s | 336 kB 00:00 (109/139): mpfr-4.2.0-3.fc39.x86_64.rpm 265 kB/s | 344 kB 00:01 (110/139): nettle-3.9.1-2.fc39.x86_64.rpm 557 kB/s | 425 kB 00:00 (111/139): npth-1.6-14.fc39.x86_64.rpm 125 kB/s | 25 kB 00:00 (112/139): openldap-2.6.5-1.fc39.x86_64.rpm 555 kB/s | 254 kB 00:00 (113/139): p11-kit-trust-0.25.0-2.fc39.x86_64.r 230 kB/s | 142 kB 00:00 (114/139): p11-kit-0.25.0-2.fc39.x86_64.rpm 366 kB/s | 486 kB 00:01 (115/139): pcre2-10.42-1.fc39.2.x86_64.rpm 577 kB/s | 233 kB 00:00 (116/139): popt-1.19-3.fc39.x86_64.rpm 285 kB/s | 66 kB 00:00 (117/139): pcre2-syntax-10.42-1.fc39.2.noarch.r 366 kB/s | 143 kB 00:00 (118/139): publicsuffix-list-dafsa-20230614-2.f 82 kB/s | 57 kB 00:00 (119/139): python3-3.12.0~b4-2.fc39.x86_64.rpm 28 kB/s | 26 kB 00:00 (120/139): python3-dbus-1.3.2-4.fc39.x86_64.rpm 766 kB/s | 157 kB 00:00 (121/139): python3-dateutil-2.8.2-10.fc39.noarc 631 kB/s | 355 kB 00:00 (122/139): python3-distro-1.8.0-6.fc39.noarch.r 375 kB/s | 49 kB 00:00 (123/139): python3-gpg-1.20.0-5.fc39.x86_64.rpm 622 kB/s | 298 kB 00:00 (124/139): python3-six-1.16.0-12.fc39.noarch.rp 295 kB/s | 41 kB 00:00 (125/139): python3-systemd-235-5.fc39.x86_64.rp 363 kB/s | 107 kB 00:00 (126/139): openssl-libs-3.0.8-4.fc39.x86_64.rpm 532 kB/s | 2.1 MB 00:04 (127/139): readline-8.2-4.fc39.x86_64.rpm 335 kB/s | 213 kB 00:00 (128/139): sed-4.8-14.fc39.x86_64.rpm 357 kB/s | 306 kB 00:00 (129/139): rpm-sequoia-1.4.1-2.fc39.x86_64.rpm 573 kB/s | 869 kB 00:01 (130/139): setup-2.14.4-1.fc39.noarch.rpm 338 kB/s | 154 kB 00:00 (131/139): sqlite-libs-3.42.0-7.fc39.x86_64.rpm 586 kB/s | 678 kB 00:01 (132/139): systemd-libs-254-1.fc39.x86_64.rpm 737 kB/s | 685 kB 00:00 (133/139): tpm2-tss-4.0.1-4.fc39.x86_64.rpm 839 kB/s | 676 kB 00:00 (134/139): python3-libs-3.12.0~b4-2.fc39.x86_64 1.6 MB/s | 9.2 MB 00:05 (135/139): shadow-utils-4.13-8.fc39.x86_64.rpm 312 kB/s | 1.3 MB 00:04 (136/139): xz-libs-5.4.3-2.fc39.x86_64.rpm 107 kB/s | 108 kB 00:01 (137/139): zlib-1.2.13-4.fc39.x86_64.rpm 379 kB/s | 94 kB 00:00 (138/139): tzdata-2023c-2.fc39.noarch.rpm 304 kB/s | 717 kB 00:02 (139/139): zchunk-libs-1.3.1-2.fc39.x86_64.rpm 16 kB/s | 51 kB 00:03 -------------------------------------------------------------------------------- Total 1.8 MB/s | 57 MB 00:30 fedora 1.6 MB/s | 1.6 kB 00:00 Importing GPG key 0x18B8E74C: Userid : "Fedora (39) " Fingerprint: E8F2 3996 F232 1864 0CB4 4CBE 75CF 5AC4 18B8 E74C From : /usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-39-primary Key imported successfully fedora 1.6 MB/s | 1.6 kB 00:00 GPG key at file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-39-primary (0x18B8E74C) is already installed fedora 1.6 MB/s | 1.6 kB 00:00 Importing GPG key 0xEB10B464: Userid : "Fedora (38) " Fingerprint: 6A51 BBAB BA3D 5467 B617 1221 809A 8D7C EB10 B464 From : /usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-38-primary Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Running scriptlet: filesystem-3.18-6.fc39.x86_64 1/1 Preparing : 1/1 Installing : libgcc-13.2.1-1.fc39.x86_64 1/139 Running scriptlet: libgcc-13.2.1-1.fc39.x86_64 1/139 Installing : tzdata-2023c-2.fc39.noarch 2/139 Installing : crypto-policies-20230614-2.git5f3458e.fc39.noarc 3/139 Running scriptlet: crypto-policies-20230614-2.git5f3458e.fc39.noarc 3/139 Installing : fedora-release-identity-basic-39-0.21.noarch 4/139 Installing : fedora-repos-rawhide-39-0.4.noarch 5/139 Installing : fedora-gpg-keys-39-0.4.noarch 6/139 Installing : fedora-repos-39-0.4.noarch 7/139 Installing : fedora-release-common-39-0.21.noarch 8/139 Installing : fedora-release-39-0.21.noarch 9/139 Installing : setup-2.14.4-1.fc39.noarch 10/139 Running scriptlet: setup-2.14.4-1.fc39.noarch 10/139 Installing : filesystem-3.18-6.fc39.x86_64 11/139 Installing : basesystem-11-18.fc39.noarch 12/139 Installing : publicsuffix-list-dafsa-20230614-2.fc39.noarch 13/139 Installing : pcre2-syntax-10.42-1.fc39.2.noarch 14/139 Installing : ncurses-base-6.4-6.20230520.fc39.noarch 15/139 Installing : glibc-minimal-langpack-2.37.9000-18.fc39.x86_64 16/139 Installing : glibc-common-2.37.9000-18.fc39.x86_64 17/139 Running scriptlet: glibc-2.37.9000-18.fc39.x86_64 18/139 Installing : glibc-2.37.9000-18.fc39.x86_64 18/139 Running scriptlet: glibc-2.37.9000-18.fc39.x86_64 18/139 Installing : ncurses-libs-6.4-6.20230520.fc39.x86_64 19/139 Installing : bash-5.2.15-5.fc39.x86_64 20/139 Running scriptlet: bash-5.2.15-5.fc39.x86_64 20/139 Installing : zlib-1.2.13-4.fc39.x86_64 21/139 Installing : bzip2-libs-1.0.8-16.fc39.x86_64 22/139 Installing : libzstd-1.5.5-4.fc39.x86_64 23/139 Installing : xz-libs-5.4.3-2.fc39.x86_64 24/139 Installing : libxml2-2.10.4-3.fc39.x86_64 25/139 Installing : sqlite-libs-3.42.0-7.fc39.x86_64 26/139 Installing : gmp-1:6.2.1-5.fc39.x86_64 27/139 Installing : libgpg-error-1.47-2.fc39.x86_64 28/139 Installing : libstdc++-13.2.1-1.fc39.x86_64 29/139 Installing : libuuid-2.39.1-3.fc39.x86_64 30/139 Installing : libcap-2.48-7.fc39.x86_64 31/139 Installing : readline-8.2-4.fc39.x86_64 32/139 Installing : libattr-2.5.1-8.fc39.x86_64 33/139 Installing : libacl-2.3.1-8.fc39.x86_64 34/139 Installing : libffi-3.4.4-4.fc39.x86_64 35/139 Installing : p11-kit-0.25.0-2.fc39.x86_64 36/139 Installing : libunistring-1.1-4.fc39.x86_64 37/139 Installing : libidn2-2.3.4-3.fc39.x86_64 38/139 Installing : libxcrypt-4.4.36-2.fc39.x86_64 39/139 Installing : pcre2-10.42-1.fc39.2.x86_64 40/139 Installing : popt-1.19-3.fc39.x86_64 41/139 Installing : libassuan-2.5.6-2.fc39.x86_64 42/139 Installing : elfutils-libelf-0.189-4.fc39.x86_64 43/139 Installing : libsmartcols-2.39.1-3.fc39.x86_64 44/139 Installing : expat-2.5.0-3.fc39.x86_64 45/139 Installing : gdbm-libs-1:1.23-4.fc39.x86_64 46/139 Installing : json-c-0.16-5.fc39.x86_64 47/139 Installing : keyutils-libs-1.6.1-7.fc39.x86_64 48/139 Installing : libcom_err-1.47.0-2.fc39.x86_64 49/139 Installing : libgomp-13.2.1-1.fc39.x86_64 50/139 Installing : libsepol-3.5-2.fc39.x86_64 51/139 Installing : libselinux-3.5-5.fc39.x86_64 52/139 Installing : sed-4.8-14.fc39.x86_64 53/139 Installing : libtasn1-4.19.0-3.fc39.x86_64 54/139 Installing : lua-libs-5.4.4-9.fc39.x86_64 55/139 Installing : lz4-libs-1.9.4-4.fc39.x86_64 56/139 Installing : systemd-libs-254-1.fc39.x86_64 57/139 Installing : dbus-libs-1:1.14.8-2.fc39.x86_64 58/139 Installing : findutils-1:4.9.0-5.fc39.x86_64 59/139 Installing : libb2-0.98.1-9.fc39.x86_64 60/139 Installing : cyrus-sasl-lib-2.1.28-11.fc39.x86_64 61/139 Installing : libcomps-0.1.19-3.fc39.x86_64 62/139 Installing : grep-3.11-3.fc39.x86_64 63/139 Installing : libpsl-0.21.2-4.fc39.x86_64 64/139 Installing : libblkid-2.39.1-3.fc39.x86_64 65/139 Installing : libmount-2.39.1-3.fc39.x86_64 66/139 Installing : fmt-10.0.0-3.fc39.x86_64 67/139 Installing : libgcrypt-1.10.2-2.fc39.x86_64 68/139 Installing : libksba-1.6.4-2.fc39.x86_64 69/139 Installing : mpfr-4.2.0-3.fc39.x86_64 70/139 Installing : nettle-3.9.1-2.fc39.x86_64 71/139 Installing : file-libs-5.44-5.fc39.x86_64 72/139 Installing : elfutils-default-yama-scope-0.189-4.fc39.noarch 73/139 Running scriptlet: elfutils-default-yama-scope-0.189-4.fc39.noarch 73/139 Installing : elfutils-libs-0.189-4.fc39.x86_64 74/139 Installing : libbrotli-1.0.9-13.fc39.x86_64 75/139 Installing : libcap-ng-0.8.3-7.fc39.x86_64 76/139 Installing : audit-libs-3.1.1-4.fc39.x86_64 77/139 Installing : libsemanage-3.5-4.fc39.x86_64 78/139 Installing : alternatives-1.24-2.fc39.x86_64 79/139 Installing : p11-kit-trust-0.25.0-2.fc39.x86_64 80/139 Running scriptlet: p11-kit-trust-0.25.0-2.fc39.x86_64 80/139 Installing : gnutls-3.8.0-7.fc39.x86_64 81/139 Installing : glib2-2.77.0-8.fc39.x86_64 82/139 Installing : libeconf-0.4.0-6.fc39.x86_64 83/139 Installing : shadow-utils-2:4.13-8.fc39.x86_64 84/139 Installing : libnghttp2-1.55.1-2.fc39.x86_64 85/139 Installing : libsigsegv-2.14-5.fc39.x86_64 86/139 Installing : gawk-5.2.2-2.fc39.x86_64 87/139 Installing : libverto-0.3.2-6.fc39.x86_64 88/139 Installing : libyaml-0.2.5-12.fc39.x86_64 89/139 Installing : mpdecimal-2.5.1-7.fc39.x86_64 90/139 Installing : npth-1.6-14.fc39.x86_64 91/139 Installing : libssh-config-0.10.5-2.fc39.noarch 92/139 Installing : coreutils-common-9.3-2.fc39.x86_64 93/139 Installing : openssl-libs-1:3.0.8-4.fc39.x86_64 94/139 Installing : coreutils-9.3-2.fc39.x86_64 95/139 Running scriptlet: ca-certificates-2023.2.60-3.fc39.noarch 96/139 Installing : ca-certificates-2023.2.60-3.fc39.noarch 96/139 Running scriptlet: ca-certificates-2023.2.60-3.fc39.noarch 96/139 Installing : krb5-libs-1.21-3.fc39.x86_64 97/139 Installing : libtirpc-1.3.3-1.rc1.fc39.1.x86_64 98/139 Installing : zchunk-libs-1.3.1-2.fc39.x86_64 99/139 Installing : libnsl2-2.0.0-6.fc39.x86_64 100/139 Installing : libssh-0.10.5-2.fc39.x86_64 101/139 Installing : python-pip-wheel-23.1.2-5.fc39.noarch 102/139 Installing : python3-3.12.0~b4-2.fc39.x86_64 103/139 Installing : python3-libs-3.12.0~b4-2.fc39.x86_64 104/139 Installing : python3-libcomps-0.1.19-3.fc39.x86_64 105/139 Installing : python3-dbus-1.3.2-4.fc39.x86_64 106/139 Installing : python3-distro-1.8.0-6.fc39.noarch 107/139 Installing : python3-six-1.16.0-12.fc39.noarch 108/139 Installing : python3-dateutil-1:2.8.2-10.fc39.noarch 109/139 Installing : python3-systemd-235-5.fc39.x86_64 110/139 Installing : libarchive-3.7.0-1.fc39.x86_64 111/139 Installing : libevent-2.1.12-9.fc39.x86_64 112/139 Installing : openldap-2.6.5-1.fc39.x86_64 113/139 Installing : libcurl-8.2.1-1.fc39.x86_64 114/139 Running scriptlet: tpm2-tss-4.0.1-4.fc39.x86_64 115/139 useradd: Warning: missing or non-executable shell '/usr/sbin/nologin' Installing : tpm2-tss-4.0.1-4.fc39.x86_64 115/139 Installing : gnupg2-2.4.3-2.fc39.x86_64 116/139 Installing : gpgme-1.20.0-5.fc39.x86_64 117/139 Installing : librepo-1.15.2-1.fc39.x86_64 118/139 Installing : python3-gpg-1.20.0-5.fc39.x86_64 119/139 Installing : ima-evm-utils-1.5-2.fc39.x86_64 120/139 Installing : curl-8.2.1-1.fc39.x86_64 121/139 Installing : libfsverity-1.4-10.fc39.x86_64 122/139 Installing : rpm-sequoia-1.4.1-2.fc39.x86_64 123/139 Installing : rpm-libs-4.18.91-9.fc39.x86_64 124/139 Installing : libmodulemd-2.15.0-5.fc39.x86_64 125/139 Installing : libsolv-0.7.24-8.fc39.x86_64 126/139 Installing : libdnf-0.70.2-1.fc39.x86_64 127/139 Installing : python3-libdnf-0.70.2-1.fc39.x86_64 128/139 Installing : python3-hawkey-0.70.2-1.fc39.x86_64 129/139 Installing : libdnf5-5.1.0-2.fc39.x86_64 130/139 warning: /etc/dnf/dnf.conf created as /etc/dnf/dnf.conf.rpmnew Installing : rpm-build-libs-4.18.91-9.fc39.x86_64 131/139 Installing : rpm-sign-libs-4.18.91-9.fc39.x86_64 132/139 Installing : python3-rpm-4.18.91-9.fc39.x86_64 133/139 Installing : libreport-filesystem-2.17.11-3.fc39.noarch 134/139 Installing : dnf-data-4.16.2-1.fc39.noarch 135/139 Installing : python3-dnf-4.16.2-1.fc39.noarch 136/139 Installing : python3-dnf-plugins-core-4.4.2-1.fc39.noarch 137/139 Installing : dnf-plugins-core-4.4.2-1.fc39.noarch 138/139 Running scriptlet: rpm-4.18.91-9.fc39.x86_64 139/139 Installing : rpm-4.18.91-9.fc39.x86_64 139/139 Running scriptlet: filesystem-3.18-6.fc39.x86_64 139/139 Running scriptlet: ca-certificates-2023.2.60-3.fc39.noarch 139/139 Running scriptlet: rpm-4.18.91-9.fc39.x86_64 139/139 Verifying : audit-libs-3.1.1-4.fc39.x86_64 1/139 Verifying : dnf-data-4.16.2-1.fc39.noarch 2/139 Verifying : dnf-plugins-core-4.4.2-1.fc39.noarch 3/139 Verifying : file-libs-5.44-5.fc39.x86_64 4/139 Verifying : libblkid-2.39.1-3.fc39.x86_64 5/139 Verifying : libbrotli-1.0.9-13.fc39.x86_64 6/139 Verifying : libcap-ng-0.8.3-7.fc39.x86_64 7/139 Verifying : libcomps-0.1.19-3.fc39.x86_64 8/139 Verifying : libdnf-0.70.2-1.fc39.x86_64 9/139 Verifying : libmodulemd-2.15.0-5.fc39.x86_64 10/139 Verifying : libmount-2.39.1-3.fc39.x86_64 11/139 Verifying : librepo-1.15.2-1.fc39.x86_64 12/139 Verifying : libreport-filesystem-2.17.11-3.fc39.noarch 13/139 Verifying : libselinux-3.5-5.fc39.x86_64 14/139 Verifying : libsemanage-3.5-4.fc39.x86_64 15/139 Verifying : libsmartcols-2.39.1-3.fc39.x86_64 16/139 Verifying : libsolv-0.7.24-8.fc39.x86_64 17/139 Verifying : libuuid-2.39.1-3.fc39.x86_64 18/139 Verifying : libxml2-2.10.4-3.fc39.x86_64 19/139 Verifying : python-pip-wheel-23.1.2-5.fc39.noarch 20/139 Verifying : python3-dnf-4.16.2-1.fc39.noarch 21/139 Verifying : python3-dnf-plugins-core-4.4.2-1.fc39.noarch 22/139 Verifying : python3-hawkey-0.70.2-1.fc39.x86_64 23/139 Verifying : python3-libcomps-0.1.19-3.fc39.x86_64 24/139 Verifying : python3-libdnf-0.70.2-1.fc39.x86_64 25/139 Verifying : python3-rpm-4.18.91-9.fc39.x86_64 26/139 Verifying : rpm-4.18.91-9.fc39.x86_64 27/139 Verifying : rpm-build-libs-4.18.91-9.fc39.x86_64 28/139 Verifying : rpm-libs-4.18.91-9.fc39.x86_64 29/139 Verifying : rpm-sign-libs-4.18.91-9.fc39.x86_64 30/139 Verifying : alternatives-1.24-2.fc39.x86_64 31/139 Verifying : basesystem-11-18.fc39.noarch 32/139 Verifying : bash-5.2.15-5.fc39.x86_64 33/139 Verifying : bzip2-libs-1.0.8-16.fc39.x86_64 34/139 Verifying : ca-certificates-2023.2.60-3.fc39.noarch 35/139 Verifying : coreutils-9.3-2.fc39.x86_64 36/139 Verifying : coreutils-common-9.3-2.fc39.x86_64 37/139 Verifying : crypto-policies-20230614-2.git5f3458e.fc39.noarc 38/139 Verifying : curl-8.2.1-1.fc39.x86_64 39/139 Verifying : cyrus-sasl-lib-2.1.28-11.fc39.x86_64 40/139 Verifying : dbus-libs-1:1.14.8-2.fc39.x86_64 41/139 Verifying : elfutils-default-yama-scope-0.189-4.fc39.noarch 42/139 Verifying : elfutils-libelf-0.189-4.fc39.x86_64 43/139 Verifying : elfutils-libs-0.189-4.fc39.x86_64 44/139 Verifying : expat-2.5.0-3.fc39.x86_64 45/139 Verifying : fedora-gpg-keys-39-0.4.noarch 46/139 Verifying : fedora-release-39-0.21.noarch 47/139 Verifying : fedora-release-common-39-0.21.noarch 48/139 Verifying : fedora-release-identity-basic-39-0.21.noarch 49/139 Verifying : fedora-repos-39-0.4.noarch 50/139 Verifying : fedora-repos-rawhide-39-0.4.noarch 51/139 Verifying : filesystem-3.18-6.fc39.x86_64 52/139 Verifying : findutils-1:4.9.0-5.fc39.x86_64 53/139 Verifying : fmt-10.0.0-3.fc39.x86_64 54/139 Verifying : gawk-5.2.2-2.fc39.x86_64 55/139 Verifying : gdbm-libs-1:1.23-4.fc39.x86_64 56/139 Verifying : glib2-2.77.0-8.fc39.x86_64 57/139 Verifying : glibc-2.37.9000-18.fc39.x86_64 58/139 Verifying : glibc-common-2.37.9000-18.fc39.x86_64 59/139 Verifying : glibc-minimal-langpack-2.37.9000-18.fc39.x86_64 60/139 Verifying : gmp-1:6.2.1-5.fc39.x86_64 61/139 Verifying : gnupg2-2.4.3-2.fc39.x86_64 62/139 Verifying : gnutls-3.8.0-7.fc39.x86_64 63/139 Verifying : gpgme-1.20.0-5.fc39.x86_64 64/139 Verifying : grep-3.11-3.fc39.x86_64 65/139 Verifying : ima-evm-utils-1.5-2.fc39.x86_64 66/139 Verifying : json-c-0.16-5.fc39.x86_64 67/139 Verifying : keyutils-libs-1.6.1-7.fc39.x86_64 68/139 Verifying : krb5-libs-1.21-3.fc39.x86_64 69/139 Verifying : libacl-2.3.1-8.fc39.x86_64 70/139 Verifying : libarchive-3.7.0-1.fc39.x86_64 71/139 Verifying : libassuan-2.5.6-2.fc39.x86_64 72/139 Verifying : libattr-2.5.1-8.fc39.x86_64 73/139 Verifying : libb2-0.98.1-9.fc39.x86_64 74/139 Verifying : libcap-2.48-7.fc39.x86_64 75/139 Verifying : libcom_err-1.47.0-2.fc39.x86_64 76/139 Verifying : libcurl-8.2.1-1.fc39.x86_64 77/139 Verifying : libdnf5-5.1.0-2.fc39.x86_64 78/139 Verifying : libeconf-0.4.0-6.fc39.x86_64 79/139 Verifying : libevent-2.1.12-9.fc39.x86_64 80/139 Verifying : libffi-3.4.4-4.fc39.x86_64 81/139 Verifying : libfsverity-1.4-10.fc39.x86_64 82/139 Verifying : libgcc-13.2.1-1.fc39.x86_64 83/139 Verifying : libgcrypt-1.10.2-2.fc39.x86_64 84/139 Verifying : libgomp-13.2.1-1.fc39.x86_64 85/139 Verifying : libgpg-error-1.47-2.fc39.x86_64 86/139 Verifying : libidn2-2.3.4-3.fc39.x86_64 87/139 Verifying : libksba-1.6.4-2.fc39.x86_64 88/139 Verifying : libnghttp2-1.55.1-2.fc39.x86_64 89/139 Verifying : libnsl2-2.0.0-6.fc39.x86_64 90/139 Verifying : libpsl-0.21.2-4.fc39.x86_64 91/139 Verifying : libsepol-3.5-2.fc39.x86_64 92/139 Verifying : libsigsegv-2.14-5.fc39.x86_64 93/139 Verifying : libssh-0.10.5-2.fc39.x86_64 94/139 Verifying : libssh-config-0.10.5-2.fc39.noarch 95/139 Verifying : libstdc++-13.2.1-1.fc39.x86_64 96/139 Verifying : libtasn1-4.19.0-3.fc39.x86_64 97/139 Verifying : libtirpc-1.3.3-1.rc1.fc39.1.x86_64 98/139 Verifying : libunistring-1.1-4.fc39.x86_64 99/139 Verifying : libverto-0.3.2-6.fc39.x86_64 100/139 Verifying : libxcrypt-4.4.36-2.fc39.x86_64 101/139 Verifying : libyaml-0.2.5-12.fc39.x86_64 102/139 Verifying : libzstd-1.5.5-4.fc39.x86_64 103/139 Verifying : lua-libs-5.4.4-9.fc39.x86_64 104/139 Verifying : lz4-libs-1.9.4-4.fc39.x86_64 105/139 Verifying : mpdecimal-2.5.1-7.fc39.x86_64 106/139 Verifying : mpfr-4.2.0-3.fc39.x86_64 107/139 Verifying : ncurses-base-6.4-6.20230520.fc39.noarch 108/139 Verifying : ncurses-libs-6.4-6.20230520.fc39.x86_64 109/139 Verifying : nettle-3.9.1-2.fc39.x86_64 110/139 Verifying : npth-1.6-14.fc39.x86_64 111/139 Verifying : openldap-2.6.5-1.fc39.x86_64 112/139 Verifying : openssl-libs-1:3.0.8-4.fc39.x86_64 113/139 Verifying : p11-kit-0.25.0-2.fc39.x86_64 114/139 Verifying : p11-kit-trust-0.25.0-2.fc39.x86_64 115/139 Verifying : pcre2-10.42-1.fc39.2.x86_64 116/139 Verifying : pcre2-syntax-10.42-1.fc39.2.noarch 117/139 Verifying : popt-1.19-3.fc39.x86_64 118/139 Verifying : publicsuffix-list-dafsa-20230614-2.fc39.noarch 119/139 Verifying : python3-3.12.0~b4-2.fc39.x86_64 120/139 Verifying : python3-dateutil-1:2.8.2-10.fc39.noarch 121/139 Verifying : python3-dbus-1.3.2-4.fc39.x86_64 122/139 Verifying : python3-distro-1.8.0-6.fc39.noarch 123/139 Verifying : python3-gpg-1.20.0-5.fc39.x86_64 124/139 Verifying : python3-libs-3.12.0~b4-2.fc39.x86_64 125/139 Verifying : python3-six-1.16.0-12.fc39.noarch 126/139 Verifying : python3-systemd-235-5.fc39.x86_64 127/139 Verifying : readline-8.2-4.fc39.x86_64 128/139 Verifying : rpm-sequoia-1.4.1-2.fc39.x86_64 129/139 Verifying : sed-4.8-14.fc39.x86_64 130/139 Verifying : setup-2.14.4-1.fc39.noarch 131/139 Verifying : shadow-utils-2:4.13-8.fc39.x86_64 132/139 Verifying : sqlite-libs-3.42.0-7.fc39.x86_64 133/139 Verifying : systemd-libs-254-1.fc39.x86_64 134/139 Verifying : tpm2-tss-4.0.1-4.fc39.x86_64 135/139 Verifying : tzdata-2023c-2.fc39.noarch 136/139 Verifying : xz-libs-5.4.3-2.fc39.x86_64 137/139 Verifying : zchunk-libs-1.3.1-2.fc39.x86_64 138/139 Verifying : zlib-1.2.13-4.fc39.x86_64 139/139 Installed products updated. Installed: alternatives-1.24-2.fc39.x86_64 audit-libs-3.1.1-4.fc39.x86_64 basesystem-11-18.fc39.noarch bash-5.2.15-5.fc39.x86_64 bzip2-libs-1.0.8-16.fc39.x86_64 ca-certificates-2023.2.60-3.fc39.noarch coreutils-9.3-2.fc39.x86_64 coreutils-common-9.3-2.fc39.x86_64 crypto-policies-20230614-2.git5f3458e.fc39.noarch curl-8.2.1-1.fc39.x86_64 cyrus-sasl-lib-2.1.28-11.fc39.x86_64 dbus-libs-1:1.14.8-2.fc39.x86_64 dnf-data-4.16.2-1.fc39.noarch dnf-plugins-core-4.4.2-1.fc39.noarch elfutils-default-yama-scope-0.189-4.fc39.noarch elfutils-libelf-0.189-4.fc39.x86_64 elfutils-libs-0.189-4.fc39.x86_64 expat-2.5.0-3.fc39.x86_64 fedora-gpg-keys-39-0.4.noarch fedora-release-39-0.21.noarch fedora-release-common-39-0.21.noarch fedora-release-identity-basic-39-0.21.noarch fedora-repos-39-0.4.noarch fedora-repos-rawhide-39-0.4.noarch file-libs-5.44-5.fc39.x86_64 filesystem-3.18-6.fc39.x86_64 findutils-1:4.9.0-5.fc39.x86_64 fmt-10.0.0-3.fc39.x86_64 gawk-5.2.2-2.fc39.x86_64 gdbm-libs-1:1.23-4.fc39.x86_64 glib2-2.77.0-8.fc39.x86_64 glibc-2.37.9000-18.fc39.x86_64 glibc-common-2.37.9000-18.fc39.x86_64 glibc-minimal-langpack-2.37.9000-18.fc39.x86_64 gmp-1:6.2.1-5.fc39.x86_64 gnupg2-2.4.3-2.fc39.x86_64 gnutls-3.8.0-7.fc39.x86_64 gpgme-1.20.0-5.fc39.x86_64 grep-3.11-3.fc39.x86_64 ima-evm-utils-1.5-2.fc39.x86_64 json-c-0.16-5.fc39.x86_64 keyutils-libs-1.6.1-7.fc39.x86_64 krb5-libs-1.21-3.fc39.x86_64 libacl-2.3.1-8.fc39.x86_64 libarchive-3.7.0-1.fc39.x86_64 libassuan-2.5.6-2.fc39.x86_64 libattr-2.5.1-8.fc39.x86_64 libb2-0.98.1-9.fc39.x86_64 libblkid-2.39.1-3.fc39.x86_64 libbrotli-1.0.9-13.fc39.x86_64 libcap-2.48-7.fc39.x86_64 libcap-ng-0.8.3-7.fc39.x86_64 libcom_err-1.47.0-2.fc39.x86_64 libcomps-0.1.19-3.fc39.x86_64 libcurl-8.2.1-1.fc39.x86_64 libdnf-0.70.2-1.fc39.x86_64 libdnf5-5.1.0-2.fc39.x86_64 libeconf-0.4.0-6.fc39.x86_64 libevent-2.1.12-9.fc39.x86_64 libffi-3.4.4-4.fc39.x86_64 libfsverity-1.4-10.fc39.x86_64 libgcc-13.2.1-1.fc39.x86_64 libgcrypt-1.10.2-2.fc39.x86_64 libgomp-13.2.1-1.fc39.x86_64 libgpg-error-1.47-2.fc39.x86_64 libidn2-2.3.4-3.fc39.x86_64 libksba-1.6.4-2.fc39.x86_64 libmodulemd-2.15.0-5.fc39.x86_64 libmount-2.39.1-3.fc39.x86_64 libnghttp2-1.55.1-2.fc39.x86_64 libnsl2-2.0.0-6.fc39.x86_64 libpsl-0.21.2-4.fc39.x86_64 librepo-1.15.2-1.fc39.x86_64 libreport-filesystem-2.17.11-3.fc39.noarch libselinux-3.5-5.fc39.x86_64 libsemanage-3.5-4.fc39.x86_64 libsepol-3.5-2.fc39.x86_64 libsigsegv-2.14-5.fc39.x86_64 libsmartcols-2.39.1-3.fc39.x86_64 libsolv-0.7.24-8.fc39.x86_64 libssh-0.10.5-2.fc39.x86_64 libssh-config-0.10.5-2.fc39.noarch libstdc++-13.2.1-1.fc39.x86_64 libtasn1-4.19.0-3.fc39.x86_64 libtirpc-1.3.3-1.rc1.fc39.1.x86_64 libunistring-1.1-4.fc39.x86_64 libuuid-2.39.1-3.fc39.x86_64 libverto-0.3.2-6.fc39.x86_64 libxcrypt-4.4.36-2.fc39.x86_64 libxml2-2.10.4-3.fc39.x86_64 libyaml-0.2.5-12.fc39.x86_64 libzstd-1.5.5-4.fc39.x86_64 lua-libs-5.4.4-9.fc39.x86_64 lz4-libs-1.9.4-4.fc39.x86_64 mpdecimal-2.5.1-7.fc39.x86_64 mpfr-4.2.0-3.fc39.x86_64 ncurses-base-6.4-6.20230520.fc39.noarch ncurses-libs-6.4-6.20230520.fc39.x86_64 nettle-3.9.1-2.fc39.x86_64 npth-1.6-14.fc39.x86_64 openldap-2.6.5-1.fc39.x86_64 openssl-libs-1:3.0.8-4.fc39.x86_64 p11-kit-0.25.0-2.fc39.x86_64 p11-kit-trust-0.25.0-2.fc39.x86_64 pcre2-10.42-1.fc39.2.x86_64 pcre2-syntax-10.42-1.fc39.2.noarch popt-1.19-3.fc39.x86_64 publicsuffix-list-dafsa-20230614-2.fc39.noarch python-pip-wheel-23.1.2-5.fc39.noarch python3-3.12.0~b4-2.fc39.x86_64 python3-dateutil-1:2.8.2-10.fc39.noarch python3-dbus-1.3.2-4.fc39.x86_64 python3-distro-1.8.0-6.fc39.noarch python3-dnf-4.16.2-1.fc39.noarch python3-dnf-plugins-core-4.4.2-1.fc39.noarch python3-gpg-1.20.0-5.fc39.x86_64 python3-hawkey-0.70.2-1.fc39.x86_64 python3-libcomps-0.1.19-3.fc39.x86_64 python3-libdnf-0.70.2-1.fc39.x86_64 python3-libs-3.12.0~b4-2.fc39.x86_64 python3-rpm-4.18.91-9.fc39.x86_64 python3-six-1.16.0-12.fc39.noarch python3-systemd-235-5.fc39.x86_64 readline-8.2-4.fc39.x86_64 rpm-4.18.91-9.fc39.x86_64 rpm-build-libs-4.18.91-9.fc39.x86_64 rpm-libs-4.18.91-9.fc39.x86_64 rpm-sequoia-1.4.1-2.fc39.x86_64 rpm-sign-libs-4.18.91-9.fc39.x86_64 sed-4.8-14.fc39.x86_64 setup-2.14.4-1.fc39.noarch shadow-utils-2:4.13-8.fc39.x86_64 sqlite-libs-3.42.0-7.fc39.x86_64 systemd-libs-254-1.fc39.x86_64 tpm2-tss-4.0.1-4.fc39.x86_64 tzdata-2023c-2.fc39.noarch xz-libs-5.4.3-2.fc39.x86_64 zchunk-libs-1.3.1-2.fc39.x86_64 zlib-1.2.13-4.fc39.x86_64 Complete! Finish(bootstrap): installing dnf tooling Start(bootstrap): creating root cache Finish(bootstrap): creating root cache Finish(bootstrap): chroot init Start: chroot init INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root. INFO: calling preinit hooks INFO: enabled root cache INFO: enabled package manager cache Start: cleaning package manager metadata Finish: cleaning package manager metadata INFO: enabled HW Info plugin Mock Version: 4.1 INFO: Mock Version: 4.1 INFO: Package manager dnf detected and used (direct choice) Start: installing minimal buildroot with dnf No matches found for the following disable plugin patterns: local, spacewalk, versionlock Copr repository 22 MB/s | 14 MB 00:00 fedora 17 MB/s | 73 MB 00:04 Last metadata expiration check: 0:00:03 ago on Tue Aug 1 09:50:42 2023. Dependencies resolved. ================================================================================ Package Arch Version Repo Size ================================================================================ Installing group/module packages: bash x86_64 5.2.15-5.fc39 fedora 1.8 M bzip2 x86_64 1.0.8-16.fc39 fedora 52 k coreutils x86_64 9.3-2.fc39 fedora 1.1 M cpio x86_64 2.14-4.fc39 fedora 279 k diffutils x86_64 3.10-3.fc39 fedora 398 k fedora-release-common noarch 39-0.21 fedora 17 k findutils x86_64 1:4.9.0-5.fc39 fedora 492 k gawk x86_64 5.2.2-2.fc39 fedora 1.1 M glibc-minimal-langpack x86_64 2.37.9000-18.fc39 fedora 64 k grep x86_64 3.11-3.fc39 fedora 298 k gzip x86_64 1.12-5.fc39 fedora 166 k info x86_64 7.0.3-3.fc39 fedora 182 k patch x86_64 2.7.6-22.fc39 fedora 125 k redhat-rpm-config noarch 261-1.fc39 fedora 84 k rpm-build x86_64 4.18.91-9.fc39 copr_base 70 k sed x86_64 4.8-14.fc39 fedora 306 k shadow-utils x86_64 2:4.13-8.fc39 fedora 1.3 M tar x86_64 2:1.35-1.fc39 fedora 862 k unzip x86_64 6.0-62.fc39 fedora 184 k util-linux x86_64 2.39.1-3.fc39 copr_base 1.1 M which x86_64 2.21-40.fc39 fedora 42 k xz x86_64 5.4.3-2.fc39 fedora 554 k Installing dependencies: alternatives x86_64 1.24-2.fc39 fedora 39 k ansible-srpm-macros noarch 1-11.fc39 fedora 21 k audit-libs x86_64 3.1.1-4.fc39 copr_base 117 k authselect x86_64 1.4.2-3.fc39 fedora 144 k authselect-libs x86_64 1.4.2-3.fc39 fedora 249 k basesystem noarch 11-18.fc39 fedora 7.2 k binutils x86_64 2.40-13.fc39 fedora 5.6 M binutils-gold x86_64 2.40-13.fc39 fedora 797 k bzip2-libs x86_64 1.0.8-16.fc39 fedora 41 k ca-certificates noarch 2023.2.60-3.fc39 fedora 840 k coreutils-common x86_64 9.3-2.fc39 fedora 2.1 M cracklib x86_64 2.9.11-2.fc39 fedora 94 k crypto-policies noarch 20230614-2.git5f3458e.fc39 fedora 93 k curl x86_64 8.2.1-1.fc39 fedora 346 k cyrus-sasl-lib x86_64 2.1.28-11.fc39 fedora 793 k debugedit x86_64 5.0-10.fc39 fedora 77 k dwz x86_64 0.15-3.fc39 fedora 134 k ed x86_64 1.19-4.fc39 fedora 79 k efi-srpm-macros noarch 5-9.fc39 fedora 22 k elfutils x86_64 0.189-4.fc39 fedora 537 k elfutils-debuginfod-client x86_64 0.189-4.fc39 fedora 38 k elfutils-default-yama-scope noarch 0.189-4.fc39 fedora 13 k elfutils-libelf x86_64 0.189-4.fc39 fedora 194 k elfutils-libs x86_64 0.189-4.fc39 fedora 258 k fedora-gpg-keys noarch 39-0.4 fedora 128 k fedora-release noarch 39-0.21 fedora 6.9 k fedora-release-identity-basic noarch 39-0.21 fedora 7.6 k fedora-repos noarch 39-0.4 fedora 9.3 k fedora-repos-rawhide noarch 39-0.4 fedora 8.9 k file x86_64 5.44-5.fc39 copr_base 50 k file-libs x86_64 5.44-5.fc39 copr_base 730 k filesystem x86_64 3.18-6.fc39 fedora 1.1 M fonts-srpm-macros noarch 1:2.0.5-12.fc39 fedora 26 k fpc-srpm-macros noarch 1.3-8.fc39 fedora 7.4 k gdb-minimal x86_64 13.2-6.fc39 fedora 4.2 M gdbm-libs x86_64 1:1.23-4.fc39 fedora 56 k ghc-srpm-macros noarch 1.6.1-2.fc39 fedora 7.8 k glibc x86_64 2.37.9000-18.fc39 fedora 2.2 M glibc-common x86_64 2.37.9000-18.fc39 fedora 346 k glibc-gconv-extra x86_64 2.37.9000-18.fc39 fedora 1.6 M gmp x86_64 1:6.2.1-5.fc39 fedora 313 k gnat-srpm-macros noarch 6-3.fc39 fedora 8.8 k go-srpm-macros noarch 3.2.0-6.fc39 fedora 27 k jansson x86_64 2.13.1-7.fc39 fedora 44 k kernel-srpm-macros noarch 1.0-20.fc39 fedora 10 k keyutils-libs x86_64 1.6.1-7.fc39 fedora 31 k krb5-libs x86_64 1.21-3.fc39 fedora 765 k libacl x86_64 2.3.1-8.fc39 fedora 23 k libarchive x86_64 3.7.0-1.fc39 fedora 408 k libattr x86_64 2.5.1-8.fc39 fedora 18 k libblkid x86_64 2.39.1-3.fc39 copr_base 116 k libbrotli x86_64 1.0.9-13.fc39 copr_base 317 k libcap x86_64 2.48-7.fc39 fedora 68 k libcap-ng x86_64 0.8.3-7.fc39 copr_base 33 k libcom_err x86_64 1.47.0-2.fc39 fedora 26 k libcurl x86_64 8.2.1-1.fc39 fedora 324 k libdb x86_64 5.3.28-56.fc39 fedora 760 k libeconf x86_64 0.4.0-6.fc39 fedora 27 k libevent x86_64 2.1.12-9.fc39 fedora 258 k libfdisk x86_64 2.39.1-3.fc39 copr_base 162 k libffi x86_64 3.4.4-4.fc39 fedora 40 k libgcc x86_64 13.2.1-1.fc39 fedora 109 k libgomp x86_64 13.2.1-1.fc39 fedora 319 k libidn2 x86_64 2.3.4-3.fc39 fedora 117 k libmount x86_64 2.39.1-3.fc39 copr_base 155 k libnghttp2 x86_64 1.55.1-2.fc39 fedora 75 k libnsl2 x86_64 2.0.0-6.fc39 fedora 30 k libpkgconf x86_64 1.9.5-2.fc39 fedora 38 k libpsl x86_64 0.21.2-4.fc39 fedora 63 k libpwquality x86_64 1.4.5-6.fc39 copr_base 109 k libselinux x86_64 3.5-5.fc39 copr_base 87 k libsemanage x86_64 3.5-4.fc39 copr_base 120 k libsepol x86_64 3.5-2.fc39 fedora 324 k libsigsegv x86_64 2.14-5.fc39 fedora 27 k libsmartcols x86_64 2.39.1-3.fc39 copr_base 67 k libssh x86_64 0.10.5-2.fc39 fedora 211 k libssh-config noarch 0.10.5-2.fc39 fedora 9.2 k libstdc++ x86_64 13.2.1-1.fc39 fedora 860 k libtasn1 x86_64 4.19.0-3.fc39 fedora 74 k libtirpc x86_64 1.3.3-1.rc1.fc39.1 fedora 94 k libunistring x86_64 1.1-4.fc39 fedora 543 k libutempter x86_64 1.2.1-10.fc39 fedora 26 k libuuid x86_64 2.39.1-3.fc39 copr_base 29 k libverto x86_64 0.3.2-6.fc39 fedora 20 k libxcrypt x86_64 4.4.36-2.fc39 fedora 119 k libxml2 x86_64 2.10.4-3.fc39 copr_base 701 k libzstd x86_64 1.5.5-4.fc39 fedora 309 k lua-libs x86_64 5.4.4-9.fc39 fedora 133 k lua-srpm-macros noarch 1-9.fc39 fedora 8.6 k lz4-libs x86_64 1.9.4-4.fc39 fedora 67 k mpfr x86_64 4.2.0-3.fc39 fedora 344 k ncurses-base noarch 6.4-6.20230520.fc39 fedora 88 k ncurses-libs x86_64 6.4-6.20230520.fc39 fedora 336 k ocaml-srpm-macros noarch 8-2.fc39 fedora 14 k openblas-srpm-macros noarch 2-14.fc39 fedora 7.5 k openldap x86_64 2.6.5-1.fc39 fedora 254 k openssl-libs x86_64 1:3.0.8-4.fc39 fedora 2.1 M p11-kit x86_64 0.25.0-2.fc39 fedora 486 k p11-kit-trust x86_64 0.25.0-2.fc39 fedora 142 k package-notes-srpm-macros noarch 0.5-9.fc39 fedora 11 k pam x86_64 1.5.3-2.fc39 fedora 548 k pam-libs x86_64 1.5.3-2.fc39 fedora 58 k pcre2 x86_64 10.42-1.fc39.2 fedora 233 k pcre2-syntax noarch 10.42-1.fc39.2 fedora 143 k perl-srpm-macros noarch 1-51.fc39 fedora 8.0 k pkgconf x86_64 1.9.5-2.fc39 fedora 42 k pkgconf-m4 noarch 1.9.5-2.fc39 fedora 14 k pkgconf-pkg-config x86_64 1.9.5-2.fc39 fedora 9.6 k popt x86_64 1.19-3.fc39 fedora 66 k publicsuffix-list-dafsa noarch 20230614-2.fc39 fedora 57 k pyproject-srpm-macros noarch 1.9.0-2.fc39 fedora 14 k python-srpm-macros noarch 3.12-2.fc39 fedora 25 k qt5-srpm-macros noarch 5.15.10-2.fc39 fedora 8.3 k qt6-srpm-macros noarch 6.5.2-2.fc39 fedora 9.2 k readline x86_64 8.2-4.fc39 fedora 213 k rpm x86_64 4.18.91-9.fc39 copr_base 499 k rpm-build-libs x86_64 4.18.91-9.fc39 copr_base 96 k rpm-libs x86_64 4.18.91-9.fc39 copr_base 310 k rpm-sequoia x86_64 1.4.1-2.fc39 fedora 869 k rpmautospec-rpm-macros noarch 0.3.5-4.fc39 fedora 8.8 k rust-srpm-macros noarch 24-3.fc39 fedora 12 k setup noarch 2.14.4-1.fc39 fedora 154 k sqlite-libs x86_64 3.42.0-7.fc39 fedora 678 k systemd-libs x86_64 254-1.fc39 fedora 685 k tzdata noarch 2023c-2.fc39 fedora 717 k util-linux-core x86_64 2.39.1-3.fc39 copr_base 479 k xxhash-libs x86_64 0.8.2-1.fc39 fedora 37 k xz-libs x86_64 5.4.3-2.fc39 fedora 108 k zip x86_64 3.0-38.fc39 fedora 266 k zlib x86_64 1.2.13-4.fc39 fedora 94 k zstd x86_64 1.5.5-4.fc39 fedora 482 k Installing Groups: Buildsystem building group Transaction Summary ================================================================================ Install 153 Packages Total download size: 52 M Installed size: 179 M Downloading Packages: (1/153): file-5.44-5.fc39.x86_64.rpm 276 kB/s | 50 kB 00:00 (2/153): audit-libs-3.1.1-4.fc39.x86_64.rpm 613 kB/s | 117 kB 00:00 (3/153): libblkid-2.39.1-3.fc39.x86_64.rpm 1.9 MB/s | 116 kB 00:00 (4/153): libbrotli-1.0.9-13.fc39.x86_64.rpm 2.8 MB/s | 317 kB 00:00 (5/153): libcap-ng-0.8.3-7.fc39.x86_64.rpm 500 kB/s | 33 kB 00:00 (6/153): file-libs-5.44-5.fc39.x86_64.rpm 2.1 MB/s | 730 kB 00:00 (7/153): libfdisk-2.39.1-3.fc39.x86_64.rpm 3.6 MB/s | 162 kB 00:00 (8/153): libmount-2.39.1-3.fc39.x86_64.rpm 3.0 MB/s | 155 kB 00:00 (9/153): libpwquality-1.4.5-6.fc39.x86_64.rpm 3.0 MB/s | 109 kB 00:00 (10/153): libselinux-3.5-5.fc39.x86_64.rpm 2.3 MB/s | 87 kB 00:00 (11/153): libsemanage-3.5-4.fc39.x86_64.rpm 3.6 MB/s | 120 kB 00:00 (12/153): libsmartcols-2.39.1-3.fc39.x86_64.rpm 2.8 MB/s | 67 kB 00:00 (13/153): libuuid-2.39.1-3.fc39.x86_64.rpm 1.5 MB/s | 29 kB 00:00 (14/153): libxml2-2.10.4-3.fc39.x86_64.rpm 14 MB/s | 701 kB 00:00 (15/153): rpm-4.18.91-9.fc39.x86_64.rpm 8.7 MB/s | 499 kB 00:00 (16/153): rpm-build-4.18.91-9.fc39.x86_64.rpm 1.4 MB/s | 70 kB 00:00 (17/153): rpm-build-libs-4.18.91-9.fc39.x86_64. 2.9 MB/s | 96 kB 00:00 (18/153): rpm-libs-4.18.91-9.fc39.x86_64.rpm 8.5 MB/s | 310 kB 00:00 (19/153): util-linux-2.39.1-3.fc39.x86_64.rpm 17 MB/s | 1.1 MB 00:00 (20/153): util-linux-core-2.39.1-3.fc39.x86_64. 8.5 MB/s | 479 kB 00:00 (21/153): ansible-srpm-macros-1-11.fc39.noarch. 57 kB/s | 21 kB 00:00 (22/153): alternatives-1.24-2.fc39.x86_64.rpm 80 kB/s | 39 kB 00:00 (23/153): basesystem-11-18.fc39.noarch.rpm 71 kB/s | 7.2 kB 00:00 (24/153): authselect-1.4.2-3.fc39.x86_64.rpm 217 kB/s | 144 kB 00:00 (25/153): authselect-libs-1.4.2-3.fc39.x86_64.r 371 kB/s | 249 kB 00:00 (26/153): binutils-gold-2.40-13.fc39.x86_64.rpm 1.2 MB/s | 797 kB 00:00 (27/153): bzip2-1.0.8-16.fc39.x86_64.rpm 439 kB/s | 52 kB 00:00 (28/153): bash-5.2.15-5.fc39.x86_64.rpm 1.4 MB/s | 1.8 MB 00:01 (29/153): bzip2-libs-1.0.8-16.fc39.x86_64.rpm 374 kB/s | 41 kB 00:00 (30/153): ca-certificates-2023.2.60-3.fc39.noar 3.4 MB/s | 840 kB 00:00 (31/153): binutils-2.40-13.fc39.x86_64.rpm 3.7 MB/s | 5.6 MB 00:01 (32/153): cpio-2.14-4.fc39.x86_64.rpm 2.4 MB/s | 279 kB 00:00 (33/153): coreutils-9.3-2.fc39.x86_64.rpm 2.4 MB/s | 1.1 MB 00:00 (34/153): cracklib-2.9.11-2.fc39.x86_64.rpm 832 kB/s | 94 kB 00:00 (35/153): coreutils-common-9.3-2.fc39.x86_64.rp 6.0 MB/s | 2.1 MB 00:00 (36/153): crypto-policies-20230614-2.git5f3458e 778 kB/s | 93 kB 00:00 (37/153): curl-8.2.1-1.fc39.x86_64.rpm 2.8 MB/s | 346 kB 00:00 (38/153): cyrus-sasl-lib-2.1.28-11.fc39.x86_64. 6.4 MB/s | 793 kB 00:00 (39/153): debugedit-5.0-10.fc39.x86_64.rpm 641 kB/s | 77 kB 00:00 (40/153): diffutils-3.10-3.fc39.x86_64.rpm 3.3 MB/s | 398 kB 00:00 (41/153): dwz-0.15-3.fc39.x86_64.rpm 1.1 MB/s | 134 kB 00:00 (42/153): ed-1.19-4.fc39.x86_64.rpm 638 kB/s | 79 kB 00:00 (43/153): efi-srpm-macros-5-9.fc39.noarch.rpm 189 kB/s | 22 kB 00:00 (44/153): elfutils-0.189-4.fc39.x86_64.rpm 4.3 MB/s | 537 kB 00:00 (45/153): elfutils-debuginfod-client-0.189-4.fc 320 kB/s | 38 kB 00:00 (46/153): elfutils-default-yama-scope-0.189-4.f 119 kB/s | 13 kB 00:00 (47/153): elfutils-libelf-0.189-4.fc39.x86_64.r 1.7 MB/s | 194 kB 00:00 (48/153): fedora-gpg-keys-39-0.4.noarch.rpm 1.1 MB/s | 128 kB 00:00 (49/153): elfutils-libs-0.189-4.fc39.x86_64.rpm 2.1 MB/s | 258 kB 00:00 (50/153): fedora-release-39-0.21.noarch.rpm 66 kB/s | 6.9 kB 00:00 (51/153): fedora-release-common-39-0.21.noarch. 157 kB/s | 17 kB 00:00 (52/153): fedora-release-identity-basic-39-0.21 67 kB/s | 7.6 kB 00:00 (53/153): fedora-repos-39-0.4.noarch.rpm 83 kB/s | 9.3 kB 00:00 (54/153): fedora-repos-rawhide-39-0.4.noarch.rp 83 kB/s | 8.9 kB 00:00 (55/153): findutils-4.9.0-5.fc39.x86_64.rpm 3.8 MB/s | 492 kB 00:00 (56/153): fonts-srpm-macros-2.0.5-12.fc39.noarc 226 kB/s | 26 kB 00:00 (57/153): fpc-srpm-macros-1.3-8.fc39.noarch.rpm 75 kB/s | 7.4 kB 00:00 (58/153): gawk-5.2.2-2.fc39.x86_64.rpm 9.8 MB/s | 1.1 MB 00:00 (59/153): filesystem-3.18-6.fc39.x86_64.rpm 3.2 MB/s | 1.1 MB 00:00 (60/153): gdbm-libs-1.23-4.fc39.x86_64.rpm 590 kB/s | 56 kB 00:00 (61/153): ghc-srpm-macros-1.6.1-2.fc39.noarch.r 70 kB/s | 7.8 kB 00:00 (62/153): glibc-common-2.37.9000-18.fc39.x86_64 3.2 MB/s | 346 kB 00:00 (63/153): glibc-2.37.9000-18.fc39.x86_64.rpm 9.4 MB/s | 2.2 MB 00:00 (64/153): gdb-minimal-13.2-6.fc39.x86_64.rpm 9.5 MB/s | 4.2 MB 00:00 (65/153): glibc-minimal-langpack-2.37.9000-18.f 663 kB/s | 64 kB 00:00 (66/153): gmp-6.2.1-5.fc39.x86_64.rpm 2.6 MB/s | 313 kB 00:00 (67/153): gnat-srpm-macros-6-3.fc39.noarch.rpm 80 kB/s | 8.8 kB 00:00 (68/153): glibc-gconv-extra-2.37.9000-18.fc39.x 4.6 MB/s | 1.6 MB 00:00 (69/153): go-srpm-macros-3.2.0-6.fc39.noarch.rp 277 kB/s | 27 kB 00:00 (70/153): grep-3.11-3.fc39.x86_64.rpm 2.9 MB/s | 298 kB 00:00 (71/153): gzip-1.12-5.fc39.x86_64.rpm 1.6 MB/s | 166 kB 00:00 (72/153): info-7.0.3-3.fc39.x86_64.rpm 1.6 MB/s | 182 kB 00:00 (73/153): jansson-2.13.1-7.fc39.x86_64.rpm 431 kB/s | 44 kB 00:00 (74/153): kernel-srpm-macros-1.0-20.fc39.noarch 97 kB/s | 10 kB 00:00 (75/153): keyutils-libs-1.6.1-7.fc39.x86_64.rpm 276 kB/s | 31 kB 00:00 (76/153): krb5-libs-1.21-3.fc39.x86_64.rpm 6.6 MB/s | 765 kB 00:00 (77/153): libacl-2.3.1-8.fc39.x86_64.rpm 208 kB/s | 23 kB 00:00 (78/153): libattr-2.5.1-8.fc39.x86_64.rpm 182 kB/s | 18 kB 00:00 (79/153): libarchive-3.7.0-1.fc39.x86_64.rpm 3.8 MB/s | 408 kB 00:00 (80/153): libcap-2.48-7.fc39.x86_64.rpm 683 kB/s | 68 kB 00:00 (81/153): libcom_err-1.47.0-2.fc39.x86_64.rpm 272 kB/s | 26 kB 00:00 (82/153): libcurl-8.2.1-1.fc39.x86_64.rpm 3.2 MB/s | 324 kB 00:00 (83/153): libdb-5.3.28-56.fc39.x86_64.rpm 6.6 MB/s | 760 kB 00:00 (84/153): libeconf-0.4.0-6.fc39.x86_64.rpm 262 kB/s | 27 kB 00:00 (85/153): libevent-2.1.12-9.fc39.x86_64.rpm 2.4 MB/s | 258 kB 00:00 (86/153): libffi-3.4.4-4.fc39.x86_64.rpm 401 kB/s | 40 kB 00:00 (87/153): libgcc-13.2.1-1.fc39.x86_64.rpm 1.1 MB/s | 109 kB 00:00 (88/153): libgomp-13.2.1-1.fc39.x86_64.rpm 3.1 MB/s | 319 kB 00:00 (89/153): libidn2-2.3.4-3.fc39.x86_64.rpm 1.1 MB/s | 117 kB 00:00 (90/153): libnghttp2-1.55.1-2.fc39.x86_64.rpm 726 kB/s | 75 kB 00:00 (91/153): libnsl2-2.0.0-6.fc39.x86_64.rpm 275 kB/s | 30 kB 00:00 (92/153): libpkgconf-1.9.5-2.fc39.x86_64.rpm 382 kB/s | 38 kB 00:00 (93/153): libpsl-0.21.2-4.fc39.x86_64.rpm 662 kB/s | 63 kB 00:00 (94/153): libsepol-3.5-2.fc39.x86_64.rpm 3.2 MB/s | 324 kB 00:00 (95/153): libsigsegv-2.14-5.fc39.x86_64.rpm 269 kB/s | 27 kB 00:00 (96/153): libssh-0.10.5-2.fc39.x86_64.rpm 2.1 MB/s | 211 kB 00:00 (97/153): libssh-config-0.10.5-2.fc39.noarch.rp 91 kB/s | 9.2 kB 00:00 (98/153): libstdc++-13.2.1-1.fc39.x86_64.rpm 7.1 MB/s | 860 kB 00:00 (99/153): libtasn1-4.19.0-3.fc39.x86_64.rpm 691 kB/s | 74 kB 00:00 (100/153): libtirpc-1.3.3-1.rc1.fc39.1.x86_64.r 905 kB/s | 94 kB 00:00 (101/153): libutempter-1.2.1-10.fc39.x86_64.rpm 274 kB/s | 26 kB 00:00 (102/153): libunistring-1.1-4.fc39.x86_64.rpm 5.1 MB/s | 543 kB 00:00 (103/153): libverto-0.3.2-6.fc39.x86_64.rpm 205 kB/s | 20 kB 00:00 (104/153): libxcrypt-4.4.36-2.fc39.x86_64.rpm 1.2 MB/s | 119 kB 00:00 (105/153): libzstd-1.5.5-4.fc39.x86_64.rpm 2.9 MB/s | 309 kB 00:00 (106/153): lua-libs-5.4.4-9.fc39.x86_64.rpm 1.2 MB/s | 133 kB 00:00 (107/153): lua-srpm-macros-1-9.fc39.noarch.rpm 82 kB/s | 8.6 kB 00:00 (108/153): lz4-libs-1.9.4-4.fc39.x86_64.rpm 628 kB/s | 67 kB 00:00 (109/153): mpfr-4.2.0-3.fc39.x86_64.rpm 3.0 MB/s | 344 kB 00:00 (110/153): ncurses-base-6.4-6.20230520.fc39.noa 752 kB/s | 88 kB 00:00 (111/153): ncurses-libs-6.4-6.20230520.fc39.x86 2.6 MB/s | 336 kB 00:00 (112/153): ocaml-srpm-macros-8-2.fc39.noarch.rp 111 kB/s | 14 kB 00:00 (113/153): openblas-srpm-macros-2-14.fc39.noarc 63 kB/s | 7.5 kB 00:00 (114/153): openldap-2.6.5-1.fc39.x86_64.rpm 2.0 MB/s | 254 kB 00:00 (115/153): p11-kit-0.25.0-2.fc39.x86_64.rpm 3.7 MB/s | 486 kB 00:00 (116/153): p11-kit-trust-0.25.0-2.fc39.x86_64.r 1.2 MB/s | 142 kB 00:00 (117/153): package-notes-srpm-macros-0.5-9.fc39 107 kB/s | 11 kB 00:00 (118/153): pam-1.5.3-2.fc39.x86_64.rpm 4.3 MB/s | 548 kB 00:00 (119/153): pam-libs-1.5.3-2.fc39.x86_64.rpm 460 kB/s | 58 kB 00:00 (120/153): patch-2.7.6-22.fc39.x86_64.rpm 971 kB/s | 125 kB 00:00 (121/153): pcre2-10.42-1.fc39.2.x86_64.rpm 1.9 MB/s | 233 kB 00:00 (122/153): pcre2-syntax-10.42-1.fc39.2.noarch.r 1.3 MB/s | 143 kB 00:00 (123/153): perl-srpm-macros-1-51.fc39.noarch.rp 78 kB/s | 8.0 kB 00:00 (124/153): pkgconf-1.9.5-2.fc39.x86_64.rpm 357 kB/s | 42 kB 00:00 (125/153): pkgconf-m4-1.9.5-2.fc39.noarch.rpm 129 kB/s | 14 kB 00:00 (126/153): pkgconf-pkg-config-1.9.5-2.fc39.x86_ 81 kB/s | 9.6 kB 00:00 (127/153): popt-1.19-3.fc39.x86_64.rpm 632 kB/s | 66 kB 00:00 (128/153): publicsuffix-list-dafsa-20230614-2.f 575 kB/s | 57 kB 00:00 (129/153): pyproject-srpm-macros-1.9.0-2.fc39.n 135 kB/s | 14 kB 00:00 (130/153): python-srpm-macros-3.12-2.fc39.noarc 204 kB/s | 25 kB 00:00 (131/153): qt5-srpm-macros-5.15.10-2.fc39.noarc 86 kB/s | 8.3 kB 00:00 (132/153): qt6-srpm-macros-6.5.2-2.fc39.noarch. 84 kB/s | 9.2 kB 00:00 (133/153): readline-8.2-4.fc39.x86_64.rpm 1.6 MB/s | 213 kB 00:00 (134/153): redhat-rpm-config-261-1.fc39.noarch. 748 kB/s | 84 kB 00:00 (135/153): rpm-sequoia-1.4.1-2.fc39.x86_64.rpm 7.4 MB/s | 869 kB 00:00 (136/153): rpmautospec-rpm-macros-0.3.5-4.fc39. 74 kB/s | 8.8 kB 00:00 (137/153): rust-srpm-macros-24-3.fc39.noarch.rp 118 kB/s | 12 kB 00:00 (138/153): sed-4.8-14.fc39.x86_64.rpm 2.7 MB/s | 306 kB 00:00 (139/153): setup-2.14.4-1.fc39.noarch.rpm 1.6 MB/s | 154 kB 00:00 (140/153): sqlite-libs-3.42.0-7.fc39.x86_64.rpm 5.8 MB/s | 678 kB 00:00 (141/153): shadow-utils-4.13-8.fc39.x86_64.rpm 5.8 MB/s | 1.3 MB 00:00 (142/153): systemd-libs-254-1.fc39.x86_64.rpm 6.1 MB/s | 685 kB 00:00 (143/153): tar-1.35-1.fc39.x86_64.rpm 7.1 MB/s | 862 kB 00:00 (144/153): tzdata-2023c-2.fc39.noarch.rpm 5.7 MB/s | 717 kB 00:00 (145/153): unzip-6.0-62.fc39.x86_64.rpm 1.5 MB/s | 184 kB 00:00 (146/153): which-2.21-40.fc39.x86_64.rpm 358 kB/s | 42 kB 00:00 (147/153): xxhash-libs-0.8.2-1.fc39.x86_64.rpm 285 kB/s | 37 kB 00:00 (148/153): xz-libs-5.4.3-2.fc39.x86_64.rpm 913 kB/s | 108 kB 00:00 (149/153): zip-3.0-38.fc39.x86_64.rpm 2.3 MB/s | 266 kB 00:00 (150/153): zlib-1.2.13-4.fc39.x86_64.rpm 940 kB/s | 94 kB 00:00 (151/153): openssl-libs-3.0.8-4.fc39.x86_64.rpm 869 kB/s | 2.1 MB 00:02 (152/153): zstd-1.5.5-4.fc39.x86_64.rpm 4.2 MB/s | 482 kB 00:00 (153/153): xz-5.4.3-2.fc39.x86_64.rpm 653 kB/s | 554 kB 00:00 -------------------------------------------------------------------------------- Total 5.8 MB/s | 52 MB 00:08 fedora 1.6 MB/s | 1.6 kB 00:00 Importing GPG key 0x18B8E74C: Userid : "Fedora (39) " Fingerprint: E8F2 3996 F232 1864 0CB4 4CBE 75CF 5AC4 18B8 E74C From : /usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-39-primary Key imported successfully fedora 1.6 MB/s | 1.6 kB 00:00 GPG key at file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-39-primary (0x18B8E74C) is already installed fedora 1.6 MB/s | 1.6 kB 00:00 Importing GPG key 0xEB10B464: Userid : "Fedora (38) " Fingerprint: 6A51 BBAB BA3D 5467 B617 1221 809A 8D7C EB10 B464 From : /usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-38-primary Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Running scriptlet: filesystem-3.18-6.fc39.x86_64 1/1 Preparing : 1/1 Installing : libgcc-13.2.1-1.fc39.x86_64 1/153 Running scriptlet: libgcc-13.2.1-1.fc39.x86_64 1/153 Installing : crypto-policies-20230614-2.git5f3458e.fc39.noarc 2/153 Running scriptlet: crypto-policies-20230614-2.git5f3458e.fc39.noarc 2/153 Installing : tzdata-2023c-2.fc39.noarch 3/153 Installing : fedora-release-identity-basic-39-0.21.noarch 4/153 Installing : fedora-repos-rawhide-39-0.4.noarch 5/153 Installing : fedora-gpg-keys-39-0.4.noarch 6/153 Installing : fedora-repos-39-0.4.noarch 7/153 Installing : fedora-release-common-39-0.21.noarch 8/153 Installing : fedora-release-39-0.21.noarch 9/153 Installing : setup-2.14.4-1.fc39.noarch 10/153 warning: /etc/hosts created as /etc/hosts.rpmnew Running scriptlet: setup-2.14.4-1.fc39.noarch 10/153 Installing : filesystem-3.18-6.fc39.x86_64 11/153 Installing : basesystem-11-18.fc39.noarch 12/153 Installing : rust-srpm-macros-24-3.fc39.noarch 13/153 Installing : qt6-srpm-macros-6.5.2-2.fc39.noarch 14/153 Installing : qt5-srpm-macros-5.15.10-2.fc39.noarch 15/153 Installing : pyproject-srpm-macros-1.9.0-2.fc39.noarch 16/153 Installing : publicsuffix-list-dafsa-20230614-2.fc39.noarch 17/153 Installing : pkgconf-m4-1.9.5-2.fc39.noarch 18/153 Installing : perl-srpm-macros-1-51.fc39.noarch 19/153 Installing : pcre2-syntax-10.42-1.fc39.2.noarch 20/153 Installing : package-notes-srpm-macros-0.5-9.fc39.noarch 21/153 Installing : openblas-srpm-macros-2-14.fc39.noarch 22/153 Installing : ocaml-srpm-macros-8-2.fc39.noarch 23/153 Installing : ncurses-base-6.4-6.20230520.fc39.noarch 24/153 Installing : glibc-gconv-extra-2.37.9000-18.fc39.x86_64 25/153 Running scriptlet: glibc-gconv-extra-2.37.9000-18.fc39.x86_64 25/153 Installing : glibc-minimal-langpack-2.37.9000-18.fc39.x86_64 26/153 Installing : glibc-common-2.37.9000-18.fc39.x86_64 27/153 Running scriptlet: glibc-2.37.9000-18.fc39.x86_64 28/153 Installing : glibc-2.37.9000-18.fc39.x86_64 28/153 Running scriptlet: glibc-2.37.9000-18.fc39.x86_64 28/153 Installing : ncurses-libs-6.4-6.20230520.fc39.x86_64 29/153 Installing : bash-5.2.15-5.fc39.x86_64 30/153 Running scriptlet: bash-5.2.15-5.fc39.x86_64 30/153 Installing : zlib-1.2.13-4.fc39.x86_64 31/153 Installing : xz-libs-5.4.3-2.fc39.x86_64 32/153 Installing : bzip2-libs-1.0.8-16.fc39.x86_64 33/153 Installing : libuuid-2.39.1-3.fc39.x86_64 34/153 Installing : libstdc++-13.2.1-1.fc39.x86_64 35/153 Installing : libzstd-1.5.5-4.fc39.x86_64 36/153 Installing : elfutils-libelf-0.189-4.fc39.x86_64 37/153 Installing : popt-1.19-3.fc39.x86_64 38/153 Installing : libblkid-2.39.1-3.fc39.x86_64 39/153 Installing : readline-8.2-4.fc39.x86_64 40/153 Installing : gmp-1:6.2.1-5.fc39.x86_64 41/153 Installing : libattr-2.5.1-8.fc39.x86_64 42/153 Installing : libacl-2.3.1-8.fc39.x86_64 43/153 Installing : libcap-2.48-7.fc39.x86_64 44/153 Installing : libxcrypt-4.4.36-2.fc39.x86_64 45/153 Installing : lz4-libs-1.9.4-4.fc39.x86_64 46/153 Installing : systemd-libs-254-1.fc39.x86_64 47/153 Installing : mpfr-4.2.0-3.fc39.x86_64 48/153 Installing : dwz-0.15-3.fc39.x86_64 49/153 Installing : unzip-6.0-62.fc39.x86_64 50/153 Installing : file-libs-5.44-5.fc39.x86_64 51/153 Installing : file-5.44-5.fc39.x86_64 52/153 Installing : libcap-ng-0.8.3-7.fc39.x86_64 53/153 Installing : audit-libs-3.1.1-4.fc39.x86_64 54/153 Installing : pam-libs-1.5.3-2.fc39.x86_64 55/153 Installing : libsmartcols-2.39.1-3.fc39.x86_64 56/153 Installing : alternatives-1.24-2.fc39.x86_64 57/153 Installing : jansson-2.13.1-7.fc39.x86_64 58/153 Installing : libcom_err-1.47.0-2.fc39.x86_64 59/153 Installing : libsepol-3.5-2.fc39.x86_64 60/153 Installing : libunistring-1.1-4.fc39.x86_64 61/153 Installing : libidn2-2.3.4-3.fc39.x86_64 62/153 Installing : lua-libs-5.4.4-9.fc39.x86_64 63/153 Installing : pcre2-10.42-1.fc39.2.x86_64 64/153 Installing : libselinux-3.5-5.fc39.x86_64 65/153 Installing : sed-4.8-14.fc39.x86_64 66/153 Installing : grep-3.11-3.fc39.x86_64 67/153 Installing : findutils-1:4.9.0-5.fc39.x86_64 68/153 Installing : xz-5.4.3-2.fc39.x86_64 69/153 Installing : libmount-2.39.1-3.fc39.x86_64 70/153 Installing : util-linux-core-2.39.1-3.fc39.x86_64 71/153 Installing : libsemanage-3.5-4.fc39.x86_64 72/153 Installing : tar-2:1.35-1.fc39.x86_64 73/153 Installing : libpsl-0.21.2-4.fc39.x86_64 74/153 Installing : zip-3.0-38.fc39.x86_64 75/153 Installing : zstd-1.5.5-4.fc39.x86_64 76/153 Installing : libfdisk-2.39.1-3.fc39.x86_64 77/153 Installing : bzip2-1.0.8-16.fc39.x86_64 78/153 Installing : libxml2-2.10.4-3.fc39.x86_64 79/153 Installing : sqlite-libs-3.42.0-7.fc39.x86_64 80/153 Installing : ed-1.19-4.fc39.x86_64 81/153 Installing : patch-2.7.6-22.fc39.x86_64 82/153 Installing : elfutils-default-yama-scope-0.189-4.fc39.noarch 83/153 Running scriptlet: elfutils-default-yama-scope-0.189-4.fc39.noarch 83/153 Installing : libbrotli-1.0.9-13.fc39.x86_64 84/153 Installing : cpio-2.14-4.fc39.x86_64 85/153 Installing : diffutils-3.10-3.fc39.x86_64 86/153 Installing : gdbm-libs-1:1.23-4.fc39.x86_64 87/153 Installing : cyrus-sasl-lib-2.1.28-11.fc39.x86_64 88/153 Installing : keyutils-libs-1.6.1-7.fc39.x86_64 89/153 Installing : libdb-5.3.28-56.fc39.x86_64 90/153 Installing : libeconf-0.4.0-6.fc39.x86_64 91/153 Installing : shadow-utils-2:4.13-8.fc39.x86_64 92/153 Running scriptlet: libutempter-1.2.1-10.fc39.x86_64 93/153 Installing : libutempter-1.2.1-10.fc39.x86_64 93/153 Installing : libffi-3.4.4-4.fc39.x86_64 94/153 Installing : p11-kit-0.25.0-2.fc39.x86_64 95/153 Installing : libgomp-13.2.1-1.fc39.x86_64 96/153 Installing : libnghttp2-1.55.1-2.fc39.x86_64 97/153 Installing : libpkgconf-1.9.5-2.fc39.x86_64 98/153 Installing : pkgconf-1.9.5-2.fc39.x86_64 99/153 Installing : pkgconf-pkg-config-1.9.5-2.fc39.x86_64 100/153 Installing : libsigsegv-2.14-5.fc39.x86_64 101/153 Installing : gawk-5.2.2-2.fc39.x86_64 102/153 Installing : libtasn1-4.19.0-3.fc39.x86_64 103/153 Installing : p11-kit-trust-0.25.0-2.fc39.x86_64 104/153 Running scriptlet: p11-kit-trust-0.25.0-2.fc39.x86_64 104/153 Installing : libverto-0.3.2-6.fc39.x86_64 105/153 Installing : xxhash-libs-0.8.2-1.fc39.x86_64 106/153 Installing : libssh-config-0.10.5-2.fc39.noarch 107/153 Installing : kernel-srpm-macros-1.0-20.fc39.noarch 108/153 Installing : gnat-srpm-macros-6-3.fc39.noarch 109/153 Installing : ghc-srpm-macros-1.6.1-2.fc39.noarch 110/153 Installing : fpc-srpm-macros-1.3-8.fc39.noarch 111/153 Installing : coreutils-common-9.3-2.fc39.x86_64 112/153 Installing : openssl-libs-1:3.0.8-4.fc39.x86_64 113/153 Installing : coreutils-9.3-2.fc39.x86_64 114/153 Running scriptlet: ca-certificates-2023.2.60-3.fc39.noarch 115/153 Installing : ca-certificates-2023.2.60-3.fc39.noarch 115/153 Running scriptlet: ca-certificates-2023.2.60-3.fc39.noarch 115/153 Installing : krb5-libs-1.21-3.fc39.x86_64 116/153 Installing : libtirpc-1.3.3-1.rc1.fc39.1.x86_64 117/153 Running scriptlet: authselect-libs-1.4.2-3.fc39.x86_64 118/153 Installing : authselect-libs-1.4.2-3.fc39.x86_64 118/153 Installing : gzip-1.12-5.fc39.x86_64 119/153 Installing : cracklib-2.9.11-2.fc39.x86_64 120/153 Installing : libpwquality-1.4.5-6.fc39.x86_64 121/153 Installing : authselect-1.4.2-3.fc39.x86_64 122/153 Installing : libnsl2-2.0.0-6.fc39.x86_64 123/153 Installing : pam-1.5.3-2.fc39.x86_64 124/153 Installing : libssh-0.10.5-2.fc39.x86_64 125/153 Installing : libarchive-3.7.0-1.fc39.x86_64 126/153 Installing : libevent-2.1.12-9.fc39.x86_64 127/153 Installing : openldap-2.6.5-1.fc39.x86_64 128/153 Installing : libcurl-8.2.1-1.fc39.x86_64 129/153 Installing : elfutils-libs-0.189-4.fc39.x86_64 130/153 Installing : elfutils-debuginfod-client-0.189-4.fc39.x86_64 131/153 Installing : binutils-gold-2.40-13.fc39.x86_64 132/153 Running scriptlet: binutils-gold-2.40-13.fc39.x86_64 132/153 Installing : binutils-2.40-13.fc39.x86_64 133/153 Running scriptlet: binutils-2.40-13.fc39.x86_64 133/153 Installing : elfutils-0.189-4.fc39.x86_64 134/153 Installing : gdb-minimal-13.2-6.fc39.x86_64 135/153 Installing : debugedit-5.0-10.fc39.x86_64 136/153 Installing : curl-8.2.1-1.fc39.x86_64 137/153 Installing : rpm-sequoia-1.4.1-2.fc39.x86_64 138/153 Installing : rpm-libs-4.18.91-9.fc39.x86_64 139/153 Running scriptlet: rpm-4.18.91-9.fc39.x86_64 140/153 Installing : rpm-4.18.91-9.fc39.x86_64 140/153 Installing : efi-srpm-macros-5-9.fc39.noarch 141/153 Installing : lua-srpm-macros-1-9.fc39.noarch 142/153 Installing : rpmautospec-rpm-macros-0.3.5-4.fc39.noarch 143/153 Installing : rpm-build-libs-4.18.91-9.fc39.x86_64 144/153 Installing : ansible-srpm-macros-1-11.fc39.noarch 145/153 Installing : fonts-srpm-macros-1:2.0.5-12.fc39.noarch 146/153 Installing : go-srpm-macros-3.2.0-6.fc39.noarch 147/153 Installing : python-srpm-macros-3.12-2.fc39.noarch 148/153 Installing : redhat-rpm-config-261-1.fc39.noarch 149/153 Installing : rpm-build-4.18.91-9.fc39.x86_64 150/153 Installing : util-linux-2.39.1-3.fc39.x86_64 151/153 Installing : which-2.21-40.fc39.x86_64 152/153 Installing : info-7.0.3-3.fc39.x86_64 153/153 Running scriptlet: filesystem-3.18-6.fc39.x86_64 153/153 Running scriptlet: ca-certificates-2023.2.60-3.fc39.noarch 153/153 Running scriptlet: authselect-libs-1.4.2-3.fc39.x86_64 153/153 Running scriptlet: rpm-4.18.91-9.fc39.x86_64 153/153 Running scriptlet: info-7.0.3-3.fc39.x86_64 153/153 Verifying : audit-libs-3.1.1-4.fc39.x86_64 1/153 Verifying : file-5.44-5.fc39.x86_64 2/153 Verifying : file-libs-5.44-5.fc39.x86_64 3/153 Verifying : libblkid-2.39.1-3.fc39.x86_64 4/153 Verifying : libbrotli-1.0.9-13.fc39.x86_64 5/153 Verifying : libcap-ng-0.8.3-7.fc39.x86_64 6/153 Verifying : libfdisk-2.39.1-3.fc39.x86_64 7/153 Verifying : libmount-2.39.1-3.fc39.x86_64 8/153 Verifying : libpwquality-1.4.5-6.fc39.x86_64 9/153 Verifying : libselinux-3.5-5.fc39.x86_64 10/153 Verifying : libsemanage-3.5-4.fc39.x86_64 11/153 Verifying : libsmartcols-2.39.1-3.fc39.x86_64 12/153 Verifying : libuuid-2.39.1-3.fc39.x86_64 13/153 Verifying : libxml2-2.10.4-3.fc39.x86_64 14/153 Verifying : rpm-4.18.91-9.fc39.x86_64 15/153 Verifying : rpm-build-4.18.91-9.fc39.x86_64 16/153 Verifying : rpm-build-libs-4.18.91-9.fc39.x86_64 17/153 Verifying : rpm-libs-4.18.91-9.fc39.x86_64 18/153 Verifying : util-linux-2.39.1-3.fc39.x86_64 19/153 Verifying : util-linux-core-2.39.1-3.fc39.x86_64 20/153 Verifying : alternatives-1.24-2.fc39.x86_64 21/153 Verifying : ansible-srpm-macros-1-11.fc39.noarch 22/153 Verifying : authselect-1.4.2-3.fc39.x86_64 23/153 Verifying : authselect-libs-1.4.2-3.fc39.x86_64 24/153 Verifying : basesystem-11-18.fc39.noarch 25/153 Verifying : bash-5.2.15-5.fc39.x86_64 26/153 Verifying : binutils-2.40-13.fc39.x86_64 27/153 Verifying : binutils-gold-2.40-13.fc39.x86_64 28/153 Verifying : bzip2-1.0.8-16.fc39.x86_64 29/153 Verifying : bzip2-libs-1.0.8-16.fc39.x86_64 30/153 Verifying : ca-certificates-2023.2.60-3.fc39.noarch 31/153 Verifying : coreutils-9.3-2.fc39.x86_64 32/153 Verifying : coreutils-common-9.3-2.fc39.x86_64 33/153 Verifying : cpio-2.14-4.fc39.x86_64 34/153 Verifying : cracklib-2.9.11-2.fc39.x86_64 35/153 Verifying : crypto-policies-20230614-2.git5f3458e.fc39.noarc 36/153 Verifying : curl-8.2.1-1.fc39.x86_64 37/153 Verifying : cyrus-sasl-lib-2.1.28-11.fc39.x86_64 38/153 Verifying : debugedit-5.0-10.fc39.x86_64 39/153 Verifying : diffutils-3.10-3.fc39.x86_64 40/153 Verifying : dwz-0.15-3.fc39.x86_64 41/153 Verifying : ed-1.19-4.fc39.x86_64 42/153 Verifying : efi-srpm-macros-5-9.fc39.noarch 43/153 Verifying : elfutils-0.189-4.fc39.x86_64 44/153 Verifying : elfutils-debuginfod-client-0.189-4.fc39.x86_64 45/153 Verifying : elfutils-default-yama-scope-0.189-4.fc39.noarch 46/153 Verifying : elfutils-libelf-0.189-4.fc39.x86_64 47/153 Verifying : elfutils-libs-0.189-4.fc39.x86_64 48/153 Verifying : fedora-gpg-keys-39-0.4.noarch 49/153 Verifying : fedora-release-39-0.21.noarch 50/153 Verifying : fedora-release-common-39-0.21.noarch 51/153 Verifying : fedora-release-identity-basic-39-0.21.noarch 52/153 Verifying : fedora-repos-39-0.4.noarch 53/153 Verifying : fedora-repos-rawhide-39-0.4.noarch 54/153 Verifying : filesystem-3.18-6.fc39.x86_64 55/153 Verifying : findutils-1:4.9.0-5.fc39.x86_64 56/153 Verifying : fonts-srpm-macros-1:2.0.5-12.fc39.noarch 57/153 Verifying : fpc-srpm-macros-1.3-8.fc39.noarch 58/153 Verifying : gawk-5.2.2-2.fc39.x86_64 59/153 Verifying : gdb-minimal-13.2-6.fc39.x86_64 60/153 Verifying : gdbm-libs-1:1.23-4.fc39.x86_64 61/153 Verifying : ghc-srpm-macros-1.6.1-2.fc39.noarch 62/153 Verifying : glibc-2.37.9000-18.fc39.x86_64 63/153 Verifying : glibc-common-2.37.9000-18.fc39.x86_64 64/153 Verifying : glibc-gconv-extra-2.37.9000-18.fc39.x86_64 65/153 Verifying : glibc-minimal-langpack-2.37.9000-18.fc39.x86_64 66/153 Verifying : gmp-1:6.2.1-5.fc39.x86_64 67/153 Verifying : gnat-srpm-macros-6-3.fc39.noarch 68/153 Verifying : go-srpm-macros-3.2.0-6.fc39.noarch 69/153 Verifying : grep-3.11-3.fc39.x86_64 70/153 Verifying : gzip-1.12-5.fc39.x86_64 71/153 Verifying : info-7.0.3-3.fc39.x86_64 72/153 Verifying : jansson-2.13.1-7.fc39.x86_64 73/153 Verifying : kernel-srpm-macros-1.0-20.fc39.noarch 74/153 Verifying : keyutils-libs-1.6.1-7.fc39.x86_64 75/153 Verifying : krb5-libs-1.21-3.fc39.x86_64 76/153 Verifying : libacl-2.3.1-8.fc39.x86_64 77/153 Verifying : libarchive-3.7.0-1.fc39.x86_64 78/153 Verifying : libattr-2.5.1-8.fc39.x86_64 79/153 Verifying : libcap-2.48-7.fc39.x86_64 80/153 Verifying : libcom_err-1.47.0-2.fc39.x86_64 81/153 Verifying : libcurl-8.2.1-1.fc39.x86_64 82/153 Verifying : libdb-5.3.28-56.fc39.x86_64 83/153 Verifying : libeconf-0.4.0-6.fc39.x86_64 84/153 Verifying : libevent-2.1.12-9.fc39.x86_64 85/153 Verifying : libffi-3.4.4-4.fc39.x86_64 86/153 Verifying : libgcc-13.2.1-1.fc39.x86_64 87/153 Verifying : libgomp-13.2.1-1.fc39.x86_64 88/153 Verifying : libidn2-2.3.4-3.fc39.x86_64 89/153 Verifying : libnghttp2-1.55.1-2.fc39.x86_64 90/153 Verifying : libnsl2-2.0.0-6.fc39.x86_64 91/153 Verifying : libpkgconf-1.9.5-2.fc39.x86_64 92/153 Verifying : libpsl-0.21.2-4.fc39.x86_64 93/153 Verifying : libsepol-3.5-2.fc39.x86_64 94/153 Verifying : libsigsegv-2.14-5.fc39.x86_64 95/153 Verifying : libssh-0.10.5-2.fc39.x86_64 96/153 Verifying : libssh-config-0.10.5-2.fc39.noarch 97/153 Verifying : libstdc++-13.2.1-1.fc39.x86_64 98/153 Verifying : libtasn1-4.19.0-3.fc39.x86_64 99/153 Verifying : libtirpc-1.3.3-1.rc1.fc39.1.x86_64 100/153 Verifying : libunistring-1.1-4.fc39.x86_64 101/153 Verifying : libutempter-1.2.1-10.fc39.x86_64 102/153 Verifying : libverto-0.3.2-6.fc39.x86_64 103/153 Verifying : libxcrypt-4.4.36-2.fc39.x86_64 104/153 Verifying : libzstd-1.5.5-4.fc39.x86_64 105/153 Verifying : lua-libs-5.4.4-9.fc39.x86_64 106/153 Verifying : lua-srpm-macros-1-9.fc39.noarch 107/153 Verifying : lz4-libs-1.9.4-4.fc39.x86_64 108/153 Verifying : mpfr-4.2.0-3.fc39.x86_64 109/153 Verifying : ncurses-base-6.4-6.20230520.fc39.noarch 110/153 Verifying : ncurses-libs-6.4-6.20230520.fc39.x86_64 111/153 Verifying : ocaml-srpm-macros-8-2.fc39.noarch 112/153 Verifying : openblas-srpm-macros-2-14.fc39.noarch 113/153 Verifying : openldap-2.6.5-1.fc39.x86_64 114/153 Verifying : openssl-libs-1:3.0.8-4.fc39.x86_64 115/153 Verifying : p11-kit-0.25.0-2.fc39.x86_64 116/153 Verifying : p11-kit-trust-0.25.0-2.fc39.x86_64 117/153 Verifying : package-notes-srpm-macros-0.5-9.fc39.noarch 118/153 Verifying : pam-1.5.3-2.fc39.x86_64 119/153 Verifying : pam-libs-1.5.3-2.fc39.x86_64 120/153 Verifying : patch-2.7.6-22.fc39.x86_64 121/153 Verifying : pcre2-10.42-1.fc39.2.x86_64 122/153 Verifying : pcre2-syntax-10.42-1.fc39.2.noarch 123/153 Verifying : perl-srpm-macros-1-51.fc39.noarch 124/153 Verifying : pkgconf-1.9.5-2.fc39.x86_64 125/153 Verifying : pkgconf-m4-1.9.5-2.fc39.noarch 126/153 Verifying : pkgconf-pkg-config-1.9.5-2.fc39.x86_64 127/153 Verifying : popt-1.19-3.fc39.x86_64 128/153 Verifying : publicsuffix-list-dafsa-20230614-2.fc39.noarch 129/153 Verifying : pyproject-srpm-macros-1.9.0-2.fc39.noarch 130/153 Verifying : python-srpm-macros-3.12-2.fc39.noarch 131/153 Verifying : qt5-srpm-macros-5.15.10-2.fc39.noarch 132/153 Verifying : qt6-srpm-macros-6.5.2-2.fc39.noarch 133/153 Verifying : readline-8.2-4.fc39.x86_64 134/153 Verifying : redhat-rpm-config-261-1.fc39.noarch 135/153 Verifying : rpm-sequoia-1.4.1-2.fc39.x86_64 136/153 Verifying : rpmautospec-rpm-macros-0.3.5-4.fc39.noarch 137/153 Verifying : rust-srpm-macros-24-3.fc39.noarch 138/153 Verifying : sed-4.8-14.fc39.x86_64 139/153 Verifying : setup-2.14.4-1.fc39.noarch 140/153 Verifying : shadow-utils-2:4.13-8.fc39.x86_64 141/153 Verifying : sqlite-libs-3.42.0-7.fc39.x86_64 142/153 Verifying : systemd-libs-254-1.fc39.x86_64 143/153 Verifying : tar-2:1.35-1.fc39.x86_64 144/153 Verifying : tzdata-2023c-2.fc39.noarch 145/153 Verifying : unzip-6.0-62.fc39.x86_64 146/153 Verifying : which-2.21-40.fc39.x86_64 147/153 Verifying : xxhash-libs-0.8.2-1.fc39.x86_64 148/153 Verifying : xz-5.4.3-2.fc39.x86_64 149/153 Verifying : xz-libs-5.4.3-2.fc39.x86_64 150/153 Verifying : zip-3.0-38.fc39.x86_64 151/153 Verifying : zlib-1.2.13-4.fc39.x86_64 152/153 Verifying : zstd-1.5.5-4.fc39.x86_64 153/153 Installed: alternatives-1.24-2.fc39.x86_64 ansible-srpm-macros-1-11.fc39.noarch audit-libs-3.1.1-4.fc39.x86_64 authselect-1.4.2-3.fc39.x86_64 authselect-libs-1.4.2-3.fc39.x86_64 basesystem-11-18.fc39.noarch bash-5.2.15-5.fc39.x86_64 binutils-2.40-13.fc39.x86_64 binutils-gold-2.40-13.fc39.x86_64 bzip2-1.0.8-16.fc39.x86_64 bzip2-libs-1.0.8-16.fc39.x86_64 ca-certificates-2023.2.60-3.fc39.noarch coreutils-9.3-2.fc39.x86_64 coreutils-common-9.3-2.fc39.x86_64 cpio-2.14-4.fc39.x86_64 cracklib-2.9.11-2.fc39.x86_64 crypto-policies-20230614-2.git5f3458e.fc39.noarch curl-8.2.1-1.fc39.x86_64 cyrus-sasl-lib-2.1.28-11.fc39.x86_64 debugedit-5.0-10.fc39.x86_64 diffutils-3.10-3.fc39.x86_64 dwz-0.15-3.fc39.x86_64 ed-1.19-4.fc39.x86_64 efi-srpm-macros-5-9.fc39.noarch elfutils-0.189-4.fc39.x86_64 elfutils-debuginfod-client-0.189-4.fc39.x86_64 elfutils-default-yama-scope-0.189-4.fc39.noarch elfutils-libelf-0.189-4.fc39.x86_64 elfutils-libs-0.189-4.fc39.x86_64 fedora-gpg-keys-39-0.4.noarch fedora-release-39-0.21.noarch fedora-release-common-39-0.21.noarch fedora-release-identity-basic-39-0.21.noarch fedora-repos-39-0.4.noarch fedora-repos-rawhide-39-0.4.noarch file-5.44-5.fc39.x86_64 file-libs-5.44-5.fc39.x86_64 filesystem-3.18-6.fc39.x86_64 findutils-1:4.9.0-5.fc39.x86_64 fonts-srpm-macros-1:2.0.5-12.fc39.noarch fpc-srpm-macros-1.3-8.fc39.noarch gawk-5.2.2-2.fc39.x86_64 gdb-minimal-13.2-6.fc39.x86_64 gdbm-libs-1:1.23-4.fc39.x86_64 ghc-srpm-macros-1.6.1-2.fc39.noarch glibc-2.37.9000-18.fc39.x86_64 glibc-common-2.37.9000-18.fc39.x86_64 glibc-gconv-extra-2.37.9000-18.fc39.x86_64 glibc-minimal-langpack-2.37.9000-18.fc39.x86_64 gmp-1:6.2.1-5.fc39.x86_64 gnat-srpm-macros-6-3.fc39.noarch go-srpm-macros-3.2.0-6.fc39.noarch grep-3.11-3.fc39.x86_64 gzip-1.12-5.fc39.x86_64 info-7.0.3-3.fc39.x86_64 jansson-2.13.1-7.fc39.x86_64 kernel-srpm-macros-1.0-20.fc39.noarch keyutils-libs-1.6.1-7.fc39.x86_64 krb5-libs-1.21-3.fc39.x86_64 libacl-2.3.1-8.fc39.x86_64 libarchive-3.7.0-1.fc39.x86_64 libattr-2.5.1-8.fc39.x86_64 libblkid-2.39.1-3.fc39.x86_64 libbrotli-1.0.9-13.fc39.x86_64 libcap-2.48-7.fc39.x86_64 libcap-ng-0.8.3-7.fc39.x86_64 libcom_err-1.47.0-2.fc39.x86_64 libcurl-8.2.1-1.fc39.x86_64 libdb-5.3.28-56.fc39.x86_64 libeconf-0.4.0-6.fc39.x86_64 libevent-2.1.12-9.fc39.x86_64 libfdisk-2.39.1-3.fc39.x86_64 libffi-3.4.4-4.fc39.x86_64 libgcc-13.2.1-1.fc39.x86_64 libgomp-13.2.1-1.fc39.x86_64 libidn2-2.3.4-3.fc39.x86_64 libmount-2.39.1-3.fc39.x86_64 libnghttp2-1.55.1-2.fc39.x86_64 libnsl2-2.0.0-6.fc39.x86_64 libpkgconf-1.9.5-2.fc39.x86_64 libpsl-0.21.2-4.fc39.x86_64 libpwquality-1.4.5-6.fc39.x86_64 libselinux-3.5-5.fc39.x86_64 libsemanage-3.5-4.fc39.x86_64 libsepol-3.5-2.fc39.x86_64 libsigsegv-2.14-5.fc39.x86_64 libsmartcols-2.39.1-3.fc39.x86_64 libssh-0.10.5-2.fc39.x86_64 libssh-config-0.10.5-2.fc39.noarch libstdc++-13.2.1-1.fc39.x86_64 libtasn1-4.19.0-3.fc39.x86_64 libtirpc-1.3.3-1.rc1.fc39.1.x86_64 libunistring-1.1-4.fc39.x86_64 libutempter-1.2.1-10.fc39.x86_64 libuuid-2.39.1-3.fc39.x86_64 libverto-0.3.2-6.fc39.x86_64 libxcrypt-4.4.36-2.fc39.x86_64 libxml2-2.10.4-3.fc39.x86_64 libzstd-1.5.5-4.fc39.x86_64 lua-libs-5.4.4-9.fc39.x86_64 lua-srpm-macros-1-9.fc39.noarch lz4-libs-1.9.4-4.fc39.x86_64 mpfr-4.2.0-3.fc39.x86_64 ncurses-base-6.4-6.20230520.fc39.noarch ncurses-libs-6.4-6.20230520.fc39.x86_64 ocaml-srpm-macros-8-2.fc39.noarch openblas-srpm-macros-2-14.fc39.noarch openldap-2.6.5-1.fc39.x86_64 openssl-libs-1:3.0.8-4.fc39.x86_64 p11-kit-0.25.0-2.fc39.x86_64 p11-kit-trust-0.25.0-2.fc39.x86_64 package-notes-srpm-macros-0.5-9.fc39.noarch pam-1.5.3-2.fc39.x86_64 pam-libs-1.5.3-2.fc39.x86_64 patch-2.7.6-22.fc39.x86_64 pcre2-10.42-1.fc39.2.x86_64 pcre2-syntax-10.42-1.fc39.2.noarch perl-srpm-macros-1-51.fc39.noarch pkgconf-1.9.5-2.fc39.x86_64 pkgconf-m4-1.9.5-2.fc39.noarch pkgconf-pkg-config-1.9.5-2.fc39.x86_64 popt-1.19-3.fc39.x86_64 publicsuffix-list-dafsa-20230614-2.fc39.noarch pyproject-srpm-macros-1.9.0-2.fc39.noarch python-srpm-macros-3.12-2.fc39.noarch qt5-srpm-macros-5.15.10-2.fc39.noarch qt6-srpm-macros-6.5.2-2.fc39.noarch readline-8.2-4.fc39.x86_64 redhat-rpm-config-261-1.fc39.noarch rpm-4.18.91-9.fc39.x86_64 rpm-build-4.18.91-9.fc39.x86_64 rpm-build-libs-4.18.91-9.fc39.x86_64 rpm-libs-4.18.91-9.fc39.x86_64 rpm-sequoia-1.4.1-2.fc39.x86_64 rpmautospec-rpm-macros-0.3.5-4.fc39.noarch rust-srpm-macros-24-3.fc39.noarch sed-4.8-14.fc39.x86_64 setup-2.14.4-1.fc39.noarch shadow-utils-2:4.13-8.fc39.x86_64 sqlite-libs-3.42.0-7.fc39.x86_64 systemd-libs-254-1.fc39.x86_64 tar-2:1.35-1.fc39.x86_64 tzdata-2023c-2.fc39.noarch unzip-6.0-62.fc39.x86_64 util-linux-2.39.1-3.fc39.x86_64 util-linux-core-2.39.1-3.fc39.x86_64 which-2.21-40.fc39.x86_64 xxhash-libs-0.8.2-1.fc39.x86_64 xz-5.4.3-2.fc39.x86_64 xz-libs-5.4.3-2.fc39.x86_64 zip-3.0-38.fc39.x86_64 zlib-1.2.13-4.fc39.x86_64 zstd-1.5.5-4.fc39.x86_64 Complete! Finish: installing minimal buildroot with dnf Start: creating root cache Finish: creating root cache Finish: chroot init INFO: Installed packages: INFO: libverto-0.3.2-6.fc39.x86_64 libtirpc-1.3.3-1.rc1.fc39.1.x86_64 libutempter-1.2.1-10.fc39.x86_64 util-linux-core-2.39.1-3.fc39.x86_64 pcre2-10.42-1.fc39.2.x86_64 binutils-2.40-13.fc39.x86_64 bzip2-libs-1.0.8-16.fc39.x86_64 libevent-2.1.12-9.fc39.x86_64 pyproject-srpm-macros-1.9.0-2.fc39.noarch libcap-ng-0.8.3-7.fc39.x86_64 libsmartcols-2.39.1-3.fc39.x86_64 libpwquality-1.4.5-6.fc39.x86_64 ansible-srpm-macros-1-11.fc39.noarch curl-8.2.1-1.fc39.x86_64 libblkid-2.39.1-3.fc39.x86_64 libsigsegv-2.14-5.fc39.x86_64 gdbm-libs-1.23-4.fc39.x86_64 libattr-2.5.1-8.fc39.x86_64 keyutils-libs-1.6.1-7.fc39.x86_64 rpm-build-libs-4.18.91-9.fc39.x86_64 binutils-gold-2.40-13.fc39.x86_64 rpm-4.18.91-9.fc39.x86_64 fonts-srpm-macros-2.0.5-12.fc39.noarch gzip-1.12-5.fc39.x86_64 elfutils-libelf-0.189-4.fc39.x86_64 qt5-srpm-macros-5.15.10-2.fc39.noarch rpmautospec-rpm-macros-0.3.5-4.fc39.noarch gnat-srpm-macros-6-3.fc39.noarch openblas-srpm-macros-2-14.fc39.noarch popt-1.19-3.fc39.x86_64 dwz-0.15-3.fc39.x86_64 gpg-pubkey-eb10b464-6202d9c6 libxcrypt-4.4.36-2.fc39.x86_64 elfutils-default-yama-scope-0.189-4.fc39.noarch glibc-2.37.9000-18.fc39.x86_64 efi-srpm-macros-5-9.fc39.noarch go-srpm-macros-3.2.0-6.fc39.noarch libsepol-3.5-2.fc39.x86_64 alternatives-1.24-2.fc39.x86_64 libgomp-13.2.1-1.fc39.x86_64 libacl-2.3.1-8.fc39.x86_64 libidn2-2.3.4-3.fc39.x86_64 rpm-build-4.18.91-9.fc39.x86_64 xz-libs-5.4.3-2.fc39.x86_64 package-notes-srpm-macros-0.5-9.fc39.noarch p11-kit-trust-0.25.0-2.fc39.x86_64 debugedit-5.0-10.fc39.x86_64 authselect-libs-1.4.2-3.fc39.x86_64 grep-3.11-3.fc39.x86_64 libfdisk-2.39.1-3.fc39.x86_64 bzip2-1.0.8-16.fc39.x86_64 pkgconf-pkg-config-1.9.5-2.fc39.x86_64 libselinux-3.5-5.fc39.x86_64 qt6-srpm-macros-6.5.2-2.fc39.noarch glibc-minimal-langpack-2.37.9000-18.fc39.x86_64 mpfr-4.2.0-3.fc39.x86_64 which-2.21-40.fc39.x86_64 libbrotli-1.0.9-13.fc39.x86_64 zstd-1.5.5-4.fc39.x86_64 krb5-libs-1.21-3.fc39.x86_64 python-srpm-macros-3.12-2.fc39.noarch libstdc++-13.2.1-1.fc39.x86_64 ed-1.19-4.fc39.x86_64 fedora-repos-rawhide-39-0.4.noarch gdb-minimal-13.2-6.fc39.x86_64 fedora-release-common-39-0.21.noarch gawk-5.2.2-2.fc39.x86_64 kernel-srpm-macros-1.0-20.fc39.noarch info-7.0.3-3.fc39.x86_64 fedora-repos-39-0.4.noarch pkgconf-m4-1.9.5-2.fc39.noarch fedora-gpg-keys-39-0.4.noarch readline-8.2-4.fc39.x86_64 gmp-6.2.1-5.fc39.x86_64 libarchive-3.7.0-1.fc39.x86_64 libxml2-2.10.4-3.fc39.x86_64 ncurses-libs-6.4-6.20230520.fc39.x86_64 rpm-libs-4.18.91-9.fc39.x86_64 diffutils-3.10-3.fc39.x86_64 elfutils-0.189-4.fc39.x86_64 p11-kit-0.25.0-2.fc39.x86_64 lua-srpm-macros-1-9.fc39.noarch libzstd-1.5.5-4.fc39.x86_64 elfutils-libs-0.189-4.fc39.x86_64 unzip-6.0-62.fc39.x86_64 setup-2.14.4-1.fc39.noarch libcom_err-1.47.0-2.fc39.x86_64 redhat-rpm-config-261-1.fc39.noarch fpc-srpm-macros-1.3-8.fc39.noarch fedora-release-39-0.21.noarch ca-certificates-2023.2.60-3.fc39.noarch libmount-2.39.1-3.fc39.x86_64 pcre2-syntax-10.42-1.fc39.2.noarch libgcc-13.2.1-1.fc39.x86_64 cracklib-2.9.11-2.fc39.x86_64 perl-srpm-macros-1-51.fc39.noarch elfutils-debuginfod-client-0.189-4.fc39.x86_64 xxhash-libs-0.8.2-1.fc39.x86_64 coreutils-common-9.3-2.fc39.x86_64 ncurses-base-6.4-6.20230520.fc39.noarch libeconf-0.4.0-6.fc39.x86_64 gpg-pubkey-18b8e74c-62f2920f rust-srpm-macros-24-3.fc39.noarch libpsl-0.21.2-4.fc39.x86_64 authselect-1.4.2-3.fc39.x86_64 glibc-gconv-extra-2.37.9000-18.fc39.x86_64 ghc-srpm-macros-1.6.1-2.fc39.noarch openldap-2.6.5-1.fc39.x86_64 fedora-release-identity-basic-39-0.21.noarch jansson-2.13.1-7.fc39.x86_64 libssh-0.10.5-2.fc39.x86_64 crypto-policies-20230614-2.git5f3458e.fc39.noarch basesystem-11-18.fc39.noarch systemd-libs-254-1.fc39.x86_64 rpm-sequoia-1.4.1-2.fc39.x86_64 publicsuffix-list-dafsa-20230614-2.fc39.noarch shadow-utils-4.13-8.fc39.x86_64 pam-libs-1.5.3-2.fc39.x86_64 libcap-2.48-7.fc39.x86_64 sqlite-libs-3.42.0-7.fc39.x86_64 libnsl2-2.0.0-6.fc39.x86_64 xz-5.4.3-2.fc39.x86_64 file-5.44-5.fc39.x86_64 libpkgconf-1.9.5-2.fc39.x86_64 lz4-libs-1.9.4-4.fc39.x86_64 lua-libs-5.4.4-9.fc39.x86_64 tar-1.35-1.fc39.x86_64 glibc-common-2.37.9000-18.fc39.x86_64 libtasn1-4.19.0-3.fc39.x86_64 coreutils-9.3-2.fc39.x86_64 sed-4.8-14.fc39.x86_64 zlib-1.2.13-4.fc39.x86_64 libunistring-1.1-4.fc39.x86_64 libssh-config-0.10.5-2.fc39.noarch patch-2.7.6-22.fc39.x86_64 filesystem-3.18-6.fc39.x86_64 ocaml-srpm-macros-8-2.fc39.noarch zip-3.0-38.fc39.x86_64 cpio-2.14-4.fc39.x86_64 libffi-3.4.4-4.fc39.x86_64 cyrus-sasl-lib-2.1.28-11.fc39.x86_64 libcurl-8.2.1-1.fc39.x86_64 openssl-libs-3.0.8-4.fc39.x86_64 bash-5.2.15-5.fc39.x86_64 libnghttp2-1.55.1-2.fc39.x86_64 tzdata-2023c-2.fc39.noarch libsemanage-3.5-4.fc39.x86_64 libdb-5.3.28-56.fc39.x86_64 findutils-4.9.0-5.fc39.x86_64 pkgconf-1.9.5-2.fc39.x86_64 libuuid-2.39.1-3.fc39.x86_64 audit-libs-3.1.1-4.fc39.x86_64 util-linux-2.39.1-3.fc39.x86_64 pam-1.5.3-2.fc39.x86_64 file-libs-5.44-5.fc39.x86_64 Start: buildsrpm Start: rpmbuild -bs Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1689897600 Wrote: /builddir/build/SRPMS/python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm Finish: rpmbuild -bs INFO: chroot_scan: 3 files copied to /var/lib/copr-rpmbuild/results/chroot_scan INFO: /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root/var/log/dnf.rpm.log /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root/var/log/dnf.librepo.log /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root/var/log/dnf.log Finish: buildsrpm INFO: Done(/var/lib/copr-rpmbuild/workspace/workdir-a1gld622/python-sqlalchemy-utils/python-sqlalchemy-utils.spec) Config(child) 2 minutes 7 seconds INFO: Results and/or logs in: /var/lib/copr-rpmbuild/results INFO: Cleaning up build root ('cleanup_on_success=True') Start: clean chroot INFO: unmounting tmpfs. Finish: clean chroot Finish: run Running (timeout=18000): unbuffer mock --rebuild /var/lib/copr-rpmbuild/results/python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm --resultdir /var/lib/copr-rpmbuild/results --uniqueext 1690883357.281448 -r /var/lib/copr-rpmbuild/results/configs/child.cfg INFO: mock.py version 4.1 starting (python version = 3.11.3, NVR = mock-4.1-1.fc38)... Start(bootstrap): init plugins INFO: tmpfs initialized INFO: selinux enabled INFO: chroot_scan: initialized INFO: compress_logs: initialized Finish(bootstrap): init plugins Start: init plugins INFO: tmpfs initialized INFO: selinux enabled INFO: chroot_scan: initialized INFO: compress_logs: initialized Finish: init plugins INFO: Signal handler active Start: run INFO: Start(/var/lib/copr-rpmbuild/results/python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm) Config(fedora-rawhide-x86_64) Start: clean chroot Finish: clean chroot Start(bootstrap): chroot init INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-bootstrap-1690883357.281448/root. INFO: reusing tmpfs at /var/lib/mock/fedora-rawhide-x86_64-bootstrap-1690883357.281448/root. INFO: calling preinit hooks INFO: enabled root cache INFO: enabled package manager cache Start(bootstrap): cleaning package manager metadata Finish(bootstrap): cleaning package manager metadata INFO: enabled HW Info plugin Mock Version: 4.1 INFO: Mock Version: 4.1 INFO: Package manager dnf detected and used (fallback) Finish(bootstrap): chroot init Start: chroot init INFO: mounting tmpfs at /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root. INFO: calling preinit hooks INFO: enabled root cache Start: unpacking root cache Finish: unpacking root cache INFO: enabled package manager cache Start: cleaning package manager metadata Finish: cleaning package manager metadata INFO: enabled HW Info plugin Mock Version: 4.1 INFO: Mock Version: 4.1 INFO: Package manager dnf detected and used (direct choice) Start: dnf update No matches found for the following disable plugin patterns: local, spacewalk, versionlock Copr repository 29 kB/s | 2.2 kB 00:00 fedora 257 kB/s | 22 kB 00:00 Dependencies resolved. Nothing to do. Complete! Finish: dnf update Finish: chroot init Start: build phase for python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm Start: build setup for python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1689897600 Wrote: /builddir/build/SRPMS/python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm No matches found for the following disable plugin patterns: local, spacewalk, versionlock Copr repository 40 kB/s | 2.2 kB 00:00 fedora 551 kB/s | 22 kB 00:00 Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: python3-colour noarch 0.1.5-16.fc39 copr_base 36 k python3-devel x86_64 3.12.0~b4-2.fc39 fedora 311 k python3-phonenumbers noarch 8.12.53-4.fc39 copr_base 4.4 M python3-pytest noarch 7.3.2-4.fc39 fedora 1.9 M Installing dependencies: expat x86_64 2.5.0-3.fc39 fedora 110 k libb2 x86_64 0.98.1-9.fc39 fedora 25 k mpdecimal x86_64 2.5.1-7.fc39 fedora 89 k pyproject-rpm-macros noarch 1.9.0-2.fc39 fedora 41 k python-pip-wheel noarch 23.1.2-5.fc39 copr_base 1.4 M python-rpm-macros noarch 3.12-2.fc39 fedora 19 k python3 x86_64 3.12.0~b4-2.fc39 fedora 26 k python3-iniconfig noarch 1.1.1-14.fc39 fedora 18 k python3-libs x86_64 3.12.0~b4-2.fc39 fedora 9.2 M python3-packaging noarch 23.1-4.fc39 fedora 114 k python3-pluggy noarch 1.0.0-9.fc39 fedora 44 k python3-rpm-generators noarch 14-7.fc39 fedora 30 k python3-rpm-macros noarch 3.12-2.fc39 fedora 14 k Transaction Summary ================================================================================ Install 17 Packages Total download size: 18 M Installed size: 102 M Downloading Packages: (1/17): python3-colour-0.1.5-16.fc39.noarch.rpm 131 kB/s | 36 kB 00:00 (2/17): python-pip-wheel-23.1.2-5.fc39.noarch.r 3.0 MB/s | 1.4 MB 00:00 (3/17): python3-phonenumbers-8.12.53-4.fc39.noa 6.3 MB/s | 4.4 MB 00:00 (4/17): expat-2.5.0-3.fc39.x86_64.rpm 248 kB/s | 110 kB 00:00 (5/17): libb2-0.98.1-9.fc39.x86_64.rpm 101 kB/s | 25 kB 00:00 (6/17): pyproject-rpm-macros-1.9.0-2.fc39.noarc 783 kB/s | 41 kB 00:00 (7/17): python-rpm-macros-3.12-2.fc39.noarch.rp 332 kB/s | 19 kB 00:00 (8/17): python3-3.12.0~b4-2.fc39.x86_64.rpm 496 kB/s | 26 kB 00:00 (9/17): python3-iniconfig-1.1.1-14.fc39.noarch. 411 kB/s | 18 kB 00:00 (10/17): mpdecimal-2.5.1-7.fc39.x86_64.rpm 402 kB/s | 89 kB 00:00 (11/17): python3-devel-3.12.0~b4-2.fc39.x86_64. 1.5 MB/s | 311 kB 00:00 (12/17): python3-packaging-23.1-4.fc39.noarch.r 1.1 MB/s | 114 kB 00:00 (13/17): python3-pluggy-1.0.0-9.fc39.noarch.rpm 703 kB/s | 44 kB 00:00 (14/17): python3-rpm-generators-14-7.fc39.noarc 537 kB/s | 30 kB 00:00 (15/17): python3-rpm-macros-3.12-2.fc39.noarch. 304 kB/s | 14 kB 00:00 (16/17): python3-pytest-7.3.2-4.fc39.noarch.rpm 6.4 MB/s | 1.9 MB 00:00 (17/17): python3-libs-3.12.0~b4-2.fc39.x86_64.r 19 MB/s | 9.2 MB 00:00 -------------------------------------------------------------------------------- Total 13 MB/s | 18 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python-rpm-macros-3.12-2.fc39.noarch 1/17 Installing : python3-rpm-macros-3.12-2.fc39.noarch 2/17 Installing : pyproject-rpm-macros-1.9.0-2.fc39.noarch 3/17 Installing : mpdecimal-2.5.1-7.fc39.x86_64 4/17 Installing : libb2-0.98.1-9.fc39.x86_64 5/17 Installing : expat-2.5.0-3.fc39.x86_64 6/17 Installing : python-pip-wheel-23.1.2-5.fc39.noarch 7/17 Installing : python3-3.12.0~b4-2.fc39.x86_64 8/17 Installing : python3-libs-3.12.0~b4-2.fc39.x86_64 9/17 Installing : python3-packaging-23.1-4.fc39.noarch 10/17 Installing : python3-rpm-generators-14-7.fc39.noarch 11/17 Installing : python3-iniconfig-1.1.1-14.fc39.noarch 12/17 Installing : python3-pluggy-1.0.0-9.fc39.noarch 13/17 Installing : python3-pytest-7.3.2-4.fc39.noarch 14/17 Installing : python3-devel-3.12.0~b4-2.fc39.x86_64 15/17 Installing : python3-colour-0.1.5-16.fc39.noarch 16/17 Installing : python3-phonenumbers-8.12.53-4.fc39.noarch 17/17 Running scriptlet: python3-phonenumbers-8.12.53-4.fc39.noarch 17/17 Verifying : python-pip-wheel-23.1.2-5.fc39.noarch 1/17 Verifying : python3-colour-0.1.5-16.fc39.noarch 2/17 Verifying : python3-phonenumbers-8.12.53-4.fc39.noarch 3/17 Verifying : expat-2.5.0-3.fc39.x86_64 4/17 Verifying : libb2-0.98.1-9.fc39.x86_64 5/17 Verifying : mpdecimal-2.5.1-7.fc39.x86_64 6/17 Verifying : pyproject-rpm-macros-1.9.0-2.fc39.noarch 7/17 Verifying : python-rpm-macros-3.12-2.fc39.noarch 8/17 Verifying : python3-3.12.0~b4-2.fc39.x86_64 9/17 Verifying : python3-devel-3.12.0~b4-2.fc39.x86_64 10/17 Verifying : python3-iniconfig-1.1.1-14.fc39.noarch 11/17 Verifying : python3-libs-3.12.0~b4-2.fc39.x86_64 12/17 Verifying : python3-packaging-23.1-4.fc39.noarch 13/17 Verifying : python3-pluggy-1.0.0-9.fc39.noarch 14/17 Verifying : python3-pytest-7.3.2-4.fc39.noarch 15/17 Verifying : python3-rpm-generators-14-7.fc39.noarch 16/17 Verifying : python3-rpm-macros-3.12-2.fc39.noarch 17/17 Installed: expat-2.5.0-3.fc39.x86_64 libb2-0.98.1-9.fc39.x86_64 mpdecimal-2.5.1-7.fc39.x86_64 pyproject-rpm-macros-1.9.0-2.fc39.noarch python-pip-wheel-23.1.2-5.fc39.noarch python-rpm-macros-3.12-2.fc39.noarch python3-3.12.0~b4-2.fc39.x86_64 python3-colour-0.1.5-16.fc39.noarch python3-devel-3.12.0~b4-2.fc39.x86_64 python3-iniconfig-1.1.1-14.fc39.noarch python3-libs-3.12.0~b4-2.fc39.x86_64 python3-packaging-23.1-4.fc39.noarch python3-phonenumbers-8.12.53-4.fc39.noarch python3-pluggy-1.0.0-9.fc39.noarch python3-pytest-7.3.2-4.fc39.noarch python3-rpm-generators-14-7.fc39.noarch python3-rpm-macros-3.12-2.fc39.noarch Complete! Finish: build setup for python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm Start: rpmbuild python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1689897600 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.R4yVXf + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf SQLAlchemy-Utils-0.41.1 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/SQLAlchemy-Utils-0.41.1.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd SQLAlchemy-Utils-0.41.1 + /usr/bin/mkdir -p SPECPARTS + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/no-psycopg2cffi.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/python-sqlalchemy-utils-0.41.1-no-pyodbc-dep.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + rm -rf SQLAlchemy-Utils.egg-info + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.YyQgzU + umask 022 + cd /builddir/build/BUILD + cd SQLAlchemy-Utils-0.41.1 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/.pyproject-builddir + RPM_TOXENV=py312 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/pyproject-wheeldir --output /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires -x test Handling setuptools >= 40.8 from default build backend Requirement not satisfied: setuptools >= 40.8 Handling wheel from default build backend Requirement not satisfied: wheel Exiting dependency generation pass: build backend + cat /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires + rm -rfv '*.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-sqlalchemy-utils-0.41.1-2.fc39.buildreqs.nosrc.rpm INFO: Going to install missing dynamic buildrequires No matches found for the following disable plugin patterns: local, spacewalk, versionlock Copr repository 36 kB/s | 2.2 kB 00:00 fedora 557 kB/s | 22 kB 00:00 Package pyproject-rpm-macros-1.9.0-2.fc39.noarch is already installed. Package python3-colour-0.1.5-16.fc39.noarch is already installed. Package python3-devel-3.12.0~b4-2.fc39.x86_64 is already installed. Package python3-devel-3.12.0~b4-2.fc39.x86_64 is already installed. Package python3-phonenumbers-8.12.53-4.fc39.noarch is already installed. Package python3-pytest-7.3.2-4.fc39.noarch is already installed. Package python3-packaging-23.1-4.fc39.noarch is already installed. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: python3-pip noarch 23.1.2-5.fc39 copr_base 2.8 M python3-setuptools noarch 67.7.2-5.fc39 fedora 1.5 M python3-wheel noarch 1:0.40.0-4.fc39 fedora 161 k Transaction Summary ================================================================================ Install 3 Packages Total download size: 4.5 M Installed size: 21 M Downloading Packages: (1/3): python3-pip-23.1.2-5.fc39.noarch.rpm 6.7 MB/s | 2.8 MB 00:00 (2/3): python3-wheel-0.40.0-4.fc39.noarch.rpm 247 kB/s | 161 kB 00:00 (3/3): python3-setuptools-67.7.2-5.fc39.noarch. 1.6 MB/s | 1.5 MB 00:00 -------------------------------------------------------------------------------- Total 4.6 MB/s | 4.5 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-setuptools-67.7.2-5.fc39.noarch 1/3 Installing : python3-pip-23.1.2-5.fc39.noarch 2/3 Installing : python3-wheel-1:0.40.0-4.fc39.noarch 3/3 Running scriptlet: python3-wheel-1:0.40.0-4.fc39.noarch 3/3 Verifying : python3-pip-23.1.2-5.fc39.noarch 1/3 Verifying : python3-setuptools-67.7.2-5.fc39.noarch 2/3 Verifying : python3-wheel-1:0.40.0-4.fc39.noarch 3/3 Installed: python3-pip-23.1.2-5.fc39.noarch python3-setuptools-67.7.2-5.fc39.noarch python3-wheel-1:0.40.0-4.fc39.noarch Complete! Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1689897600 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.FaVkc6 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf SQLAlchemy-Utils-0.41.1 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/SQLAlchemy-Utils-0.41.1.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd SQLAlchemy-Utils-0.41.1 + /usr/bin/mkdir -p SPECPARTS + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/no-psycopg2cffi.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/python-sqlalchemy-utils-0.41.1-no-pyodbc-dep.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + rm -rf SQLAlchemy-Utils.egg-info + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.ZziT9b + umask 022 + cd /builddir/build/BUILD + cd SQLAlchemy-Utils-0.41.1 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/.pyproject-builddir + RPM_TOXENV=py312 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/pyproject-wheeldir --output /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires -x test Handling setuptools >= 40.8 from default build backend Requirement satisfied: setuptools >= 40.8 (installed: setuptools 67.7.2) Handling wheel from default build backend Requirement satisfied: wheel (installed: wheel 0.40.0) running egg_info writing SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to SQLAlchemy_Utils.egg-info/top_level.txt reading manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.40.0) running dist_info writing SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to SQLAlchemy_Utils.egg-info/top_level.txt reading manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/SQLAlchemy_Utils-0.41.1.dist-info' Handling SQLAlchemy (>=1.3) from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: SQLAlchemy (>=1.3) Handling importlib-metadata ; python_version < "3.8" from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: importlib-metadata ; python_version < "3.8" Handling arrow (>=0.3.4) ; extra == 'arrow' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: arrow (>=0.3.4) ; extra == 'arrow' Handling Babel (>=1.3) ; extra == 'babel' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Babel (>=1.3) ; extra == 'babel' Handling colour (>=0.0.4) ; extra == 'color' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: colour (>=0.0.4) ; extra == 'color' Handling cryptography (>=0.6) ; extra == 'encrypted' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: cryptography (>=0.6) ; extra == 'encrypted' Handling intervals (>=0.7.1) ; extra == 'intervals' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: intervals (>=0.7.1) ; extra == 'intervals' Handling passlib (<2.0,>=1.6) ; extra == 'password' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: passlib (<2.0,>=1.6) ; extra == 'password' Handling pendulum (>=2.0.5) ; extra == 'pendulum' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pendulum (>=2.0.5) ; extra == 'pendulum' Handling phonenumbers (>=5.9.2) ; extra == 'phone' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: phonenumbers (>=5.9.2) ; extra == 'phone' Handling pytest (>=2.7.1) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pytest (>=2.7.1) ; extra == 'test' (installed: pytest 7.3.2) Handling Pygments (>=1.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: Pygments (>=1.2) ; extra == 'test' Handling Jinja2 (>=2.3) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: Jinja2 (>=2.3) ; extra == 'test' Handling docutils (>=0.10) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: docutils (>=0.10) ; extra == 'test' Handling flexmock (>=0.9.7) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: flexmock (>=0.9.7) ; extra == 'test' Handling psycopg (>=3.1.8) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: psycopg (>=3.1.8) ; extra == 'test' Handling psycopg2 (>=2.5.1) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: psycopg2 (>=2.5.1) ; extra == 'test' Handling pg8000 (>=1.12.4) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: pg8000 (>=1.12.4) ; extra == 'test' Handling pytz (>=2014.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: pytz (>=2014.2) ; extra == 'test' Handling python-dateutil (>=2.6) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: python-dateutil (>=2.6) ; extra == 'test' Handling pymysql ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: pymysql ; extra == 'test' Handling flake8 (>=2.4.0) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: flake8 (>=2.4.0) ; extra == 'test' Handling isort (>=4.2.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement not satisfied: isort (>=4.2.2) ; extra == 'test' Handling backports.zoneinfo ; (python_version < "3.9") and extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: backports.zoneinfo ; (python_version < "3.9") and extra == 'test' Handling Babel (>=1.3) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Babel (>=1.3) ; extra == 'test_all' Handling Jinja2 (>=2.3) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Jinja2 (>=2.3) ; extra == 'test_all' Handling Pygments (>=1.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Pygments (>=1.2) ; extra == 'test_all' Handling arrow (>=0.3.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: arrow (>=0.3.4) ; extra == 'test_all' Handling colour (>=0.0.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: colour (>=0.0.4) ; extra == 'test_all' Handling cryptography (>=0.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: cryptography (>=0.6) ; extra == 'test_all' Handling docutils (>=0.10) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: docutils (>=0.10) ; extra == 'test_all' Handling flake8 (>=2.4.0) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: flake8 (>=2.4.0) ; extra == 'test_all' Handling flexmock (>=0.9.7) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: flexmock (>=0.9.7) ; extra == 'test_all' Handling furl (>=0.4.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: furl (>=0.4.1) ; extra == 'test_all' Handling intervals (>=0.7.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: intervals (>=0.7.1) ; extra == 'test_all' Handling isort (>=4.2.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: isort (>=4.2.2) ; extra == 'test_all' Handling passlib (<2.0,>=1.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: passlib (<2.0,>=1.6) ; extra == 'test_all' Handling pendulum (>=2.0.5) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pendulum (>=2.0.5) ; extra == 'test_all' Handling pg8000 (>=1.12.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pg8000 (>=1.12.4) ; extra == 'test_all' Handling phonenumbers (>=5.9.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: phonenumbers (>=5.9.2) ; extra == 'test_all' Handling psycopg2 (>=2.5.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: psycopg2 (>=2.5.1) ; extra == 'test_all' Handling psycopg (>=3.1.8) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: psycopg (>=3.1.8) ; extra == 'test_all' Handling pymysql ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pymysql ; extra == 'test_all' Handling pytest (>=2.7.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pytest (>=2.7.1) ; extra == 'test_all' Handling python-dateutil ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil ; extra == 'test_all' Handling python-dateutil (>=2.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil (>=2.6) ; extra == 'test_all' Handling pytz (>=2014.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pytz (>=2014.2) ; extra == 'test_all' Handling backports.zoneinfo ; (python_version < "3.9") and extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: backports.zoneinfo ; (python_version < "3.9") and extra == 'test_all' Handling python-dateutil ; extra == 'timezone' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil ; extra == 'timezone' Handling furl (>=0.4.1) ; extra == 'url' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: furl (>=0.4.1) ; extra == 'url' + cat /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires + rm -rfv SQLAlchemy_Utils-0.41.1.dist-info/ removed 'SQLAlchemy_Utils-0.41.1.dist-info/LICENSE' removed 'SQLAlchemy_Utils-0.41.1.dist-info/METADATA' removed 'SQLAlchemy_Utils-0.41.1.dist-info/top_level.txt' removed directory 'SQLAlchemy_Utils-0.41.1.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-sqlalchemy-utils-0.41.1-2.fc39.buildreqs.nosrc.rpm INFO: Going to install missing dynamic buildrequires No matches found for the following disable plugin patterns: local, spacewalk, versionlock Copr repository 14 kB/s | 2.2 kB 00:00 fedora 523 kB/s | 22 kB 00:00 Package pyproject-rpm-macros-1.9.0-2.fc39.noarch is already installed. Package python3-colour-0.1.5-16.fc39.noarch is already installed. Package python3-devel-3.12.0~b4-2.fc39.x86_64 is already installed. Package python3-devel-3.12.0~b4-2.fc39.x86_64 is already installed. Package python3-phonenumbers-8.12.53-4.fc39.noarch is already installed. Package python3-pytest-7.3.2-4.fc39.noarch is already installed. Package python3-packaging-23.1-4.fc39.noarch is already installed. Package python3-pip-23.1.2-5.fc39.noarch is already installed. Package python3-pytest-7.3.2-4.fc39.noarch is already installed. Package python3-setuptools-67.7.2-5.fc39.noarch is already installed. Package python3-wheel-1:0.40.0-4.fc39.noarch is already installed. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: python3-PyMySQL noarch 1.1.0-3.fc39 copr_base 106 k python3-dateutil noarch 1:2.8.2-10.fc39 fedora 355 k python3-docutils noarch 0.19-4.fc39 copr_base 983 k python3-flake8 noarch 6.0.0-2.fc39 fedora 145 k python3-flexmock noarch 0.11.3-7.fc39 fedora 86 k python3-isort noarch 5.12.0-4.fc39 fedora 239 k python3-jinja2 noarch 3.1.2-5.fc39 fedora 506 k python3-pg8000 noarch 1.26.1-6.fc39 copr_base 69 k python3-psycopg2 x86_64 2.9.6-3.fc39 copr_base 201 k python3-psycopg3 noarch 3.1.9-3.fc39 fedora 407 k python3-pygments noarch 2.15.1-4.fc39 fedora 2.4 M python3-pytz noarch 2023.3-3.fc39 fedora 64 k python3-sqlalchemy x86_64 1.4.49-2.fc39 fedora 2.9 M Installing dependencies: libpq x86_64 15.0-4.fc39 fedora 212 k python3-asn1crypto noarch 1.5.1-6.fc39 copr_base 220 k python3-greenlet x86_64 2.0.2-2.fc39 copr_base 216 k python3-markupsafe x86_64 2.1.3-2.fc39 fedora 30 k python3-mccabe noarch 0.7.0-4.fc39 fedora 22 k python3-pycodestyle noarch 2.10.0-2.fc39 copr_base 105 k python3-pyflakes noarch 3.0.1-3.fc39 fedora 91 k python3-scramp noarch 1.4.1-7.fc39 fedora 37 k python3-six noarch 1.16.0-12.fc39 fedora 41 k python3-typing-extensions noarch 4.7.1-2.fc39 copr_base 79 k Transaction Summary ================================================================================ Install 23 Packages Total download size: 9.4 M Installed size: 44 M Downloading Packages: (1/23): python3-PyMySQL-1.1.0-3.fc39.noarch.rpm 327 kB/s | 106 kB 00:00 (2/23): python3-asn1crypto-1.5.1-6.fc39.noarch. 564 kB/s | 220 kB 00:00 (3/23): python3-greenlet-2.0.2-2.fc39.x86_64.rp 1.5 MB/s | 216 kB 00:00 (4/23): python3-pg8000-1.26.1-6.fc39.noarch.rpm 771 kB/s | 69 kB 00:00 (5/23): python3-docutils-0.19-4.fc39.noarch.rpm 1.9 MB/s | 983 kB 00:00 (6/23): python3-psycopg2-2.9.6-3.fc39.x86_64.rp 3.2 MB/s | 201 kB 00:00 (7/23): python3-pycodestyle-2.10.0-2.fc39.noarc 1.8 MB/s | 105 kB 00:00 (8/23): python3-typing-extensions-4.7.1-2.fc39. 1.6 MB/s | 79 kB 00:00 (9/23): python3-flake8-6.0.0-2.fc39.noarch.rpm 425 kB/s | 145 kB 00:00 (10/23): libpq-15.0-4.fc39.x86_64.rpm 563 kB/s | 212 kB 00:00 (11/23): python3-dateutil-2.8.2-10.fc39.noarch. 861 kB/s | 355 kB 00:00 (12/23): python3-flexmock-0.11.3-7.fc39.noarch. 857 kB/s | 86 kB 00:00 (13/23): python3-isort-5.12.0-4.fc39.noarch.rpm 1.7 MB/s | 239 kB 00:00 (14/23): python3-markupsafe-2.1.3-2.fc39.x86_64 392 kB/s | 30 kB 00:00 (15/23): python3-jinja2-3.1.2-5.fc39.noarch.rpm 3.4 MB/s | 506 kB 00:00 (16/23): python3-mccabe-0.7.0-4.fc39.noarch.rpm 353 kB/s | 22 kB 00:00 (17/23): python3-pyflakes-3.0.1-3.fc39.noarch.r 1.3 MB/s | 91 kB 00:00 (18/23): python3-pytz-2023.3-3.fc39.noarch.rpm 833 kB/s | 64 kB 00:00 (19/23): python3-psycopg3-3.1.9-3.fc39.noarch.r 2.1 MB/s | 407 kB 00:00 (20/23): python3-six-1.16.0-12.fc39.noarch.rpm 562 kB/s | 41 kB 00:00 (21/23): python3-scramp-1.4.1-7.fc39.noarch.rpm 246 kB/s | 37 kB 00:00 (22/23): python3-pygments-2.15.1-4.fc39.noarch. 7.0 MB/s | 2.4 MB 00:00 (23/23): python3-sqlalchemy-1.4.49-2.fc39.x86_6 9.4 MB/s | 2.9 MB 00:00 -------------------------------------------------------------------------------- Total 5.6 MB/s | 9.4 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-six-1.16.0-12.fc39.noarch 1/23 Installing : libpq-15.0-4.fc39.x86_64 2/23 Installing : python3-pyflakes-3.0.1-3.fc39.noarch 3/23 Installing : python3-mccabe-0.7.0-4.fc39.noarch 4/23 Installing : python3-markupsafe-2.1.3-2.fc39.x86_64 5/23 Installing : python3-typing-extensions-4.7.1-2.fc39.noarch 6/23 Installing : python3-pycodestyle-2.10.0-2.fc39.noarch 7/23 Installing : python3-greenlet-2.0.2-2.fc39.x86_64 8/23 Installing : python3-sqlalchemy-1.4.49-2.fc39.x86_64 9/23 Installing : python3-asn1crypto-1.5.1-6.fc39.noarch 10/23 Installing : python3-scramp-1.4.1-7.fc39.noarch 11/23 Installing : python3-pg8000-1.26.1-6.fc39.noarch 12/23 Installing : python3-flake8-6.0.0-2.fc39.noarch 13/23 Installing : python3-psycopg3-3.1.9-3.fc39.noarch 14/23 Installing : python3-jinja2-3.1.2-5.fc39.noarch 15/23 Installing : python3-psycopg2-2.9.6-3.fc39.x86_64 16/23 Installing : python3-dateutil-1:2.8.2-10.fc39.noarch 17/23 Installing : python3-pytz-2023.3-3.fc39.noarch 18/23 Installing : python3-pygments-2.15.1-4.fc39.noarch 19/23 Installing : python3-isort-5.12.0-4.fc39.noarch 20/23 Installing : python3-flexmock-0.11.3-7.fc39.noarch 21/23 Installing : python3-docutils-0.19-4.fc39.noarch 22/23 Installing : python3-PyMySQL-1.1.0-3.fc39.noarch 23/23 Running scriptlet: python3-PyMySQL-1.1.0-3.fc39.noarch 23/23 Verifying : python3-PyMySQL-1.1.0-3.fc39.noarch 1/23 Verifying : python3-asn1crypto-1.5.1-6.fc39.noarch 2/23 Verifying : python3-docutils-0.19-4.fc39.noarch 3/23 Verifying : python3-greenlet-2.0.2-2.fc39.x86_64 4/23 Verifying : python3-pg8000-1.26.1-6.fc39.noarch 5/23 Verifying : python3-psycopg2-2.9.6-3.fc39.x86_64 6/23 Verifying : python3-pycodestyle-2.10.0-2.fc39.noarch 7/23 Verifying : python3-typing-extensions-4.7.1-2.fc39.noarch 8/23 Verifying : libpq-15.0-4.fc39.x86_64 9/23 Verifying : python3-dateutil-1:2.8.2-10.fc39.noarch 10/23 Verifying : python3-flake8-6.0.0-2.fc39.noarch 11/23 Verifying : python3-flexmock-0.11.3-7.fc39.noarch 12/23 Verifying : python3-isort-5.12.0-4.fc39.noarch 13/23 Verifying : python3-jinja2-3.1.2-5.fc39.noarch 14/23 Verifying : python3-markupsafe-2.1.3-2.fc39.x86_64 15/23 Verifying : python3-mccabe-0.7.0-4.fc39.noarch 16/23 Verifying : python3-psycopg3-3.1.9-3.fc39.noarch 17/23 Verifying : python3-pyflakes-3.0.1-3.fc39.noarch 18/23 Verifying : python3-pygments-2.15.1-4.fc39.noarch 19/23 Verifying : python3-pytz-2023.3-3.fc39.noarch 20/23 Verifying : python3-scramp-1.4.1-7.fc39.noarch 21/23 Verifying : python3-six-1.16.0-12.fc39.noarch 22/23 Verifying : python3-sqlalchemy-1.4.49-2.fc39.x86_64 23/23 Installed: libpq-15.0-4.fc39.x86_64 python3-PyMySQL-1.1.0-3.fc39.noarch python3-asn1crypto-1.5.1-6.fc39.noarch python3-dateutil-1:2.8.2-10.fc39.noarch python3-docutils-0.19-4.fc39.noarch python3-flake8-6.0.0-2.fc39.noarch python3-flexmock-0.11.3-7.fc39.noarch python3-greenlet-2.0.2-2.fc39.x86_64 python3-isort-5.12.0-4.fc39.noarch python3-jinja2-3.1.2-5.fc39.noarch python3-markupsafe-2.1.3-2.fc39.x86_64 python3-mccabe-0.7.0-4.fc39.noarch python3-pg8000-1.26.1-6.fc39.noarch python3-psycopg2-2.9.6-3.fc39.x86_64 python3-psycopg3-3.1.9-3.fc39.noarch python3-pycodestyle-2.10.0-2.fc39.noarch python3-pyflakes-3.0.1-3.fc39.noarch python3-pygments-2.15.1-4.fc39.noarch python3-pytz-2023.3-3.fc39.noarch python3-scramp-1.4.1-7.fc39.noarch python3-six-1.16.0-12.fc39.noarch python3-sqlalchemy-1.4.49-2.fc39.x86_64 python3-typing-extensions-4.7.1-2.fc39.noarch Complete! Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1689897600 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.UYE3hd + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf SQLAlchemy-Utils-0.41.1 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/SQLAlchemy-Utils-0.41.1.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd SQLAlchemy-Utils-0.41.1 + /usr/bin/mkdir -p SPECPARTS + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/no-psycopg2cffi.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/python-sqlalchemy-utils-0.41.1-no-pyodbc-dep.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + rm -rf SQLAlchemy-Utils.egg-info + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.8YsKpQ + umask 022 + cd /builddir/build/BUILD + cd SQLAlchemy-Utils-0.41.1 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/.pyproject-builddir + RPM_TOXENV=py312 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/pyproject-wheeldir --output /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires -x test Handling setuptools >= 40.8 from default build backend Requirement satisfied: setuptools >= 40.8 (installed: setuptools 67.7.2) Handling wheel from default build backend Requirement satisfied: wheel (installed: wheel 0.40.0) running egg_info writing SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to SQLAlchemy_Utils.egg-info/top_level.txt reading manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.40.0) running dist_info writing SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to SQLAlchemy_Utils.egg-info/top_level.txt reading manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/SQLAlchemy_Utils-0.41.1.dist-info' Handling SQLAlchemy (>=1.3) from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: SQLAlchemy (>=1.3) (installed: SQLAlchemy 1.4.49) Handling importlib-metadata ; python_version < "3.8" from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: importlib-metadata ; python_version < "3.8" Handling arrow (>=0.3.4) ; extra == 'arrow' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: arrow (>=0.3.4) ; extra == 'arrow' Handling Babel (>=1.3) ; extra == 'babel' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Babel (>=1.3) ; extra == 'babel' Handling colour (>=0.0.4) ; extra == 'color' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: colour (>=0.0.4) ; extra == 'color' Handling cryptography (>=0.6) ; extra == 'encrypted' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: cryptography (>=0.6) ; extra == 'encrypted' Handling intervals (>=0.7.1) ; extra == 'intervals' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: intervals (>=0.7.1) ; extra == 'intervals' Handling passlib (<2.0,>=1.6) ; extra == 'password' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: passlib (<2.0,>=1.6) ; extra == 'password' Handling pendulum (>=2.0.5) ; extra == 'pendulum' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pendulum (>=2.0.5) ; extra == 'pendulum' Handling phonenumbers (>=5.9.2) ; extra == 'phone' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: phonenumbers (>=5.9.2) ; extra == 'phone' Handling pytest (>=2.7.1) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pytest (>=2.7.1) ; extra == 'test' (installed: pytest 7.3.2) Handling Pygments (>=1.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: Pygments (>=1.2) ; extra == 'test' (installed: Pygments 2.15.1) Handling Jinja2 (>=2.3) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: Jinja2 (>=2.3) ; extra == 'test' (installed: Jinja2 3.1.2) Handling docutils (>=0.10) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: docutils (>=0.10) ; extra == 'test' (installed: docutils 0.19) Handling flexmock (>=0.9.7) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: flexmock (>=0.9.7) ; extra == 'test' (installed: flexmock 0.11.3) Handling psycopg (>=3.1.8) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: psycopg (>=3.1.8) ; extra == 'test' (installed: psycopg 3.1.9) Handling psycopg2 (>=2.5.1) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: psycopg2 (>=2.5.1) ; extra == 'test' (installed: psycopg2 2.9.6) Handling pg8000 (>=1.12.4) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pg8000 (>=1.12.4) ; extra == 'test' (installed: pg8000 1.26.1) Handling pytz (>=2014.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pytz (>=2014.2) ; extra == 'test' (installed: pytz 2023.3) Handling python-dateutil (>=2.6) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: python-dateutil (>=2.6) ; extra == 'test' (installed: python-dateutil 2.8.2) Handling pymysql ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pymysql ; extra == 'test' (installed: pymysql 1.1.0) Handling flake8 (>=2.4.0) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: flake8 (>=2.4.0) ; extra == 'test' (installed: flake8 6.0.0) Handling isort (>=4.2.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: isort (>=4.2.2) ; extra == 'test' (installed: isort 5.12.0) Handling backports.zoneinfo ; (python_version < "3.9") and extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: backports.zoneinfo ; (python_version < "3.9") and extra == 'test' Handling Babel (>=1.3) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Babel (>=1.3) ; extra == 'test_all' Handling Jinja2 (>=2.3) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Jinja2 (>=2.3) ; extra == 'test_all' Handling Pygments (>=1.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Pygments (>=1.2) ; extra == 'test_all' Handling arrow (>=0.3.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: arrow (>=0.3.4) ; extra == 'test_all' Handling colour (>=0.0.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: colour (>=0.0.4) ; extra == 'test_all' Handling cryptography (>=0.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: cryptography (>=0.6) ; extra == 'test_all' Handling docutils (>=0.10) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: docutils (>=0.10) ; extra == 'test_all' Handling flake8 (>=2.4.0) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: flake8 (>=2.4.0) ; extra == 'test_all' Handling flexmock (>=0.9.7) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: flexmock (>=0.9.7) ; extra == 'test_all' Handling furl (>=0.4.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: furl (>=0.4.1) ; extra == 'test_all' Handling intervals (>=0.7.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: intervals (>=0.7.1) ; extra == 'test_all' Handling isort (>=4.2.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: isort (>=4.2.2) ; extra == 'test_all' Handling passlib (<2.0,>=1.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: passlib (<2.0,>=1.6) ; extra == 'test_all' Handling pendulum (>=2.0.5) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pendulum (>=2.0.5) ; extra == 'test_all' Handling pg8000 (>=1.12.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pg8000 (>=1.12.4) ; extra == 'test_all' Handling phonenumbers (>=5.9.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: phonenumbers (>=5.9.2) ; extra == 'test_all' Handling psycopg2 (>=2.5.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: psycopg2 (>=2.5.1) ; extra == 'test_all' Handling psycopg (>=3.1.8) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: psycopg (>=3.1.8) ; extra == 'test_all' Handling pymysql ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pymysql ; extra == 'test_all' Handling pytest (>=2.7.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pytest (>=2.7.1) ; extra == 'test_all' Handling python-dateutil ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil ; extra == 'test_all' Handling python-dateutil (>=2.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil (>=2.6) ; extra == 'test_all' Handling pytz (>=2014.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pytz (>=2014.2) ; extra == 'test_all' Handling backports.zoneinfo ; (python_version < "3.9") and extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: backports.zoneinfo ; (python_version < "3.9") and extra == 'test_all' Handling python-dateutil ; extra == 'timezone' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil ; extra == 'timezone' Handling furl (>=0.4.1) ; extra == 'url' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: furl (>=0.4.1) ; extra == 'url' + cat /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires + rm -rfv SQLAlchemy_Utils-0.41.1.dist-info/ removed 'SQLAlchemy_Utils-0.41.1.dist-info/LICENSE' removed 'SQLAlchemy_Utils-0.41.1.dist-info/METADATA' removed 'SQLAlchemy_Utils-0.41.1.dist-info/top_level.txt' removed directory 'SQLAlchemy_Utils-0.41.1.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-sqlalchemy-utils-0.41.1-2.fc39.buildreqs.nosrc.rpm INFO: Going to install missing dynamic buildrequires No matches found for the following disable plugin patterns: local, spacewalk, versionlock Copr repository 33 kB/s | 2.2 kB 00:00 fedora 550 kB/s | 22 kB 00:00 Package pyproject-rpm-macros-1.9.0-2.fc39.noarch is already installed. Package python3-colour-0.1.5-16.fc39.noarch is already installed. Package python3-devel-3.12.0~b4-2.fc39.x86_64 is already installed. Package python3-devel-3.12.0~b4-2.fc39.x86_64 is already installed. Package python3-phonenumbers-8.12.53-4.fc39.noarch is already installed. Package python3-pytest-7.3.2-4.fc39.noarch is already installed. Package python3-docutils-0.19-4.fc39.noarch is already installed. Package python3-flake8-6.0.0-2.fc39.noarch is already installed. Package python3-flexmock-0.11.3-7.fc39.noarch is already installed. Package python3-isort-5.12.0-4.fc39.noarch is already installed. Package python3-jinja2-3.1.2-5.fc39.noarch is already installed. Package python3-packaging-23.1-4.fc39.noarch is already installed. Package python3-pg8000-1.26.1-6.fc39.noarch is already installed. Package python3-pip-23.1.2-5.fc39.noarch is already installed. Package python3-psycopg3-3.1.9-3.fc39.noarch is already installed. Package python3-psycopg2-2.9.6-3.fc39.x86_64 is already installed. Package python3-pygments-2.15.1-4.fc39.noarch is already installed. Package python3-PyMySQL-1.1.0-3.fc39.noarch is already installed. Package python3-pytest-7.3.2-4.fc39.noarch is already installed. Package python3-dateutil-1:2.8.2-10.fc39.noarch is already installed. Package python3-pytz-2023.3-3.fc39.noarch is already installed. Package python3-setuptools-67.7.2-5.fc39.noarch is already installed. Package python3-sqlalchemy-1.4.49-2.fc39.x86_64 is already installed. Package python3-wheel-1:0.40.0-4.fc39.noarch is already installed. Dependencies resolved. Nothing to do. Complete! Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1689897600 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.NcGBK1 + umask 022 + cd /builddir/build/BUILD + cd SQLAlchemy-Utils-0.41.1 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + '[' -f setup.py ']' + echo 'python3dist(setuptools) >= 40.8' + echo 'python3dist(wheel)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/.pyproject-builddir + RPM_TOXENV=py312 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/pyproject-wheeldir --output /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires -x test Handling setuptools >= 40.8 from default build backend Requirement satisfied: setuptools >= 40.8 (installed: setuptools 67.7.2) Handling wheel from default build backend Requirement satisfied: wheel (installed: wheel 0.40.0) running egg_info writing SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to SQLAlchemy_Utils.egg-info/top_level.txt reading manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.40.0) running dist_info writing SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to SQLAlchemy_Utils.egg-info/top_level.txt reading manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/SQLAlchemy_Utils-0.41.1.dist-info' Handling SQLAlchemy (>=1.3) from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: SQLAlchemy (>=1.3) (installed: SQLAlchemy 1.4.49) Handling importlib-metadata ; python_version < "3.8" from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: importlib-metadata ; python_version < "3.8" Handling arrow (>=0.3.4) ; extra == 'arrow' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: arrow (>=0.3.4) ; extra == 'arrow' Handling Babel (>=1.3) ; extra == 'babel' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Babel (>=1.3) ; extra == 'babel' Handling colour (>=0.0.4) ; extra == 'color' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: colour (>=0.0.4) ; extra == 'color' Handling cryptography (>=0.6) ; extra == 'encrypted' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: cryptography (>=0.6) ; extra == 'encrypted' Handling intervals (>=0.7.1) ; extra == 'intervals' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: intervals (>=0.7.1) ; extra == 'intervals' Handling passlib (<2.0,>=1.6) ; extra == 'password' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: passlib (<2.0,>=1.6) ; extra == 'password' Handling pendulum (>=2.0.5) ; extra == 'pendulum' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pendulum (>=2.0.5) ; extra == 'pendulum' Handling phonenumbers (>=5.9.2) ; extra == 'phone' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: phonenumbers (>=5.9.2) ; extra == 'phone' Handling pytest (>=2.7.1) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pytest (>=2.7.1) ; extra == 'test' (installed: pytest 7.3.2) Handling Pygments (>=1.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: Pygments (>=1.2) ; extra == 'test' (installed: Pygments 2.15.1) Handling Jinja2 (>=2.3) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: Jinja2 (>=2.3) ; extra == 'test' (installed: Jinja2 3.1.2) Handling docutils (>=0.10) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: docutils (>=0.10) ; extra == 'test' (installed: docutils 0.19) Handling flexmock (>=0.9.7) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: flexmock (>=0.9.7) ; extra == 'test' (installed: flexmock 0.11.3) Handling psycopg (>=3.1.8) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: psycopg (>=3.1.8) ; extra == 'test' (installed: psycopg 3.1.9) Handling psycopg2 (>=2.5.1) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: psycopg2 (>=2.5.1) ; extra == 'test' (installed: psycopg2 2.9.6) Handling pg8000 (>=1.12.4) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pg8000 (>=1.12.4) ; extra == 'test' (installed: pg8000 1.26.1) Handling pytz (>=2014.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pytz (>=2014.2) ; extra == 'test' (installed: pytz 2023.3) Handling python-dateutil (>=2.6) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: python-dateutil (>=2.6) ; extra == 'test' (installed: python-dateutil 2.8.2) Handling pymysql ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: pymysql ; extra == 'test' (installed: pymysql 1.1.0) Handling flake8 (>=2.4.0) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: flake8 (>=2.4.0) ; extra == 'test' (installed: flake8 6.0.0) Handling isort (>=4.2.2) ; extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Requirement satisfied: isort (>=4.2.2) ; extra == 'test' (installed: isort 5.12.0) Handling backports.zoneinfo ; (python_version < "3.9") and extra == 'test' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: backports.zoneinfo ; (python_version < "3.9") and extra == 'test' Handling Babel (>=1.3) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Babel (>=1.3) ; extra == 'test_all' Handling Jinja2 (>=2.3) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Jinja2 (>=2.3) ; extra == 'test_all' Handling Pygments (>=1.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: Pygments (>=1.2) ; extra == 'test_all' Handling arrow (>=0.3.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: arrow (>=0.3.4) ; extra == 'test_all' Handling colour (>=0.0.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: colour (>=0.0.4) ; extra == 'test_all' Handling cryptography (>=0.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: cryptography (>=0.6) ; extra == 'test_all' Handling docutils (>=0.10) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: docutils (>=0.10) ; extra == 'test_all' Handling flake8 (>=2.4.0) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: flake8 (>=2.4.0) ; extra == 'test_all' Handling flexmock (>=0.9.7) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: flexmock (>=0.9.7) ; extra == 'test_all' Handling furl (>=0.4.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: furl (>=0.4.1) ; extra == 'test_all' Handling intervals (>=0.7.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: intervals (>=0.7.1) ; extra == 'test_all' Handling isort (>=4.2.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: isort (>=4.2.2) ; extra == 'test_all' Handling passlib (<2.0,>=1.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: passlib (<2.0,>=1.6) ; extra == 'test_all' Handling pendulum (>=2.0.5) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pendulum (>=2.0.5) ; extra == 'test_all' Handling pg8000 (>=1.12.4) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pg8000 (>=1.12.4) ; extra == 'test_all' Handling phonenumbers (>=5.9.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: phonenumbers (>=5.9.2) ; extra == 'test_all' Handling psycopg2 (>=2.5.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: psycopg2 (>=2.5.1) ; extra == 'test_all' Handling psycopg (>=3.1.8) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: psycopg (>=3.1.8) ; extra == 'test_all' Handling pymysql ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pymysql ; extra == 'test_all' Handling pytest (>=2.7.1) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pytest (>=2.7.1) ; extra == 'test_all' Handling python-dateutil ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil ; extra == 'test_all' Handling python-dateutil (>=2.6) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil (>=2.6) ; extra == 'test_all' Handling pytz (>=2014.2) ; extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: pytz (>=2014.2) ; extra == 'test_all' Handling backports.zoneinfo ; (python_version < "3.9") and extra == 'test_all' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: backports.zoneinfo ; (python_version < "3.9") and extra == 'test_all' Handling python-dateutil ; extra == 'timezone' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: python-dateutil ; extra == 'timezone' Handling furl (>=0.4.1) ; extra == 'url' from hook generated metadata: Requires-Dist (SQLAlchemy-Utils) Ignoring alien requirement: furl (>=0.4.1) ; extra == 'url' + cat /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-buildrequires + rm -rfv SQLAlchemy_Utils-0.41.1.dist-info/ removed 'SQLAlchemy_Utils-0.41.1.dist-info/LICENSE' removed 'SQLAlchemy_Utils-0.41.1.dist-info/METADATA' removed 'SQLAlchemy_Utils-0.41.1.dist-info/top_level.txt' removed directory 'SQLAlchemy_Utils-0.41.1.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.2cXuOW + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd SQLAlchemy-Utils-0.41.1 + mkdir -p /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + TMPDIR=/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_wheel.py /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/pyproject-wheeldir Processing /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1 Preparing metadata (pyproject.toml): started Running command Preparing metadata (pyproject.toml) running dist_info creating /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info writing /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info/top_level.txt writing manifest file '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest file '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-modern-metadata-y6_x0a2a/SQLAlchemy_Utils-0.41.1.dist-info' Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: SQLAlchemy-Utils Building wheel for SQLAlchemy-Utils (pyproject.toml): started Running command Building wheel for SQLAlchemy-Utils (pyproject.toml) running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/sqlalchemy_utils copying sqlalchemy_utils/view.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/utils.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/query_chain.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/proxy_dict.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/path.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/operators.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/observer.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/models.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/listeners.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/i18n.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/generic.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/expressions.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/exceptions.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/compat.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/asserts.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/aggregates.py -> build/lib/sqlalchemy_utils copying sqlalchemy_utils/__init__.py -> build/lib/sqlalchemy_utils creating build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/weekdays.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/uuid.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/url.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/ts_vector.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/timezone.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/scalar_list.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/scalar_coercible.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/range.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/phone_number.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/pg_composite.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/password.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/ltree.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/locale.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/json.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/ip_address.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/email.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/currency.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/country.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/color.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/choice.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/bit.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/arrow.py -> build/lib/sqlalchemy_utils/types copying sqlalchemy_utils/types/__init__.py -> build/lib/sqlalchemy_utils/types creating build/lib/sqlalchemy_utils/relationships copying sqlalchemy_utils/relationships/chained_join.py -> build/lib/sqlalchemy_utils/relationships copying sqlalchemy_utils/relationships/__init__.py -> build/lib/sqlalchemy_utils/relationships creating build/lib/sqlalchemy_utils/primitives copying sqlalchemy_utils/primitives/weekdays.py -> build/lib/sqlalchemy_utils/primitives copying sqlalchemy_utils/primitives/weekday.py -> build/lib/sqlalchemy_utils/primitives copying sqlalchemy_utils/primitives/ltree.py -> build/lib/sqlalchemy_utils/primitives copying sqlalchemy_utils/primitives/currency.py -> build/lib/sqlalchemy_utils/primitives copying sqlalchemy_utils/primitives/country.py -> build/lib/sqlalchemy_utils/primitives copying sqlalchemy_utils/primitives/__init__.py -> build/lib/sqlalchemy_utils/primitives creating build/lib/sqlalchemy_utils/functions copying sqlalchemy_utils/functions/sort_query.py -> build/lib/sqlalchemy_utils/functions copying sqlalchemy_utils/functions/render.py -> build/lib/sqlalchemy_utils/functions copying sqlalchemy_utils/functions/orm.py -> build/lib/sqlalchemy_utils/functions copying sqlalchemy_utils/functions/mock.py -> build/lib/sqlalchemy_utils/functions copying sqlalchemy_utils/functions/foreign_keys.py -> build/lib/sqlalchemy_utils/functions copying sqlalchemy_utils/functions/database.py -> build/lib/sqlalchemy_utils/functions copying sqlalchemy_utils/functions/__init__.py -> build/lib/sqlalchemy_utils/functions creating build/lib/sqlalchemy_utils/types/enriched_datetime copying sqlalchemy_utils/types/enriched_datetime/pendulum_datetime.py -> build/lib/sqlalchemy_utils/types/enriched_datetime copying sqlalchemy_utils/types/enriched_datetime/pendulum_date.py -> build/lib/sqlalchemy_utils/types/enriched_datetime copying sqlalchemy_utils/types/enriched_datetime/enriched_datetime_type.py -> build/lib/sqlalchemy_utils/types/enriched_datetime copying sqlalchemy_utils/types/enriched_datetime/enriched_date_type.py -> build/lib/sqlalchemy_utils/types/enriched_datetime copying sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py -> build/lib/sqlalchemy_utils/types/enriched_datetime copying sqlalchemy_utils/types/enriched_datetime/__init__.py -> build/lib/sqlalchemy_utils/types/enriched_datetime creating build/lib/sqlalchemy_utils/types/encrypted copying sqlalchemy_utils/types/encrypted/padding.py -> build/lib/sqlalchemy_utils/types/encrypted copying sqlalchemy_utils/types/encrypted/encrypted_type.py -> build/lib/sqlalchemy_utils/types/encrypted copying sqlalchemy_utils/types/encrypted/__init__.py -> build/lib/sqlalchemy_utils/types/encrypted running egg_info writing SQLAlchemy_Utils.egg-info/PKG-INFO writing dependency_links to SQLAlchemy_Utils.egg-info/dependency_links.txt writing requirements to SQLAlchemy_Utils.egg-info/requires.txt writing top-level names to SQLAlchemy_Utils.egg-info/top_level.txt reading manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*.pyc' found under directory 'tests' warning: no previously-included files matching '*.pyc' found under directory 'docs' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'docs/_themes/.git' adding license file 'LICENSE' writing manifest file 'SQLAlchemy_Utils.egg-info/SOURCES.txt' installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/sqlalchemy_utils creating build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions copying build/lib/sqlalchemy_utils/functions/__init__.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions copying build/lib/sqlalchemy_utils/functions/database.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions copying build/lib/sqlalchemy_utils/functions/foreign_keys.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions copying build/lib/sqlalchemy_utils/functions/mock.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions copying build/lib/sqlalchemy_utils/functions/orm.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions copying build/lib/sqlalchemy_utils/functions/render.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions copying build/lib/sqlalchemy_utils/functions/sort_query.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/functions creating build/bdist.linux-x86_64/wheel/sqlalchemy_utils/primitives copying build/lib/sqlalchemy_utils/primitives/__init__.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/primitives copying build/lib/sqlalchemy_utils/primitives/country.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/primitives copying build/lib/sqlalchemy_utils/primitives/currency.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/primitives copying build/lib/sqlalchemy_utils/primitives/ltree.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/primitives copying build/lib/sqlalchemy_utils/primitives/weekday.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/primitives copying build/lib/sqlalchemy_utils/primitives/weekdays.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/primitives creating build/bdist.linux-x86_64/wheel/sqlalchemy_utils/relationships copying build/lib/sqlalchemy_utils/relationships/__init__.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/relationships copying build/lib/sqlalchemy_utils/relationships/chained_join.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/relationships creating build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types creating build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/encrypted copying build/lib/sqlalchemy_utils/types/encrypted/__init__.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/encrypted copying build/lib/sqlalchemy_utils/types/encrypted/encrypted_type.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/encrypted copying build/lib/sqlalchemy_utils/types/encrypted/padding.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/encrypted creating build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/enriched_datetime copying build/lib/sqlalchemy_utils/types/enriched_datetime/__init__.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/enriched_datetime copying build/lib/sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/enriched_datetime copying build/lib/sqlalchemy_utils/types/enriched_datetime/enriched_date_type.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/enriched_datetime copying build/lib/sqlalchemy_utils/types/enriched_datetime/enriched_datetime_type.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/enriched_datetime copying build/lib/sqlalchemy_utils/types/enriched_datetime/pendulum_date.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/enriched_datetime copying build/lib/sqlalchemy_utils/types/enriched_datetime/pendulum_datetime.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types/enriched_datetime copying build/lib/sqlalchemy_utils/types/__init__.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/arrow.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/bit.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/choice.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/color.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/country.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/currency.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/email.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/ip_address.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/json.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/locale.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/ltree.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/password.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/pg_composite.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/phone_number.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/range.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/scalar_coercible.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/scalar_list.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/timezone.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/ts_vector.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/url.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/uuid.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/types/weekdays.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils/types copying build/lib/sqlalchemy_utils/__init__.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/aggregates.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/asserts.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/compat.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/exceptions.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/expressions.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/generic.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/i18n.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/listeners.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/models.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/observer.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/operators.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/path.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/proxy_dict.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/query_chain.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/utils.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils copying build/lib/sqlalchemy_utils/view.py -> build/bdist.linux-x86_64/wheel/sqlalchemy_utils running install_egg_info Copying SQLAlchemy_Utils.egg-info to build/bdist.linux-x86_64/wheel/SQLAlchemy_Utils-0.41.1-py3.12.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/SQLAlchemy_Utils-0.41.1.dist-info/WHEEL creating '/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir/pip-wheel-pvotrhab/.tmp-1cxblbgz/SQLAlchemy_Utils-0.41.1-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'sqlalchemy_utils/__init__.py' adding 'sqlalchemy_utils/aggregates.py' adding 'sqlalchemy_utils/asserts.py' adding 'sqlalchemy_utils/compat.py' adding 'sqlalchemy_utils/exceptions.py' adding 'sqlalchemy_utils/expressions.py' adding 'sqlalchemy_utils/generic.py' adding 'sqlalchemy_utils/i18n.py' adding 'sqlalchemy_utils/listeners.py' adding 'sqlalchemy_utils/models.py' adding 'sqlalchemy_utils/observer.py' adding 'sqlalchemy_utils/operators.py' adding 'sqlalchemy_utils/path.py' adding 'sqlalchemy_utils/proxy_dict.py' adding 'sqlalchemy_utils/query_chain.py' adding 'sqlalchemy_utils/utils.py' adding 'sqlalchemy_utils/view.py' adding 'sqlalchemy_utils/functions/__init__.py' adding 'sqlalchemy_utils/functions/database.py' adding 'sqlalchemy_utils/functions/foreign_keys.py' adding 'sqlalchemy_utils/functions/mock.py' adding 'sqlalchemy_utils/functions/orm.py' adding 'sqlalchemy_utils/functions/render.py' adding 'sqlalchemy_utils/functions/sort_query.py' adding 'sqlalchemy_utils/primitives/__init__.py' adding 'sqlalchemy_utils/primitives/country.py' adding 'sqlalchemy_utils/primitives/currency.py' adding 'sqlalchemy_utils/primitives/ltree.py' adding 'sqlalchemy_utils/primitives/weekday.py' adding 'sqlalchemy_utils/primitives/weekdays.py' adding 'sqlalchemy_utils/relationships/__init__.py' adding 'sqlalchemy_utils/relationships/chained_join.py' adding 'sqlalchemy_utils/types/__init__.py' adding 'sqlalchemy_utils/types/arrow.py' adding 'sqlalchemy_utils/types/bit.py' adding 'sqlalchemy_utils/types/choice.py' adding 'sqlalchemy_utils/types/color.py' adding 'sqlalchemy_utils/types/country.py' adding 'sqlalchemy_utils/types/currency.py' adding 'sqlalchemy_utils/types/email.py' adding 'sqlalchemy_utils/types/ip_address.py' adding 'sqlalchemy_utils/types/json.py' adding 'sqlalchemy_utils/types/locale.py' adding 'sqlalchemy_utils/types/ltree.py' adding 'sqlalchemy_utils/types/password.py' adding 'sqlalchemy_utils/types/pg_composite.py' adding 'sqlalchemy_utils/types/phone_number.py' adding 'sqlalchemy_utils/types/range.py' adding 'sqlalchemy_utils/types/scalar_coercible.py' adding 'sqlalchemy_utils/types/scalar_list.py' adding 'sqlalchemy_utils/types/timezone.py' adding 'sqlalchemy_utils/types/ts_vector.py' adding 'sqlalchemy_utils/types/url.py' adding 'sqlalchemy_utils/types/uuid.py' adding 'sqlalchemy_utils/types/weekdays.py' adding 'sqlalchemy_utils/types/encrypted/__init__.py' adding 'sqlalchemy_utils/types/encrypted/encrypted_type.py' adding 'sqlalchemy_utils/types/encrypted/padding.py' adding 'sqlalchemy_utils/types/enriched_datetime/__init__.py' adding 'sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py' adding 'sqlalchemy_utils/types/enriched_datetime/enriched_date_type.py' adding 'sqlalchemy_utils/types/enriched_datetime/enriched_datetime_type.py' adding 'sqlalchemy_utils/types/enriched_datetime/pendulum_date.py' adding 'sqlalchemy_utils/types/enriched_datetime/pendulum_datetime.py' adding 'SQLAlchemy_Utils-0.41.1.dist-info/LICENSE' adding 'SQLAlchemy_Utils-0.41.1.dist-info/METADATA' adding 'SQLAlchemy_Utils-0.41.1.dist-info/WHEEL' adding 'SQLAlchemy_Utils-0.41.1.dist-info/top_level.txt' adding 'SQLAlchemy_Utils-0.41.1.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Building wheel for SQLAlchemy-Utils (pyproject.toml): finished with status 'done' Created wheel for SQLAlchemy-Utils: filename=SQLAlchemy_Utils-0.41.1-py3-none-any.whl size=92588 sha256=f604f35d03dfe7ca22fb06f1b2bae504e98aea662da9ec616ad3645ed2c63b80 Stored in directory: /builddir/.cache/pip/wheels/38/ea/ea/2f66a23429354a167780b4f59acbec2fc5ff5c02ca29617ff0 Successfully built SQLAlchemy-Utils + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.mN9V1W + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 ++ dirname /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd SQLAlchemy-Utils-0.41.1 ++ ls /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/pyproject-wheeldir/SQLAlchemy_Utils-0.41.1-py3-none-any.whl ++ sed -E 's/([^-]+)-([^-]+)-.+\.whl/\1==\2/' ++ xargs basename --multiple + specifier=SQLAlchemy_Utils==0.41.1 + TMPDIR=/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir + /usr/bin/python3 -m pip install --root /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 --prefix /usr --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/pyproject-wheeldir SQLAlchemy_Utils==0.41.1 Using pip 23.1.2 from /usr/lib/python3.12/site-packages/pip (python 3.12) Looking in links: /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/pyproject-wheeldir Processing ./pyproject-wheeldir/SQLAlchemy_Utils-0.41.1-py3-none-any.whl Installing collected packages: SQLAlchemy_Utils Successfully installed SQLAlchemy_Utils-0.41.1 + '[' -d /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/bin ']' + rm -f /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-ghost-distinfo + site_dirs=() + '[' -d /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages ']' + site_dirs+=("/usr/lib/python3.12/site-packages") + '[' /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib64/python3.12/site-packages '!=' /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages ']' + '[' -d /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib64/python3.12/site-packages ']' + for site_dir in ${site_dirs[@]} + for distinfo in /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64$site_dir/*.dist-info + echo '%ghost /usr/lib/python3.12/site-packages/SQLAlchemy_Utils-0.41.1.dist-info' + sed -i s/pip/rpm/ /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages/SQLAlchemy_Utils-0.41.1.dist-info/INSTALLER + PYTHONPATH=/usr/lib/rpm/redhat + /usr/bin/python3 -B /usr/lib/rpm/redhat/pyproject_preprocess_record.py --buildroot /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 --record /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages/SQLAlchemy_Utils-0.41.1.dist-info/RECORD --output /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-record + rm -fv /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages/SQLAlchemy_Utils-0.41.1.dist-info/RECORD removed '/builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages/SQLAlchemy_Utils-0.41.1.dist-info/RECORD' + rm -fv /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages/SQLAlchemy_Utils-0.41.1.dist-info/REQUESTED removed '/builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages/SQLAlchemy_Utils-0.41.1.dist-info/REQUESTED' ++ wc -l /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-ghost-distinfo ++ cut -f1 '-d ' + lines=1 + '[' 1 -ne 1 ']' + RPM_PERCENTAGES_COUNT=2 + /usr/bin/python3 /usr/lib/rpm/redhat/pyproject_save_files.py --output-files /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-files --output-modules /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-modules --buildroot /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 --sitelib /usr/lib/python3.12/site-packages --sitearch /usr/lib64/python3.12/site-packages --python-version 3.12 --pyproject-record /builddir/build/BUILD/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64-pyproject-record --prefix /usr sqlalchemy_utils + /usr/bin/find-debuginfo -j2 --strict-build-id -m -i --build-id-seed 0.41.1-2.fc39 --unique-debug-suffix -0.41.1-2.fc39.x86_64 --unique-debug-src-base python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1 find-debuginfo: starting Extracting debug info from 0 files Creating .debug symlinks for symlinks to ELF files find: 'debug': No such file or directory find-debuginfo: done + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/redhat/brp-mangle-shebangs + /usr/lib/rpm/brp-remove-la-files + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j2 Bytecompiling .py files below /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12 using python3.12 + /usr/lib/rpm/redhat/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.oHVuKM + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd SQLAlchemy-Utils-0.41.1 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' + PATH=/builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/bin:/builddir/.local/bin:/builddir/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib64/python3.12/site-packages:/builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/lib/python3.12/site-packages + PYTHONDONTWRITEBYTECODE=1 + PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/.pyproject-builddir' + PYTEST_XDIST_AUTO_NUM_WORKERS=2 + /usr/bin/pytest ============================= test session starts ============================== platform linux -- Python 3.12.0b4, pytest-7.3.2, pluggy-1.0.0 rootdir: /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1 collected 2684 items tests/test_asserts.py EEEEEEEEEEEEEEEEE [ 0%] tests/test_auto_delete_orphans.py ... [ 0%] tests/test_case_insensitive_comparator.py .... [ 0%] tests/test_compat.py ........ [ 1%] tests/test_expressions.py ..... [ 1%] tests/test_instant_defaults_listener.py ... [ 1%] tests/test_instrumented_list.py .. [ 1%] tests/test_models.py ..... [ 1%] tests/test_path.py ............................ [ 2%] tests/test_proxy_dict.py ........ [ 3%] tests/test_query_chain.py ......... [ 3%] tests/test_translation_hybrid.py sssssssssssss [ 3%] tests/test_views.py EEEEEE.x [ 4%] tests/aggregate/test_backrefs.py ... [ 4%] tests/aggregate/test_custom_select_expressions.py EE [ 4%] tests/aggregate/test_join_table_inheritance.py .EEEE [ 4%] tests/aggregate/test_m2m.py EE [ 4%] tests/aggregate/test_m2m_m2m.py E [ 4%] tests/aggregate/test_multiple_aggregates_per_class.py ... [ 4%] tests/aggregate/test_o2m_m2m.py E [ 4%] tests/aggregate/test_o2m_o2m.py E [ 4%] tests/aggregate/test_o2m_o2m_o2m.py EE [ 4%] tests/aggregate/test_search_vectors.py E [ 4%] tests/aggregate/test_simple_paths.py ... [ 5%] tests/aggregate/test_with_column_alias.py ... [ 5%] tests/aggregate/test_with_ondelete_cascade.py E [ 5%] tests/functions/test_cast_if.py ...... [ 5%] tests/functions/test_database.py ....FFFFFsFFFs [ 5%] tests/functions/test_dependent_objects.py ....... [ 6%] tests/functions/test_escape_like.py . [ 6%] tests/functions/test_get_bind.py .... [ 6%] tests/functions/test_get_class_by_table.py ..... [ 6%] tests/functions/test_get_column_key.py ... [ 6%] tests/functions/test_get_columns.py ......... [ 7%] tests/functions/test_get_hybrid_properties.py ... [ 7%] tests/functions/test_get_mapper.py ................ [ 7%] tests/functions/test_get_primary_keys.py ..... [ 7%] tests/functions/test_get_referencing_foreign_keys.py .... [ 8%] tests/functions/test_get_tables.py ........ [ 8%] tests/functions/test_get_type.py ...... [ 8%] tests/functions/test_getdotattr.py ... [ 8%] tests/functions/test_has_changes.py ...... [ 8%] tests/functions/test_has_index.py ........ [ 9%] tests/functions/test_has_unique_index.py ......... [ 9%] tests/functions/test_identity.py ...... [ 9%] tests/functions/test_is_loaded.py .. [ 9%] tests/functions/test_json_sql.py EEEEEEEE [ 10%] tests/functions/test_jsonb_sql.py EEEEEEEE [ 10%] tests/functions/test_make_order_by_deterministic.py .......... [ 10%] tests/functions/test_merge_references.py ..... [ 11%] tests/functions/test_naturally_equivalent.py .. [ 11%] tests/functions/test_non_indexed_foreign_keys.py . [ 11%] tests/functions/test_quote.py .. [ 11%] tests/functions/test_render.py ...... [ 11%] tests/functions/test_table_name.py ... [ 11%] tests/generic_relationship/test_abstract_base_class.py ....... [ 11%] tests/generic_relationship/test_column_aliases.py ....... [ 12%] tests/generic_relationship/test_composite_keys.py ....... [ 12%] tests/generic_relationship/test_hybrid_properties.py . [ 12%] tests/generic_relationship/test_single_table_inheritance.py ........ [ 12%] tests/observes/test_column_property.py EEEE [ 12%] tests/observes/test_dynamic_relationship.py EE [ 12%] tests/observes/test_m2m_m2m_m2m.py EEEEE [ 13%] tests/observes/test_o2m_o2m_o2m.py EEEEE [ 13%] tests/observes/test_o2m_o2o_o2m.py EEEEE [ 13%] tests/observes/test_o2o_o2o.py E [ 13%] tests/observes/test_o2o_o2o_o2o.py EEE [ 13%] tests/primitives/test_country.py sssssssssssssssssssssss [ 14%] tests/primitives/test_currency.py sssssssssssss [ 14%] tests/primitives/test_ltree.py ......................................... [ 16%] ....................... [ 17%] tests/primitives/test_weekdays.py ssssssssssssssssssssssssssssssssssssss [ 18%] [ 18%] tests/relationships/test_chained_join.py ......... [ 19%] tests/relationships/test_select_correlated_expression.py EEEEEEEEEEE [ 19%] tests/types/test_arrow.py sssssss [ 19%] tests/types/test_choice.py ................. [ 20%] tests/types/test_color.py ..... [ 20%] tests/types/test_composite.py EEEEsssssssssEE [ 21%] tests/types/test_country.py ssss [ 21%] tests/types/test_currency.py ssss [ 21%] tests/types/test_date_range.py ssssssssssss [ 21%] tests/types/test_datetime_range.py sssssssssss [ 22%] tests/types/test_email.py .... [ 22%] tests/types/test_encrypted.py ssssssssssssssssssssssssssssssssssssssssss [ 24%] sssssssssssssssssssssss......sssssssssssssssssss [ 25%] tests/types/test_enriched_date_pendulum.py ssssss [ 26%] tests/types/test_enriched_datetime_arrow.py sssssss [ 26%] tests/types/test_enriched_datetime_pendulum.py sssss [ 26%] tests/types/test_int_range.py ssssssssssssssssssssssssssssssssssssssssss [ 28%] sssssssssssssss [ 28%] tests/types/test_ip_address.py .. [ 28%] tests/types/test_json.py .....EEEEE [ 29%] tests/types/test_locale.py sssssss [ 29%] tests/types/test_ltree.py E.EE [ 29%] tests/types/test_numeric_range.py ssssssssssssssssss [ 30%] tests/types/test_password.py sssssssssssssssssss [ 30%] tests/types/test_phonenumber.py ......................... [ 31%] tests/types/test_scalar_list.py ..... [ 31%] tests/types/test_timezone.py ........................................... [ 33%] ........................................................................ [ 36%] ........................................................................ [ 38%] ........................................................................ [ 41%] ........................................................................ [ 44%] ........................................................................ [ 46%] ........................................................................ [ 49%] ........................................................................ [ 52%] ........................................................................ [ 55%] ........................................................................ [ 57%] ........................................................................ [ 60%] ........................................................................ [ 63%] ........................................................................ [ 65%] ........................................................................ [ 68%] ........................................................................ [ 71%] ........................................................................ [ 73%] ........................................................................ [ 76%] ........................................................................ [ 79%] ........................................................................ [ 81%] ........................................................................ [ 84%] ........................................................................ [ 87%] ........................................................................ [ 89%] ........................................................................ [ 92%] ........................................................................ [ 95%] ........................................................................ [ 97%] ........................... [ 98%] tests/types/test_tsvector.py .E.E.EE [ 99%] tests/types/test_url.py sss [ 99%] tests/types/test_uuid.py ..... [ 99%] tests/types/test_weekdays.py sssssssss [ 99%] tests/types/encrypted/test_padding.py .... [100%] ==================================== ERRORS ==================================== _____ ERROR at setup of TestAssertMaxLengthWithArray.test_with_max_length ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestAssertMaxLengthWithArray.test_smaller_than_max_length __ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __ ERROR at setup of TestAssertMaxLengthWithArray.test_bigger_than_max_length __ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______ ERROR at setup of TestAssertNonNullable.test_non_nullable_column _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _________ ERROR at setup of TestAssertNonNullable.test_nullable_column _________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __________ ERROR at setup of TestAssertNullable.test_nullable_column ___________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ________ ERROR at setup of TestAssertNullable.test_non_nullable_column _________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __________ ERROR at setup of TestAssertMaxLength.test_with_max_length __________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestAssertMaxLength.test_with_non_nullable_column ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of TestAssertMaxLength.test_smaller_than_max_length ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of TestAssertMaxLength.test_bigger_than_max_length _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___________ ERROR at setup of TestAssertMinValue.test_with_min_value ___________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______ ERROR at setup of TestAssertMinValue.test_smaller_than_min_value _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______ ERROR at setup of TestAssertMinValue.test_bigger_than_min_value ________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___________ ERROR at setup of TestAssertMaxValue.test_with_min_value ___________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______ ERROR at setup of TestAssertMaxValue.test_smaller_than_max_value _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______ ERROR at setup of TestAssertMaxValue.test_bigger_than_max_value ________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ____ ERROR at setup of TestMaterializedViews.test_refresh_materialized_view ____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __________ ERROR at setup of TestMaterializedViews.test_querying_view __________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestPostgresTrivialView.test_life_cycle_no_cascade _____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of TestPostgresTrivialView.test_life_cycle_cascade _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of TestMySqlTrivialView.test_life_cycle_no_cascade _______ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: > sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) /usr/lib/python3.12/site-packages/pymysql/connections.py:644: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) sock.connect(sa) # Break explicitly a reference cycle exceptions.clear() return sock except error as exc: if not all_errors: exceptions.clear() # raise only the last error exceptions.append(exc) if sock is not None: sock.close() if len(exceptions): try: if not all_errors: > raise exceptions[0] /usr/lib64/python3.12/socket.py:852: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) > sock.connect(sa) E ConnectionRefusedError: [Errno 111] Connection refused /usr/lib64/python3.12/socket.py:837: ConnectionRefusedError During handling of the above exception, another exception occurred: self = Engine(mysql+pymysql://root@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'client_flag': 2, 'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'root'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __init__( self, *, user=None, # The first four arguments is based on DB-API 2.0 recommendation. password="", host=None, database=None, unix_socket=None, port=0, charset="", collation=None, sql_mode=None, read_default_file=None, conv=None, use_unicode=True, client_flag=0, cursorclass=Cursor, init_command=None, connect_timeout=10, read_default_group=None, autocommit=False, local_infile=False, max_allowed_packet=16 * 1024 * 1024, defer_connect=False, auth_plugin_map=None, read_timeout=None, write_timeout=None, bind_address=None, binary_prefix=False, program_name=None, server_public_key=None, ssl=None, ssl_ca=None, ssl_cert=None, ssl_disabled=None, ssl_key=None, ssl_verify_cert=None, ssl_verify_identity=None, compress=None, # not supported named_pipe=None, # not supported passwd=None, # deprecated db=None, # deprecated ): if db is not None and database is None: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn("'db' is deprecated, use 'database'", DeprecationWarning, 3) database = db if passwd is not None and not password: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn( # "'passwd' is deprecated, use 'password'", DeprecationWarning, 3 # ) password = passwd if compress or named_pipe: raise NotImplementedError( "compress and named_pipe arguments are not supported" ) self._local_infile = bool(local_infile) if self._local_infile: client_flag |= CLIENT.LOCAL_FILES if read_default_group and not read_default_file: if sys.platform.startswith("win"): read_default_file = "c:\\my.ini" else: read_default_file = "/etc/my.cnf" if read_default_file: if not read_default_group: read_default_group = "client" cfg = Parser() cfg.read(os.path.expanduser(read_default_file)) def _config(key, arg): if arg: return arg try: return cfg.get(read_default_group, key) except Exception: return arg user = _config("user", user) password = _config("password", password) host = _config("host", host) database = _config("database", database) unix_socket = _config("socket", unix_socket) port = int(_config("port", port)) bind_address = _config("bind-address", bind_address) charset = _config("default-character-set", charset) if not ssl: ssl = {} if isinstance(ssl, dict): for key in ["ca", "capath", "cert", "key", "cipher"]: value = _config("ssl-" + key, ssl.get(key)) if value: ssl[key] = value self.ssl = False if not ssl_disabled: if ssl_ca or ssl_cert or ssl_key or ssl_verify_cert or ssl_verify_identity: ssl = { "ca": ssl_ca, "check_hostname": bool(ssl_verify_identity), "verify_mode": ssl_verify_cert if ssl_verify_cert is not None else False, } if ssl_cert is not None: ssl["cert"] = ssl_cert if ssl_key is not None: ssl["key"] = ssl_key if ssl: if not SSL_ENABLED: raise NotImplementedError("ssl module not found") self.ssl = True client_flag |= CLIENT.SSL self.ctx = self._create_ssl_ctx(ssl) self.host = host or "localhost" self.port = port or 3306 if type(self.port) is not int: raise ValueError("port should be of type int") self.user = user or DEFAULT_USER self.password = password or b"" if isinstance(self.password, str): self.password = self.password.encode("latin1") self.db = database self.unix_socket = unix_socket self.bind_address = bind_address if not (0 < connect_timeout <= 31536000): raise ValueError("connect_timeout should be >0 and <=31536000") self.connect_timeout = connect_timeout or None if read_timeout is not None and read_timeout <= 0: raise ValueError("read_timeout should be > 0") self._read_timeout = read_timeout if write_timeout is not None and write_timeout <= 0: raise ValueError("write_timeout should be > 0") self._write_timeout = write_timeout self.charset = charset or DEFAULT_CHARSET self.collation = collation self.use_unicode = use_unicode self.encoding = charset_by_name(self.charset).encoding client_flag |= CLIENT.CAPABILITIES if self.db: client_flag |= CLIENT.CONNECT_WITH_DB self.client_flag = client_flag self.cursorclass = cursorclass self._result = None self._affected_rows = 0 self.host_info = "Not connected" # specified autocommit mode. None means use server default. self.autocommit_mode = autocommit if conv is None: conv = converters.conversions # Need for MySQLdb compatibility. self.encoders = {k: v for (k, v) in conv.items() if type(k) is not int} self.decoders = {k: v for (k, v) in conv.items() if type(k) is int} self.sql_mode = sql_mode self.init_command = init_command self.max_allowed_packet = max_allowed_packet self._auth_plugin_map = auth_plugin_map or {} self._binary_prefix = binary_prefix self.server_public_key = server_public_key self._connect_attrs = { "_client_name": "pymysql", "_client_version": VERSION_STRING, "_pid": str(os.getpid()), } if program_name: self._connect_attrs["program_name"] = program_name if defer_connect: self._sock = None else: > self.connect() /usr/lib/python3.12/site-packages/pymysql/connections.py:358: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError The above exception was the direct cause of the following exception: engine = Engine(mysql+pymysql://root@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) /usr/lib/python3.12/site-packages/pymysql/connections.py:358: in __init__ self.connect() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError ________ ERROR at setup of TestMySqlTrivialView.test_life_cycle_cascade ________ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: > sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) /usr/lib/python3.12/site-packages/pymysql/connections.py:644: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) sock.connect(sa) # Break explicitly a reference cycle exceptions.clear() return sock except error as exc: if not all_errors: exceptions.clear() # raise only the last error exceptions.append(exc) if sock is not None: sock.close() if len(exceptions): try: if not all_errors: > raise exceptions[0] /usr/lib64/python3.12/socket.py:852: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) > sock.connect(sa) E ConnectionRefusedError: [Errno 111] Connection refused /usr/lib64/python3.12/socket.py:837: ConnectionRefusedError During handling of the above exception, another exception occurred: self = Engine(mysql+pymysql://root@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'client_flag': 2, 'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'root'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __init__( self, *, user=None, # The first four arguments is based on DB-API 2.0 recommendation. password="", host=None, database=None, unix_socket=None, port=0, charset="", collation=None, sql_mode=None, read_default_file=None, conv=None, use_unicode=True, client_flag=0, cursorclass=Cursor, init_command=None, connect_timeout=10, read_default_group=None, autocommit=False, local_infile=False, max_allowed_packet=16 * 1024 * 1024, defer_connect=False, auth_plugin_map=None, read_timeout=None, write_timeout=None, bind_address=None, binary_prefix=False, program_name=None, server_public_key=None, ssl=None, ssl_ca=None, ssl_cert=None, ssl_disabled=None, ssl_key=None, ssl_verify_cert=None, ssl_verify_identity=None, compress=None, # not supported named_pipe=None, # not supported passwd=None, # deprecated db=None, # deprecated ): if db is not None and database is None: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn("'db' is deprecated, use 'database'", DeprecationWarning, 3) database = db if passwd is not None and not password: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn( # "'passwd' is deprecated, use 'password'", DeprecationWarning, 3 # ) password = passwd if compress or named_pipe: raise NotImplementedError( "compress and named_pipe arguments are not supported" ) self._local_infile = bool(local_infile) if self._local_infile: client_flag |= CLIENT.LOCAL_FILES if read_default_group and not read_default_file: if sys.platform.startswith("win"): read_default_file = "c:\\my.ini" else: read_default_file = "/etc/my.cnf" if read_default_file: if not read_default_group: read_default_group = "client" cfg = Parser() cfg.read(os.path.expanduser(read_default_file)) def _config(key, arg): if arg: return arg try: return cfg.get(read_default_group, key) except Exception: return arg user = _config("user", user) password = _config("password", password) host = _config("host", host) database = _config("database", database) unix_socket = _config("socket", unix_socket) port = int(_config("port", port)) bind_address = _config("bind-address", bind_address) charset = _config("default-character-set", charset) if not ssl: ssl = {} if isinstance(ssl, dict): for key in ["ca", "capath", "cert", "key", "cipher"]: value = _config("ssl-" + key, ssl.get(key)) if value: ssl[key] = value self.ssl = False if not ssl_disabled: if ssl_ca or ssl_cert or ssl_key or ssl_verify_cert or ssl_verify_identity: ssl = { "ca": ssl_ca, "check_hostname": bool(ssl_verify_identity), "verify_mode": ssl_verify_cert if ssl_verify_cert is not None else False, } if ssl_cert is not None: ssl["cert"] = ssl_cert if ssl_key is not None: ssl["key"] = ssl_key if ssl: if not SSL_ENABLED: raise NotImplementedError("ssl module not found") self.ssl = True client_flag |= CLIENT.SSL self.ctx = self._create_ssl_ctx(ssl) self.host = host or "localhost" self.port = port or 3306 if type(self.port) is not int: raise ValueError("port should be of type int") self.user = user or DEFAULT_USER self.password = password or b"" if isinstance(self.password, str): self.password = self.password.encode("latin1") self.db = database self.unix_socket = unix_socket self.bind_address = bind_address if not (0 < connect_timeout <= 31536000): raise ValueError("connect_timeout should be >0 and <=31536000") self.connect_timeout = connect_timeout or None if read_timeout is not None and read_timeout <= 0: raise ValueError("read_timeout should be > 0") self._read_timeout = read_timeout if write_timeout is not None and write_timeout <= 0: raise ValueError("write_timeout should be > 0") self._write_timeout = write_timeout self.charset = charset or DEFAULT_CHARSET self.collation = collation self.use_unicode = use_unicode self.encoding = charset_by_name(self.charset).encoding client_flag |= CLIENT.CAPABILITIES if self.db: client_flag |= CLIENT.CONNECT_WITH_DB self.client_flag = client_flag self.cursorclass = cursorclass self._result = None self._affected_rows = 0 self.host_info = "Not connected" # specified autocommit mode. None means use server default. self.autocommit_mode = autocommit if conv is None: conv = converters.conversions # Need for MySQLdb compatibility. self.encoders = {k: v for (k, v) in conv.items() if type(k) is not int} self.decoders = {k: v for (k, v) in conv.items() if type(k) is int} self.sql_mode = sql_mode self.init_command = init_command self.max_allowed_packet = max_allowed_packet self._auth_plugin_map = auth_plugin_map or {} self._binary_prefix = binary_prefix self.server_public_key = server_public_key self._connect_attrs = { "_client_name": "pymysql", "_client_version": VERSION_STRING, "_pid": str(os.getpid()), } if program_name: self._connect_attrs["program_name"] = program_name if defer_connect: self._sock = None else: > self.connect() /usr/lib/python3.12/site-packages/pymysql/connections.py:358: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError The above exception was the direct cause of the following exception: engine = Engine(mysql+pymysql://root@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) /usr/lib/python3.12/site-packages/pymysql/connections.py:358: in __init__ self.connect() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError _ ERROR at setup of TestLazyEvaluatedSelectExpressionsForAggregates.test_assigns_aggregates_on_insert _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestLazyEvaluatedSelectExpressionsForAggregates.test_assigns_aggregates_on_update _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestLazyEvaluatedSelectExpressionsForAggregates.test_assigns_aggregates_on_insert[simple] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestLazyEvaluatedSelectExpressionsForAggregates.test_assigns_aggregates_on_insert[child] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestLazyEvaluatedSelectExpressionsForAggregates.test_assigns_aggregates_on_update[simple] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestLazyEvaluatedSelectExpressionsForAggregates.test_assigns_aggregates_on_update[child] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestAggregatesWithManyToManyRelationships.test_assigns_aggregates_on_insert _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestAggregatesWithManyToManyRelationships.test_updates_aggregates_on_delete _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of TestAggregateManyToManyAndManyToMany.test_insert ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of TestAggregateOneToManyAndManyToMany.test_insert _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestAggregateOneToManyAndOneToMany.test_assigns_aggregates _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of Test3LevelDeepOneToMany.test_assigns_aggregates _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of Test3LevelDeepOneToMany.test_only_updates_affected_aggregates _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSearchVectorAggregates.test_assigns_aggregates_on_insert _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestAggregateValueGenerationWithCascadeDelete.test_something _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___________ ERROR at setup of TestJSONSQL.test_compiled_scalars[1-1] ___________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______ ERROR at setup of TestJSONSQL.test_compiled_scalars[14.14-14.14] _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONSQL.test_compiled_scalars[value2-result2] ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONSQL.test_compiled_scalars[value3-result3] ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONSQL.test_compiled_scalars[value4-result4] ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONSQL.test_compiled_scalars[value5-result5] ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONSQL.test_compiled_scalars[value6-result6] ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONSQL.test_compiled_scalars[value7-result7] ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __________ ERROR at setup of TestJSONBSQL.test_compiled_scalars[1-1] ___________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______ ERROR at setup of TestJSONBSQL.test_compiled_scalars[14.14-14.14] _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONBSQL.test_compiled_scalars[value2-result2] _____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONBSQL.test_compiled_scalars[value3-result3] _____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONBSQL.test_compiled_scalars[value4-result4] _____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONBSQL.test_compiled_scalars[value5-result5] _____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONBSQL.test_compiled_scalars[value6-result6] _____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestJSONBSQL.test_compiled_scalars[value7-result7] _____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __________ ERROR at setup of TestObservesForColumn.test_simple_insert __________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForColumnWithoutActualChanges.test_only_notifies_observer_on_actual_changes _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForMultipleColumns.test_only_notifies_observer_on_actual_changes _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForMultipleColumnsFiresOnlyOnce.test_only_notifies_observer_on_actual_changes _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForDynamicRelationship.test_add_observed_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForDynamicRelationship.test_add_observed_object_from_backref _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __ ERROR at setup of TestObservesForManyToManyToManyToMany.test_simple_insert __ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForManyToManyToManyToMany.test_add_leaf_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForManyToManyToManyToMany.test_remove_leaf_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForManyToManyToManyToMany.test_delete_intermediate_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForManyToManyToManyToMany.test_gathered_objects_are_distinct _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___ ERROR at setup of TestObservesFor3LevelDeepOneToMany.test_simple_insert ____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __ ERROR at setup of TestObservesFor3LevelDeepOneToMany.test_add_leaf_object ___ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesFor3LevelDeepOneToMany.test_remove_leaf_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesFor3LevelDeepOneToMany.test_delete_intermediate_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesFor3LevelDeepOneToMany.test_gathered_objects_are_distinct _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___ ERROR at setup of TestObservesForOneToManyToOneToMany.test_simple_insert ___ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __ ERROR at setup of TestObservesForOneToManyToOneToMany.test_add_leaf_object __ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForOneToManyToOneToMany.test_remove_leaf_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForOneToManyToOneToMany.test_delete_intermediate_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForOneToManyToOneToMany.test_gathered_objects_are_distinct _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForOneToManyToOneToMany.test_observable_root_obj_is_none _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ____ ERROR at setup of TestObservesForOneToOneToOneToOne.test_simple_insert ____ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForOneToOneToOneToOne.test_replace_leaf_object _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestObservesForOneToOneToOneToOne.test_delete_leaf_object __ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[categories-categories-subcategories-result0] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[articles-comments-comments-result1] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[users-groups-groups-result2] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[users-users-all_friends-result3] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[users-users-all_friends.all_friends-result4] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[users-users-groups.users-result5] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[groups-articles-users.authored_articles-result6] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[categories-categories-subcategories.subcategories-result7] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_returns_correct_results[categories-categories-subcategories.subcategories.subcategories-result8] _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_order_by_intermediate_table_column _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestSelectCorrelatedExpression.test_with_non_aggregate_function _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestCompositeTypeWithRegularTypes.test_parameter_processing _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___ ERROR at setup of TestCompositeTypeWithRegularTypes.test_non_ascii_chars ___ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____ ERROR at setup of TestCompositeTypeWithRegularTypes.test_dict_input ______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___ ERROR at setup of TestCompositeTypeWithRegularTypes.test_incomplete_dict ___ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ ERROR at setup of TestCompositeTypeWhenTypeAlreadyExistsInDatabase.test_parameter_processing _ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError __ ERROR at setup of TestCompositeTypeWithMixedCase.test_parameter_processing __ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______________ ERROR at setup of TestPostgresJSONType.test_list _______________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______ ERROR at setup of TestPostgresJSONType.test_parameter_processing _______ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _________ ERROR at setup of TestPostgresJSONType.test_non_ascii_chars __________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___________ ERROR at setup of TestPostgresJSONType.test_compilation ____________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _________ ERROR at setup of TestPostgresJSONType.test_unhashable_type __________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _________________ ERROR at setup of TestLTREE.test_saves_path __________________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ________________ ERROR at setup of TestLTREE.test_literal_param ________________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _________________ ERROR at setup of TestLTREE.test_compilation _________________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _____________ ERROR at setup of TestTSVector.test_type_reflection ______________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _________ ERROR at setup of TestTSVector.test_catalog_passed_to_match __________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ___________ ERROR at setup of TestTSVector.test_match_concatenation ____________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ____________ ERROR at setup of TestTSVector.test_match_with_catalog ____________ self = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: engine = Engine(postgresql://postgres:***@localhost/sqlalchemy_utils_test) @pytest.fixture def connection(engine): > return engine.connect() conftest.py:152: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=sqlalchemy_utils_test' connection_factory = None, cursor_factory = None kwargs = {'database': 'sqlalchemy_utils_test', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError =================================== FAILURES =================================== ____________________ TestDatabaseMySQL.test_create_and_drop ____________________ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: > sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) /usr/lib/python3.12/site-packages/pymysql/connections.py:644: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) sock.connect(sa) # Break explicitly a reference cycle exceptions.clear() return sock except error as exc: if not all_errors: exceptions.clear() # raise only the last error exceptions.append(exc) if sock is not None: sock.close() if len(exceptions): try: if not all_errors: > raise exceptions[0] /usr/lib64/python3.12/socket.py:852: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) > sock.connect(sa) E ConnectionRefusedError: [Errno 111] Connection refused /usr/lib64/python3.12/socket.py:837: ConnectionRefusedError During handling of the above exception, another exception occurred: self = Engine(mysql+pymysql://root@localhost) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = (), cparams = {'client_flag': 2, 'host': 'localhost', 'user': 'root'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __init__( self, *, user=None, # The first four arguments is based on DB-API 2.0 recommendation. password="", host=None, database=None, unix_socket=None, port=0, charset="", collation=None, sql_mode=None, read_default_file=None, conv=None, use_unicode=True, client_flag=0, cursorclass=Cursor, init_command=None, connect_timeout=10, read_default_group=None, autocommit=False, local_infile=False, max_allowed_packet=16 * 1024 * 1024, defer_connect=False, auth_plugin_map=None, read_timeout=None, write_timeout=None, bind_address=None, binary_prefix=False, program_name=None, server_public_key=None, ssl=None, ssl_ca=None, ssl_cert=None, ssl_disabled=None, ssl_key=None, ssl_verify_cert=None, ssl_verify_identity=None, compress=None, # not supported named_pipe=None, # not supported passwd=None, # deprecated db=None, # deprecated ): if db is not None and database is None: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn("'db' is deprecated, use 'database'", DeprecationWarning, 3) database = db if passwd is not None and not password: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn( # "'passwd' is deprecated, use 'password'", DeprecationWarning, 3 # ) password = passwd if compress or named_pipe: raise NotImplementedError( "compress and named_pipe arguments are not supported" ) self._local_infile = bool(local_infile) if self._local_infile: client_flag |= CLIENT.LOCAL_FILES if read_default_group and not read_default_file: if sys.platform.startswith("win"): read_default_file = "c:\\my.ini" else: read_default_file = "/etc/my.cnf" if read_default_file: if not read_default_group: read_default_group = "client" cfg = Parser() cfg.read(os.path.expanduser(read_default_file)) def _config(key, arg): if arg: return arg try: return cfg.get(read_default_group, key) except Exception: return arg user = _config("user", user) password = _config("password", password) host = _config("host", host) database = _config("database", database) unix_socket = _config("socket", unix_socket) port = int(_config("port", port)) bind_address = _config("bind-address", bind_address) charset = _config("default-character-set", charset) if not ssl: ssl = {} if isinstance(ssl, dict): for key in ["ca", "capath", "cert", "key", "cipher"]: value = _config("ssl-" + key, ssl.get(key)) if value: ssl[key] = value self.ssl = False if not ssl_disabled: if ssl_ca or ssl_cert or ssl_key or ssl_verify_cert or ssl_verify_identity: ssl = { "ca": ssl_ca, "check_hostname": bool(ssl_verify_identity), "verify_mode": ssl_verify_cert if ssl_verify_cert is not None else False, } if ssl_cert is not None: ssl["cert"] = ssl_cert if ssl_key is not None: ssl["key"] = ssl_key if ssl: if not SSL_ENABLED: raise NotImplementedError("ssl module not found") self.ssl = True client_flag |= CLIENT.SSL self.ctx = self._create_ssl_ctx(ssl) self.host = host or "localhost" self.port = port or 3306 if type(self.port) is not int: raise ValueError("port should be of type int") self.user = user or DEFAULT_USER self.password = password or b"" if isinstance(self.password, str): self.password = self.password.encode("latin1") self.db = database self.unix_socket = unix_socket self.bind_address = bind_address if not (0 < connect_timeout <= 31536000): raise ValueError("connect_timeout should be >0 and <=31536000") self.connect_timeout = connect_timeout or None if read_timeout is not None and read_timeout <= 0: raise ValueError("read_timeout should be > 0") self._read_timeout = read_timeout if write_timeout is not None and write_timeout <= 0: raise ValueError("write_timeout should be > 0") self._write_timeout = write_timeout self.charset = charset or DEFAULT_CHARSET self.collation = collation self.use_unicode = use_unicode self.encoding = charset_by_name(self.charset).encoding client_flag |= CLIENT.CAPABILITIES if self.db: client_flag |= CLIENT.CONNECT_WITH_DB self.client_flag = client_flag self.cursorclass = cursorclass self._result = None self._affected_rows = 0 self.host_info = "Not connected" # specified autocommit mode. None means use server default. self.autocommit_mode = autocommit if conv is None: conv = converters.conversions # Need for MySQLdb compatibility. self.encoders = {k: v for (k, v) in conv.items() if type(k) is not int} self.decoders = {k: v for (k, v) in conv.items() if type(k) is int} self.sql_mode = sql_mode self.init_command = init_command self.max_allowed_packet = max_allowed_packet self._auth_plugin_map = auth_plugin_map or {} self._binary_prefix = binary_prefix self.server_public_key = server_public_key self._connect_attrs = { "_client_name": "pymysql", "_client_version": VERSION_STRING, "_pid": str(os.getpid()), } if program_name: self._connect_attrs["program_name"] = program_name if defer_connect: self._sock = None else: > self.connect() /usr/lib/python3.12/site-packages/pymysql/connections.py:358: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError The above exception was the direct cause of the following exception: self = dsn = 'mysql+pymysql://root@localhost/db_test_sqlalchemy_util' def test_create_and_drop(self, dsn): > assert not database_exists(dsn) tests/functions/test_database.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:498: in database_exists return bool(_get_scalar_result(engine, sa.text(text))) sqlalchemy_utils/functions/database.py:442: in _get_scalar_result with engine.connect() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) /usr/lib/python3.12/site-packages/pymysql/connections.py:358: in __init__ self.connect() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError _____________ TestDatabaseMySQLWithQuotedName.test_create_and_drop _____________ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: > sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) /usr/lib/python3.12/site-packages/pymysql/connections.py:644: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) sock.connect(sa) # Break explicitly a reference cycle exceptions.clear() return sock except error as exc: if not all_errors: exceptions.clear() # raise only the last error exceptions.append(exc) if sock is not None: sock.close() if len(exceptions): try: if not all_errors: > raise exceptions[0] /usr/lib64/python3.12/socket.py:852: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 3306), timeout = 10, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) > sock.connect(sa) E ConnectionRefusedError: [Errno 111] Connection refused /usr/lib64/python3.12/socket.py:837: ConnectionRefusedError During handling of the above exception, another exception occurred: self = Engine(mysql+pymysql://root@localhost) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = (), cparams = {'client_flag': 2, 'host': 'localhost', 'user': 'root'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __init__( self, *, user=None, # The first four arguments is based on DB-API 2.0 recommendation. password="", host=None, database=None, unix_socket=None, port=0, charset="", collation=None, sql_mode=None, read_default_file=None, conv=None, use_unicode=True, client_flag=0, cursorclass=Cursor, init_command=None, connect_timeout=10, read_default_group=None, autocommit=False, local_infile=False, max_allowed_packet=16 * 1024 * 1024, defer_connect=False, auth_plugin_map=None, read_timeout=None, write_timeout=None, bind_address=None, binary_prefix=False, program_name=None, server_public_key=None, ssl=None, ssl_ca=None, ssl_cert=None, ssl_disabled=None, ssl_key=None, ssl_verify_cert=None, ssl_verify_identity=None, compress=None, # not supported named_pipe=None, # not supported passwd=None, # deprecated db=None, # deprecated ): if db is not None and database is None: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn("'db' is deprecated, use 'database'", DeprecationWarning, 3) database = db if passwd is not None and not password: # We will raise warning in 2022 or later. # See https://github.com/PyMySQL/PyMySQL/issues/939 # warnings.warn( # "'passwd' is deprecated, use 'password'", DeprecationWarning, 3 # ) password = passwd if compress or named_pipe: raise NotImplementedError( "compress and named_pipe arguments are not supported" ) self._local_infile = bool(local_infile) if self._local_infile: client_flag |= CLIENT.LOCAL_FILES if read_default_group and not read_default_file: if sys.platform.startswith("win"): read_default_file = "c:\\my.ini" else: read_default_file = "/etc/my.cnf" if read_default_file: if not read_default_group: read_default_group = "client" cfg = Parser() cfg.read(os.path.expanduser(read_default_file)) def _config(key, arg): if arg: return arg try: return cfg.get(read_default_group, key) except Exception: return arg user = _config("user", user) password = _config("password", password) host = _config("host", host) database = _config("database", database) unix_socket = _config("socket", unix_socket) port = int(_config("port", port)) bind_address = _config("bind-address", bind_address) charset = _config("default-character-set", charset) if not ssl: ssl = {} if isinstance(ssl, dict): for key in ["ca", "capath", "cert", "key", "cipher"]: value = _config("ssl-" + key, ssl.get(key)) if value: ssl[key] = value self.ssl = False if not ssl_disabled: if ssl_ca or ssl_cert or ssl_key or ssl_verify_cert or ssl_verify_identity: ssl = { "ca": ssl_ca, "check_hostname": bool(ssl_verify_identity), "verify_mode": ssl_verify_cert if ssl_verify_cert is not None else False, } if ssl_cert is not None: ssl["cert"] = ssl_cert if ssl_key is not None: ssl["key"] = ssl_key if ssl: if not SSL_ENABLED: raise NotImplementedError("ssl module not found") self.ssl = True client_flag |= CLIENT.SSL self.ctx = self._create_ssl_ctx(ssl) self.host = host or "localhost" self.port = port or 3306 if type(self.port) is not int: raise ValueError("port should be of type int") self.user = user or DEFAULT_USER self.password = password or b"" if isinstance(self.password, str): self.password = self.password.encode("latin1") self.db = database self.unix_socket = unix_socket self.bind_address = bind_address if not (0 < connect_timeout <= 31536000): raise ValueError("connect_timeout should be >0 and <=31536000") self.connect_timeout = connect_timeout or None if read_timeout is not None and read_timeout <= 0: raise ValueError("read_timeout should be > 0") self._read_timeout = read_timeout if write_timeout is not None and write_timeout <= 0: raise ValueError("write_timeout should be > 0") self._write_timeout = write_timeout self.charset = charset or DEFAULT_CHARSET self.collation = collation self.use_unicode = use_unicode self.encoding = charset_by_name(self.charset).encoding client_flag |= CLIENT.CAPABILITIES if self.db: client_flag |= CLIENT.CONNECT_WITH_DB self.client_flag = client_flag self.cursorclass = cursorclass self._result = None self._affected_rows = 0 self.host_info = "Not connected" # specified autocommit mode. None means use server default. self.autocommit_mode = autocommit if conv is None: conv = converters.conversions # Need for MySQLdb compatibility. self.encoders = {k: v for (k, v) in conv.items() if type(k) is not int} self.decoders = {k: v for (k, v) in conv.items() if type(k) is int} self.sql_mode = sql_mode self.init_command = init_command self.max_allowed_packet = max_allowed_packet self._auth_plugin_map = auth_plugin_map or {} self._binary_prefix = binary_prefix self.server_public_key = server_public_key self._connect_attrs = { "_client_name": "pymysql", "_client_version": VERSION_STRING, "_pid": str(os.getpid()), } if program_name: self._connect_attrs["program_name"] = program_name if defer_connect: self._sock = None else: > self.connect() /usr/lib/python3.12/site-packages/pymysql/connections.py:358: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError The above exception was the direct cause of the following exception: self = dsn = 'mysql+pymysql://root@localhost/db_test_sqlalchemy-util' def test_create_and_drop(self, dsn): > assert not database_exists(dsn) tests/functions/test_database.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:498: in database_exists return bool(_get_scalar_result(engine, sa.text(text))) sqlalchemy_utils/functions/database.py:442: in _get_scalar_result with engine.connect() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) /usr/lib/python3.12/site-packages/pymysql/connections.py:358: in __init__ self.connect() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , sock = None def connect(self, sock=None): self._closed = False try: if sock is None: if self.unix_socket: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.settimeout(self.connect_timeout) sock.connect(self.unix_socket) self.host_info = "Localhost via UNIX socket" self._secure = True if DEBUG: print("connected using unix_socket") else: kwargs = {} if self.bind_address is not None: kwargs["source_address"] = (self.bind_address, 0) while True: try: sock = socket.create_connection( (self.host, self.port), self.connect_timeout, **kwargs ) break except OSError as e: if e.errno == errno.EINTR: continue raise self.host_info = "socket %s:%d" % (self.host, self.port) if DEBUG: print("connected using socket") sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) sock.settimeout(None) self._sock = sock self._rfile = sock.makefile("rb") self._next_seq_id = 0 self._get_server_information() self._request_authentication() # Send "SET NAMES" query on init for: # - Ensure charaset (and collation) is set to the server. # - collation_id in handshake packet may be ignored. # - If collation is not specified, we don't know what is server's # default collation for the charset. For example, default collation # of utf8mb4 is: # - MySQL 5.7, MariaDB 10.x: utf8mb4_general_ci # - MySQL 8.0: utf8mb4_0900_ai_ci # # Reference: # - https://github.com/PyMySQL/PyMySQL/issues/1092 # - https://github.com/wagtail/wagtail/issues/9477 # - https://zenn.dev/methane/articles/2023-mysql-collation (Japanese) self.set_character_set(self.charset, self.collation) if self.sql_mode is not None: c = self.cursor() c.execute("SET sql_mode=%s", (self.sql_mode,)) c.close() if self.init_command is not None: c = self.cursor() c.execute(self.init_command) c.close() if self.autocommit_mode is not None: self.autocommit(self.autocommit_mode) except BaseException as e: self._rfile = None if sock is not None: try: sock.close() except: # noqa pass if isinstance(e, (OSError, IOError)): exc = err.OperationalError( CR.CR_CONN_HOST_ERROR, f"Can't connect to MySQL server on {self.host!r} ({e})", ) # Keep original exception and traceback to investigate error. exc.original_exception = e exc.traceback = traceback.format_exc() if DEBUG: print(exc.traceback) > raise exc E sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib/python3.12/site-packages/pymysql/connections.py:711: OperationalError __________________ TestDatabasePostgres.test_create_and_drop ___________________ self = Engine(postgresql://postgres:***@localhost/postgres) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: self = dsn = 'postgresql://postgres:@localhost/db_test_sqlalchemy_util' def test_create_and_drop(self, dsn): assert not database_exists(dsn) > create_database(dsn) tests/functions/test_database.py:19: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:568: in create_database with engine.begin() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3153: in begin conn = self.connect(close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError ______________________ TestDatabasePostgres.test_template ______________________ self = Engine(postgresql://postgres:***@localhost/postgres) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: self = postgresql_db_user = 'postgres', postgresql_db_password = '' def test_template(self, postgresql_db_user, postgresql_db_password): dsn = 'postgresql://{}:{}@localhost/db_test_sqlalchemy_util'.format( postgresql_db_user, postgresql_db_password ) with pytest.raises(sa.exc.ProgrammingError) as excinfo: > create_database(dsn, template='my_template') tests/functions/test_database.py:77: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:568: in create_database with engine.begin() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3153: in begin conn = self.connect(close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______________ TestDatabasePostgresPg8000.test_create_and_drop ________________ self = , user = 'postgres' host = 'localhost', database = 'db_to_test_create_and_drop_via_pg8000_driver' port = 5432, password = None, source_address = None, unix_sock = None ssl_context = None, timeout = None, tcp_keepalive = True application_name = None, replication = None def __init__( self, user, host="localhost", database=None, port=5432, password=None, source_address=None, unix_sock=None, ssl_context=None, timeout=None, tcp_keepalive=True, application_name=None, replication=None, ): self._client_encoding = "utf8" self._commands_with_count = ( b"INSERT", b"DELETE", b"UPDATE", b"MOVE", b"FETCH", b"COPY", b"SELECT", ) self.notifications = deque(maxlen=100) self.notices = deque(maxlen=100) self.parameter_statuses = deque(maxlen=100) if user is None: raise InterfaceError("The 'user' connection parameter cannot be None") init_params = { "user": user, "database": database, "application_name": application_name, "replication": replication, } for k, v in tuple(init_params.items()): if isinstance(v, str): init_params[k] = v.encode("utf8") elif v is None: del init_params[k] elif not isinstance(v, (bytes, bytearray)): raise InterfaceError(f"The parameter {k} can't be of type {type(v)}.") self.user = init_params["user"] if isinstance(password, str): self.password = password.encode("utf8") else: self.password = password self.autocommit = False self._xid = None self._statement_nums = set() self._caches = {} if unix_sock is None and host is not None: try: > self._usock = socket.create_connection( (host, port), timeout, source_address ) /usr/lib/python3.12/site-packages/pg8000/core.py:208: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 5432), timeout = None, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) sock.connect(sa) # Break explicitly a reference cycle exceptions.clear() return sock except error as exc: if not all_errors: exceptions.clear() # raise only the last error exceptions.append(exc) if sock is not None: sock.close() if len(exceptions): try: if not all_errors: > raise exceptions[0] /usr/lib64/python3.12/socket.py:852: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ address = ('localhost', 5432), timeout = None, source_address = None def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, all_errors=False): """Connect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. When a connection cannot be created, raises the last error if *all_errors* is False, and an ExceptionGroup of all errors if *all_errors* is True. """ host, port = address exceptions = [] for res in getaddrinfo(host, port, 0, SOCK_STREAM): af, socktype, proto, canonname, sa = res sock = None try: sock = socket(af, socktype, proto) if timeout is not _GLOBAL_DEFAULT_TIMEOUT: sock.settimeout(timeout) if source_address: sock.bind(source_address) > sock.connect(sa) E ConnectionRefusedError: [Errno 111] Connection refused /usr/lib64/python3.12/socket.py:837: ConnectionRefusedError The above exception was the direct cause of the following exception: self = Engine(postgresql+pg8000://postgres:***@localhost/db_to_test_create_and_drop_via_pg8000_driver) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'db_to_test_create_and_drop_via_pg8000_driver', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ user = 'postgres', host = 'localhost' database = 'db_to_test_create_and_drop_via_pg8000_driver', port = 5432 password = None, source_address = None, unix_sock = None, ssl_context = None timeout = None, tcp_keepalive = True, application_name = None replication = None def connect( user, host="localhost", database=None, port=5432, password=None, source_address=None, unix_sock=None, ssl_context=None, timeout=None, tcp_keepalive=True, application_name=None, replication=None, ): > return Connection( user, host=host, database=database, port=port, password=password, source_address=source_address, unix_sock=unix_sock, ssl_context=ssl_context, timeout=timeout, tcp_keepalive=tcp_keepalive, application_name=application_name, replication=replication, ) /usr/lib/python3.12/site-packages/pg8000/__init__.py:117: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , args = ('postgres',) kwargs = {'application_name': None, 'database': 'db_to_test_create_and_drop_via_pg8000_driver', 'host': 'localhost', 'password': None, ...} def __init__(self, *args, **kwargs): try: > super().__init__(*args, **kwargs) /usr/lib/python3.12/site-packages/pg8000/legacy.py:442: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , user = 'postgres' host = 'localhost', database = 'db_to_test_create_and_drop_via_pg8000_driver' port = 5432, password = None, source_address = None, unix_sock = None ssl_context = None, timeout = None, tcp_keepalive = True application_name = None, replication = None def __init__( self, user, host="localhost", database=None, port=5432, password=None, source_address=None, unix_sock=None, ssl_context=None, timeout=None, tcp_keepalive=True, application_name=None, replication=None, ): self._client_encoding = "utf8" self._commands_with_count = ( b"INSERT", b"DELETE", b"UPDATE", b"MOVE", b"FETCH", b"COPY", b"SELECT", ) self.notifications = deque(maxlen=100) self.notices = deque(maxlen=100) self.parameter_statuses = deque(maxlen=100) if user is None: raise InterfaceError("The 'user' connection parameter cannot be None") init_params = { "user": user, "database": database, "application_name": application_name, "replication": replication, } for k, v in tuple(init_params.items()): if isinstance(v, str): init_params[k] = v.encode("utf8") elif v is None: del init_params[k] elif not isinstance(v, (bytes, bytearray)): raise InterfaceError(f"The parameter {k} can't be of type {type(v)}.") self.user = init_params["user"] if isinstance(password, str): self.password = password.encode("utf8") else: self.password = password self.autocommit = False self._xid = None self._statement_nums = set() self._caches = {} if unix_sock is None and host is not None: try: self._usock = socket.create_connection( (host, port), timeout, source_address ) except socket.error as e: > raise InterfaceError( f"Can't create a connection to host {host} and port {port} " f"(timeout is {timeout} and source_address is {source_address})." ) from e E pg8000.exceptions.InterfaceError: Can't create a connection to host localhost and port 5432 (timeout is None and source_address is None). /usr/lib/python3.12/site-packages/pg8000/core.py:212: InterfaceError The above exception was the direct cause of the following exception: self = dsn = 'postgresql+pg8000://postgres:@localhost/db_to_test_create_and_drop_via_pg8000_driver' def test_create_and_drop(self, dsn): > assert not database_exists(dsn) tests/functions/test_database.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:488: in database_exists return bool(_get_scalar_result(engine, sa.text(text))) sqlalchemy_utils/functions/database.py:442: in _get_scalar_result with engine.connect() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) /usr/lib/python3.12/site-packages/pg8000/__init__.py:117: in connect return Connection( /usr/lib/python3.12/site-packages/pg8000/legacy.py:442: in __init__ super().__init__(*args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , user = 'postgres' host = 'localhost', database = 'db_to_test_create_and_drop_via_pg8000_driver' port = 5432, password = None, source_address = None, unix_sock = None ssl_context = None, timeout = None, tcp_keepalive = True application_name = None, replication = None def __init__( self, user, host="localhost", database=None, port=5432, password=None, source_address=None, unix_sock=None, ssl_context=None, timeout=None, tcp_keepalive=True, application_name=None, replication=None, ): self._client_encoding = "utf8" self._commands_with_count = ( b"INSERT", b"DELETE", b"UPDATE", b"MOVE", b"FETCH", b"COPY", b"SELECT", ) self.notifications = deque(maxlen=100) self.notices = deque(maxlen=100) self.parameter_statuses = deque(maxlen=100) if user is None: raise InterfaceError("The 'user' connection parameter cannot be None") init_params = { "user": user, "database": database, "application_name": application_name, "replication": replication, } for k, v in tuple(init_params.items()): if isinstance(v, str): init_params[k] = v.encode("utf8") elif v is None: del init_params[k] elif not isinstance(v, (bytes, bytearray)): raise InterfaceError(f"The parameter {k} can't be of type {type(v)}.") self.user = init_params["user"] if isinstance(password, str): self.password = password.encode("utf8") else: self.password = password self.autocommit = False self._xid = None self._statement_nums = set() self._caches = {} if unix_sock is None and host is not None: try: self._usock = socket.create_connection( (host, port), timeout, source_address ) except socket.error as e: > raise InterfaceError( f"Can't create a connection to host {host} and port {port} " f"(timeout is {timeout} and source_address is {source_address})." ) from e E sqlalchemy.exc.InterfaceError: (pg8000.exceptions.InterfaceError) Can't create a connection to host localhost and port 5432 (timeout is None and source_address is None). E (Background on this error at: https://sqlalche.me/e/14/rvf5) /usr/lib/python3.12/site-packages/pg8000/core.py:212: InterfaceError ___________ TestDatabasePostgresWithQuotedName.test_create_and_drop ____________ self = Engine(postgresql://postgres:***@localhost/postgres) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: self = dsn = 'postgresql://postgres:@localhost/db_test_sqlalchemy-util' def test_create_and_drop(self, dsn): assert not database_exists(dsn) > create_database(dsn) tests/functions/test_database.py:19: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:568: in create_database with engine.begin() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3153: in begin conn = self.connect(close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _______________ TestDatabasePostgresWithQuotedName.test_template _______________ self = Engine(postgresql://postgres:***@localhost/postgres) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: self = postgresql_db_user = 'postgres', postgresql_db_password = '' def test_template(self, postgresql_db_user, postgresql_db_password): dsn = 'postgresql://{}:{}@localhost/db_test_sqlalchemy-util'.format( postgresql_db_user, postgresql_db_password ) with pytest.raises(sa.exc.ProgrammingError) as excinfo: > create_database(dsn, template='my-template') tests/functions/test_database.py:130: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:568: in create_database with engine.begin() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3153: in begin conn = self.connect(close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError _ TestDatabasePostgresCreateDatabaseCloseConnection.test_create_database_twice _ self = Engine(postgresql://postgres:***@localhost/postgres) fn = > connection = None def _wrap_pool_connect(self, fn, connection): dialect = self.dialect try: > return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def connect(self): """Return a DBAPI connection from the pool. The connection is instrumented such that when its ``close()`` method is called, the connection will be returned to the pool. """ > return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = threadconns = None, fairy = None @classmethod def _checkout(cls, pool, threadconns=None, fairy=None): if not fairy: > fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = pool = @classmethod def checkout(cls, pool): > rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: return self._create_connection() except: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _do_get(self): use_overflow = self._max_overflow > -1 try: wait = use_overflow and self._overflow >= self._max_overflow return self._pool.get(wait, self._timeout) except sqla_queue.Empty: # don't do things inside of "except Empty", because when we say # we timed out or can't connect and raise, Python 3 tells # people the real error is queue.Empty which it isn't. pass if use_overflow and self._overflow >= self._max_overflow: if not wait: return self._do_get() else: raise exc.TimeoutError( "QueuePool limit of size %d overflow %d reached, " "connection timed out, timeout %0.2f" % (self.size(), self.overflow(), self._timeout), code="3o7r", ) if self._inc_overflow(): try: > return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _create_connection(self): """Called by subclasses to create a new ConnectionRecord.""" > return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = pool = , connect = True def __init__(self, pool, connect=True): self.__pool = pool if connect: > self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() self.dbapi_connection = connection = pool._invoke_creator(self) pool.logger.debug("Created new connection %r", connection) self.fresh = True except BaseException as e: > with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = type_ = None, value = None, traceback = None def __exit__(self, type_, value, traceback): # see #2703 for notes if type_ is None: exc_type, exc_value, exc_tb = self._exc_info self._exc_info = None # remove potential circular references if not self.warn_only: > compat.raise_( exc_value, with_traceback=exc_tb, ) /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def raise_( exception, with_traceback=None, replace_context=None, from_=False ): r"""implement "raise" with cause support. :param exception: exception to raise :param with_traceback: will call exception.with_traceback() :param replace_context: an as-yet-unsupported feature. This is an exception object which we are "replacing", e.g., it's our "cause" but we don't want it printed. Basically just what ``__suppress_context__`` does but we don't want to suppress the enclosing context, if any. So for now we make it the cause. :param from\_: the cause. this actually sets the cause and doesn't hope to hide it someday. """ if with_traceback is not None: exception = exception.with_traceback(with_traceback) if from_ is not False: exception.__cause__ = from_ elif replace_context is not None: # no good solution here, we would like to have the exception # have only the context of replace_context.__context__ so that the # intermediary exception does not change, but we can't figure # that out. exception.__cause__ = replace_context try: > raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def __connect(self): pool = self.__pool # ensure any existing connection is removed, so that if # creator fails, this attribute stays None self.dbapi_connection = None try: self.starttime = time.time() > self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ connection_record = def connect(connection_record=None): if dialect._has_events: for fn in dialect.dispatch.do_connect: connection = fn(dialect, connection_record, cargs, cparams) if connection is not None: return connection > return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = cargs = () cparams = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} def connect(self, *cargs, **cparams): # inherits the docstring from interfaces.Dialect.connect > return self.dbapi.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E psycopg2.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError The above exception was the direct cause of the following exception: self = postgresql_db_user = 'postgres', postgresql_db_password = '' def test_create_database_twice( self, postgresql_db_user, postgresql_db_password ): dsn_list = [ 'postgresql://{}:{}@localhost/db_test_sqlalchemy-util-a'.format( postgresql_db_user, postgresql_db_password ), 'postgresql://{}:{}@localhost/db_test_sqlalchemy-util-b'.format( postgresql_db_user, postgresql_db_password ), ] for dsn_item in dsn_list: assert not database_exists(dsn_item) > create_database(dsn_item, template="template1") tests/functions/test_database.py:153: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ sqlalchemy_utils/functions/database.py:568: in create_database with engine.begin() as conn: /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3153: in begin conn = self.connect(close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3325: in connect return self._connection_cls(self, close_with_result=close_with_result) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:96: in __init__ else engine.raw_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3404: in raw_connection return self._wrap_pool_connect(self.pool.connect, _connection) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3374: in _wrap_pool_connect Connection._handle_dbapi_exception_noconnection( /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:2208: in _handle_dbapi_exception_noconnection util.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/engine/base.py:3371: in _wrap_pool_connect return fn() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:327: in connect return _ConnectionFairy._checkout(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:894: in _checkout fairy = _ConnectionRecord.checkout(pool) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:493: in checkout rec = pool._do_get() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:145: in _do_get with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/impl.py:143: in _do_get return self._create_connection() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:273: in _create_connection return _ConnectionRecord(self) /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:388: in __init__ self.__connect() /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:690: in __connect with util.safe_reraise(): /usr/lib64/python3.12/site-packages/sqlalchemy/util/langhelpers.py:70: in __exit__ compat.raise_( /usr/lib64/python3.12/site-packages/sqlalchemy/util/compat.py:211: in raise_ raise exception /usr/lib64/python3.12/site-packages/sqlalchemy/pool/base.py:686: in __connect self.dbapi_connection = connection = pool._invoke_creator(self) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/create.py:574: in connect return dialect.connect(*cargs, **cparams) /usr/lib64/python3.12/site-packages/sqlalchemy/engine/default.py:598: in connect return self.dbapi.connect(*cargs, **cparams) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ dsn = 'host=localhost user=postgres dbname=postgres', connection_factory = None cursor_factory = None kwargs = {'database': 'postgres', 'host': 'localhost', 'user': 'postgres'} kwasync = {} def connect(dsn=None, connection_factory=None, cursor_factory=None, **kwargs): """ Create a new database connection. The connection parameters can be specified as a string: conn = psycopg2.connect("dbname=test user=postgres password=secret") or using a set of keyword arguments: conn = psycopg2.connect(database="test", user="postgres", password="secret") Or as a mix of both. The basic connection parameters are: - *dbname*: the database name - *database*: the database name (only as keyword argument) - *user*: user name used to authenticate - *password*: password used to authenticate - *host*: database host address (defaults to UNIX socket if not provided) - *port*: connection port number (defaults to 5432 if not provided) Using the *connection_factory* parameter a different class or connections factory can be specified. It should be a callable object taking a dsn argument. Using the *cursor_factory* parameter, a new default cursor factory will be used by cursor(). Using *async*=True an asynchronous connection will be created. *async_* is a valid alias (for Python versions where ``async`` is a keyword). Any other keyword parameter will be passed to the underlying client library: the list of supported parameters depends on the library version. """ kwasync = {} if 'async' in kwargs: kwasync['async'] = kwargs.pop('async') if 'async_' in kwargs: kwasync['async_'] = kwargs.pop('async_') dsn = _ext.make_dsn(dsn, **kwargs) > conn = _connect(dsn, connection_factory=connection_factory, **kwasync) E sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused E Is the server running on that host and accepting TCP/IP connections? E E (Background on this error at: https://sqlalche.me/e/14/e3q8) /usr/lib64/python3.12/site-packages/psycopg2/__init__.py:122: OperationalError =============================== warnings summary =============================== ../../../../usr/lib/python3.12/site-packages/pytz/tzinfo.py:27 /usr/lib/python3.12/site-packages/pytz/tzinfo.py:27: DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC). _epoch = datetime.utcfromtimestamp(0) tests/test_models.py::TestTimestamp::test_created /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/tests/test_models.py:20: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). then = datetime.utcnow() tests/test_models.py::TestTimestamp::test_created tests/test_models.py::TestTimestamp::test_created tests/test_models.py::TestTimestamp::test_updated tests/test_models.py::TestTimestamp::test_updated /usr/lib64/python3.12/site-packages/sqlalchemy/sql/schema.py:2783: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). return util.wrap_callable(lambda ctx: fn(), fn) tests/test_models.py::TestTimestamp::test_created /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/tests/test_models.py:26: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). assert article.created >= then and article.created <= datetime.utcnow() tests/test_models.py::TestTimestamp::test_updated /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/tests/test_models.py:34: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). then = datetime.utcnow() tests/test_models.py::TestTimestamp::test_updated /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/sqlalchemy_utils/models.py:33: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). target.updated = datetime.utcnow() tests/test_models.py::TestTimestamp::test_updated /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/tests/test_models.py:39: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). assert article.updated >= then and article.updated <= datetime.utcnow() -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED tests/functions/test_database.py::TestDatabaseMySQL::test_create_and_drop FAILED tests/functions/test_database.py::TestDatabaseMySQLWithQuotedName::test_create_and_drop FAILED tests/functions/test_database.py::TestDatabasePostgres::test_create_and_drop FAILED tests/functions/test_database.py::TestDatabasePostgres::test_template FAILED tests/functions/test_database.py::TestDatabasePostgresPg8000::test_create_and_drop FAILED tests/functions/test_database.py::TestDatabasePostgresWithQuotedName::test_create_and_drop FAILED tests/functions/test_database.py::TestDatabasePostgresWithQuotedName::test_template FAILED tests/functions/test_database.py::TestDatabasePostgresCreateDatabaseCloseConnection::test_create_database_twice ERROR tests/test_asserts.py::TestAssertMaxLengthWithArray::test_with_max_length ERROR tests/test_asserts.py::TestAssertMaxLengthWithArray::test_smaller_than_max_length ERROR tests/test_asserts.py::TestAssertMaxLengthWithArray::test_bigger_than_max_length ERROR tests/test_asserts.py::TestAssertNonNullable::test_non_nullable_column ERROR tests/test_asserts.py::TestAssertNonNullable::test_nullable_column - sq... ERROR tests/test_asserts.py::TestAssertNullable::test_nullable_column - sqlal... ERROR tests/test_asserts.py::TestAssertNullable::test_non_nullable_column - s... ERROR tests/test_asserts.py::TestAssertMaxLength::test_with_max_length - sqla... ERROR tests/test_asserts.py::TestAssertMaxLength::test_with_non_nullable_column ERROR tests/test_asserts.py::TestAssertMaxLength::test_smaller_than_max_length ERROR tests/test_asserts.py::TestAssertMaxLength::test_bigger_than_max_length ERROR tests/test_asserts.py::TestAssertMinValue::test_with_min_value - sqlalc... ERROR tests/test_asserts.py::TestAssertMinValue::test_smaller_than_min_value ERROR tests/test_asserts.py::TestAssertMinValue::test_bigger_than_min_value ERROR tests/test_asserts.py::TestAssertMaxValue::test_with_min_value - sqlalc... ERROR tests/test_asserts.py::TestAssertMaxValue::test_smaller_than_max_value ERROR tests/test_asserts.py::TestAssertMaxValue::test_bigger_than_max_value ERROR tests/test_views.py::TestMaterializedViews::test_refresh_materialized_view ERROR tests/test_views.py::TestMaterializedViews::test_querying_view - sqlalc... ERROR tests/test_views.py::TestPostgresTrivialView::test_life_cycle_no_cascade ERROR tests/test_views.py::TestPostgresTrivialView::test_life_cycle_cascade ERROR tests/test_views.py::TestMySqlTrivialView::test_life_cycle_no_cascade ERROR tests/test_views.py::TestMySqlTrivialView::test_life_cycle_cascade - sq... ERROR tests/aggregate/test_custom_select_expressions.py::TestLazyEvaluatedSelectExpressionsForAggregates::test_assigns_aggregates_on_insert ERROR tests/aggregate/test_custom_select_expressions.py::TestLazyEvaluatedSelectExpressionsForAggregates::test_assigns_aggregates_on_update ERROR tests/aggregate/test_join_table_inheritance.py::TestLazyEvaluatedSelectExpressionsForAggregates::test_assigns_aggregates_on_insert[simple] ERROR tests/aggregate/test_join_table_inheritance.py::TestLazyEvaluatedSelectExpressionsForAggregates::test_assigns_aggregates_on_insert[child] ERROR tests/aggregate/test_join_table_inheritance.py::TestLazyEvaluatedSelectExpressionsForAggregates::test_assigns_aggregates_on_update[simple] ERROR tests/aggregate/test_join_table_inheritance.py::TestLazyEvaluatedSelectExpressionsForAggregates::test_assigns_aggregates_on_update[child] ERROR tests/aggregate/test_m2m.py::TestAggregatesWithManyToManyRelationships::test_assigns_aggregates_on_insert ERROR tests/aggregate/test_m2m.py::TestAggregatesWithManyToManyRelationships::test_updates_aggregates_on_delete ERROR tests/aggregate/test_m2m_m2m.py::TestAggregateManyToManyAndManyToMany::test_insert ERROR tests/aggregate/test_o2m_m2m.py::TestAggregateOneToManyAndManyToMany::test_insert ERROR tests/aggregate/test_o2m_o2m.py::TestAggregateOneToManyAndOneToMany::test_assigns_aggregates ERROR tests/aggregate/test_o2m_o2m_o2m.py::Test3LevelDeepOneToMany::test_assigns_aggregates ERROR tests/aggregate/test_o2m_o2m_o2m.py::Test3LevelDeepOneToMany::test_only_updates_affected_aggregates ERROR tests/aggregate/test_search_vectors.py::TestSearchVectorAggregates::test_assigns_aggregates_on_insert ERROR tests/aggregate/test_with_ondelete_cascade.py::TestAggregateValueGenerationWithCascadeDelete::test_something ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[1-1] ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[14.14-14.14] ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[value2-result2] ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[value3-result3] ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[value4-result4] ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[value5-result5] ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[value6-result6] ERROR tests/functions/test_json_sql.py::TestJSONSQL::test_compiled_scalars[value7-result7] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[1-1] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[14.14-14.14] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[value2-result2] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[value3-result3] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[value4-result4] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[value5-result5] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[value6-result6] ERROR tests/functions/test_jsonb_sql.py::TestJSONBSQL::test_compiled_scalars[value7-result7] ERROR tests/observes/test_column_property.py::TestObservesForColumn::test_simple_insert ERROR tests/observes/test_column_property.py::TestObservesForColumnWithoutActualChanges::test_only_notifies_observer_on_actual_changes ERROR tests/observes/test_column_property.py::TestObservesForMultipleColumns::test_only_notifies_observer_on_actual_changes ERROR tests/observes/test_column_property.py::TestObservesForMultipleColumnsFiresOnlyOnce::test_only_notifies_observer_on_actual_changes ERROR tests/observes/test_dynamic_relationship.py::TestObservesForDynamicRelationship::test_add_observed_object ERROR tests/observes/test_dynamic_relationship.py::TestObservesForDynamicRelationship::test_add_observed_object_from_backref ERROR tests/observes/test_m2m_m2m_m2m.py::TestObservesForManyToManyToManyToMany::test_simple_insert ERROR tests/observes/test_m2m_m2m_m2m.py::TestObservesForManyToManyToManyToMany::test_add_leaf_object ERROR tests/observes/test_m2m_m2m_m2m.py::TestObservesForManyToManyToManyToMany::test_remove_leaf_object ERROR tests/observes/test_m2m_m2m_m2m.py::TestObservesForManyToManyToManyToMany::test_delete_intermediate_object ERROR tests/observes/test_m2m_m2m_m2m.py::TestObservesForManyToManyToManyToMany::test_gathered_objects_are_distinct ERROR tests/observes/test_o2m_o2m_o2m.py::TestObservesFor3LevelDeepOneToMany::test_simple_insert ERROR tests/observes/test_o2m_o2m_o2m.py::TestObservesFor3LevelDeepOneToMany::test_add_leaf_object ERROR tests/observes/test_o2m_o2m_o2m.py::TestObservesFor3LevelDeepOneToMany::test_remove_leaf_object ERROR tests/observes/test_o2m_o2m_o2m.py::TestObservesFor3LevelDeepOneToMany::test_delete_intermediate_object ERROR tests/observes/test_o2m_o2m_o2m.py::TestObservesFor3LevelDeepOneToMany::test_gathered_objects_are_distinct ERROR tests/observes/test_o2m_o2o_o2m.py::TestObservesForOneToManyToOneToMany::test_simple_insert ERROR tests/observes/test_o2m_o2o_o2m.py::TestObservesForOneToManyToOneToMany::test_add_leaf_object ERROR tests/observes/test_o2m_o2o_o2m.py::TestObservesForOneToManyToOneToMany::test_remove_leaf_object ERROR tests/observes/test_o2m_o2o_o2m.py::TestObservesForOneToManyToOneToMany::test_delete_intermediate_object ERROR tests/observes/test_o2m_o2o_o2m.py::TestObservesForOneToManyToOneToMany::test_gathered_objects_are_distinct ERROR tests/observes/test_o2o_o2o.py::TestObservesForOneToManyToOneToMany::test_observable_root_obj_is_none ERROR tests/observes/test_o2o_o2o_o2o.py::TestObservesForOneToOneToOneToOne::test_simple_insert ERROR tests/observes/test_o2o_o2o_o2o.py::TestObservesForOneToOneToOneToOne::test_replace_leaf_object ERROR tests/observes/test_o2o_o2o_o2o.py::TestObservesForOneToOneToOneToOne::test_delete_leaf_object ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[categories-categories-subcategories-result0] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[articles-comments-comments-result1] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[users-groups-groups-result2] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[users-users-all_friends-result3] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[users-users-all_friends.all_friends-result4] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[users-users-groups.users-result5] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[groups-articles-users.authored_articles-result6] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[categories-categories-subcategories.subcategories-result7] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_returns_correct_results[categories-categories-subcategories.subcategories.subcategories-result8] ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_order_by_intermediate_table_column ERROR tests/relationships/test_select_correlated_expression.py::TestSelectCorrelatedExpression::test_with_non_aggregate_function ERROR tests/types/test_composite.py::TestCompositeTypeWithRegularTypes::test_parameter_processing ERROR tests/types/test_composite.py::TestCompositeTypeWithRegularTypes::test_non_ascii_chars ERROR tests/types/test_composite.py::TestCompositeTypeWithRegularTypes::test_dict_input ERROR tests/types/test_composite.py::TestCompositeTypeWithRegularTypes::test_incomplete_dict ERROR tests/types/test_composite.py::TestCompositeTypeWhenTypeAlreadyExistsInDatabase::test_parameter_processing ERROR tests/types/test_composite.py::TestCompositeTypeWithMixedCase::test_parameter_processing ERROR tests/types/test_json.py::TestPostgresJSONType::test_list - sqlalchemy.... ERROR tests/types/test_json.py::TestPostgresJSONType::test_parameter_processing ERROR tests/types/test_json.py::TestPostgresJSONType::test_non_ascii_chars - ... ERROR tests/types/test_json.py::TestPostgresJSONType::test_compilation - sqla... ERROR tests/types/test_json.py::TestPostgresJSONType::test_unhashable_type - ... ERROR tests/types/test_ltree.py::TestLTREE::test_saves_path - sqlalchemy.exc.... ERROR tests/types/test_ltree.py::TestLTREE::test_literal_param - sqlalchemy.e... ERROR tests/types/test_ltree.py::TestLTREE::test_compilation - sqlalchemy.exc... ERROR tests/types/test_tsvector.py::TestTSVector::test_type_reflection - sqla... ERROR tests/types/test_tsvector.py::TestTSVector::test_catalog_passed_to_match ERROR tests/types/test_tsvector.py::TestTSVector::test_match_concatenation - ... ERROR tests/types/test_tsvector.py::TestTSVector::test_match_with_catalog - s... = 8 failed, 2216 passed, 351 skipped, 1 xfailed, 10 warnings, 108 errors in 52.29s = + : + RPM_EC=0 ++ jobs -p + exit 0 Processing files: python3-sqlalchemy-utils-0.41.1-2.fc39.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.bL5Y4q + umask 022 + cd /builddir/build/BUILD + cd SQLAlchemy-Utils-0.41.1 + DOCDIR=/builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/share/doc/python3-sqlalchemy-utils + export LC_ALL=C + LC_ALL=C + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/share/doc/python3-sqlalchemy-utils + cp -pr /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/README.rst /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/share/doc/python3-sqlalchemy-utils + RPM_EC=0 ++ jobs -p + exit 0 Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.ja69ht + umask 022 + cd /builddir/build/BUILD + cd SQLAlchemy-Utils-0.41.1 + LICENSEDIR=/builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/share/licenses/python3-sqlalchemy-utils + export LC_ALL=C + LC_ALL=C + export LICENSEDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/share/licenses/python3-sqlalchemy-utils + cp -pr /builddir/build/BUILD/SQLAlchemy-Utils-0.41.1/LICENSE /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64/usr/share/licenses/python3-sqlalchemy-utils + RPM_EC=0 ++ jobs -p + exit 0 Provides: python-sqlalchemy-utils = 0.41.1-2.fc39 python3-sqlalchemy-utils = 0.41.1-2.fc39 python3.12-sqlalchemy-utils = 0.41.1-2.fc39 python3.12dist(sqlalchemy-utils) = 0.41.1 python3dist(sqlalchemy-utils) = 0.41.1 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: python(abi) = 3.12 python3.12dist(sqlalchemy) >= 1.3 Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 Wrote: /builddir/build/SRPMS/python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm Wrote: /builddir/build/RPMS/python3-sqlalchemy-utils-0.41.1-2.fc39.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.i6279N + umask 022 + cd /builddir/build/BUILD + cd SQLAlchemy-Utils-0.41.1 + /usr/bin/rm -rf /builddir/build/BUILDROOT/python-sqlalchemy-utils-0.41.1-2.fc39.x86_64 + RPM_EC=0 ++ jobs -p + exit 0 Executing(rmbuild): /bin/sh -e /var/tmp/rpm-tmp.MqjBKo + umask 022 + cd /builddir/build/BUILD + rm -rf SQLAlchemy-Utils-0.41.1 SQLAlchemy-Utils-0.41.1.gemspec + RPM_EC=0 ++ jobs -p + exit 0 Finish: rpmbuild python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm Finish: build phase for python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm INFO: chroot_scan: 3 files copied to /var/lib/copr-rpmbuild/results/chroot_scan INFO: /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root/var/log/dnf.rpm.log /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root/var/log/dnf.librepo.log /var/lib/mock/fedora-rawhide-x86_64-1690883357.281448/root/var/log/dnf.log INFO: Done(/var/lib/copr-rpmbuild/results/python-sqlalchemy-utils-0.41.1-2.fc39.src.rpm) Config(child) 1 minutes 17 seconds INFO: Results and/or logs in: /var/lib/copr-rpmbuild/results INFO: Cleaning up build root ('cleanup_on_success=True') Start: clean chroot INFO: unmounting tmpfs. Finish: clean chroot Finish: run Running RPMResults tool