Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when program is closed:sqlalchemy.pool.impl.NullPool #16504

Open
WTSRUVF opened this issue Dec 26, 2024 · 0 comments
Open

Error message when program is closed:sqlalchemy.pool.impl.NullPool #16504

WTSRUVF opened this issue Dec 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@WTSRUVF
Copy link

WTSRUVF commented Dec 26, 2024

Bug summary

When I execute the program in the documentation, this error is sometimes reported after the program is executed.

code

from prefect import flow, task

@task
def say_hello(name):
    return f"Hello {name}!"

@task
def print_result(result):
    print(type(result))
    print(result)

@flow(name="hello-flow")
def hello_world():
    future = say_hello.submit("Marvin")
    print_result.submit(future).wait()

hello_world()

error

20:29:07.002 | ERROR   | sqlalchemy.pool.impl.NullPool - Exception closing connection <AdaptedConnection <Connection(Thread-16, started daemon 139909163644608)>>
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 376, in _close_connection
    self._dialect.do_close(connection)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 708, in do_close
    dbapi_connection.close()
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 275, in close
    self.await_(self._connection.close())
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 132, in await_only
    return current.parent.switch(awaitable)  # type: ignore[no-any-return,attr-defined] # noqa: E501
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 196, in greenlet_spawn
    value = await result
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/aiosqlite/core.py", line 178, in close
    await self._execute(self._conn.close)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/aiosqlite/core.py", line 132, in _execute
    return await future
asyncio.exceptions.CancelledError

If DaskTaskRunner is used, the following error is reported.
image

14:25:36.839 | ERROR   | sqlalchemy.pool.impl.NullPool - Exception during reset or similar
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 986, in _finalize_fairy
    fairy._reset(
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 1432, in _reset
    pool._dialect.do_rollback(self)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 699, in do_rollback
    dbapi_connection.rollback()
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 263, in rollback
    self.await_(self._connection.rollback())
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 132, in await_only
    return current.parent.switch(awaitable)  # type: ignore[no-any-return,attr-defined] # noqa: E501
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 196, in greenlet_spawn
    value = await result
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/aiosqlite/core.py", line 169, in rollback
    await self._execute(self._conn.rollback)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/aiosqlite/core.py", line 132, in _execute
    return await future
asyncio.exceptions.CancelledError

Version info

Version:             3.1.10
API version:         0.8.4
Python version:      3.9.16
Git commit:          b11b56fc
Built:               Tue, Dec 24, 2024 10:58 PM
OS/Arch:             linux/x86_64
Profile:             ephemeral
Server type:         ephemeral
Pydantic version:    2.10.4
Server:
  Database:          sqlite
  SQLite version:    3.45.1

Additional context

Package                   Version
------------------------- -----------
aiosqlite                 0.20.0
alembic                   1.14.0
amqp                      5.3.1
annotated-types           0.7.0
anyio                     4.7.0
apprise                   1.9.1
APScheduler               3.11.0
asgi-lifespan             2.1.0
async-timeout             5.0.1
asyncpg                   0.30.0
attrs                     24.3.0
bce-python-sdk            0.9.25
beautifulsoup4            4.12.3
billiard                  4.2.1
blinker                   1.9.0
bs4                       0.0.2
cachetools                5.5.0
celery                    5.4.0
certifi                   2024.12.14
cffi                      1.17.1
charset-normalizer        3.4.1
click                     8.1.8
click-didyoumean          0.3.1
click-plugins             1.1.1
click-repl                0.3.0
cloudpickle               3.1.0
colorama                  0.4.6
coolname                  2.2.0
croniter                  3.0.4
cryptography              44.0.0
dask                      2024.8.0
dateparser                1.2.0
Deprecated                1.2.15
distributed               2024.8.0
docker                    7.1.0
exceptiongroup            1.2.2
fastapi                   0.115.6
Flask                     3.1.0
Flask-SQLAlchemy          3.1.1
fsspec                    2024.12.0
future                    1.0.0
graphviz                  0.20.3
greenlet                  3.1.1
griffe                    1.5.1
h11                       0.14.0
h2                        4.1.0
hpack                     4.0.0
httpcore                  1.0.7
httpx                     0.28.1
humanize                  4.11.0
hyperframe                6.0.1
idna                      3.10
importlib_metadata        8.5.0
itsdangerous              2.2.0
jieba                     0.42.1
Jinja2                    3.1.5
jinja2-humanize-extension 0.4.0
joblib                    1.4.2
jsonpatch                 1.33
jsonpointer               3.0.0
jsonschema                4.23.0
jsonschema-specifications 2024.10.1
kombu                     5.4.2
Levenshtein               0.26.1
locket                    1.0.0
lxml                      5.2.2
Mako                      1.3.8
Markdown                  3.7
markdown-it-py            3.0.0
MarkupSafe                3.0.2
mdurl                     0.1.2
msgpack                   1.1.0
nltk                      3.9.1
numpy                     2.0.2
oauthlib                  3.2.2
opentelemetry-api         1.29.0
orjson                    3.10.12
packaging                 24.2
pandas                    2.2.3
partd                     1.4.2
pathspec                  0.12.1
pendulum                  3.0.0
pip                       22.0.4
prefect                   3.1.10
prefect-dask              0.3.2
prometheus_client         0.21.1
prompt_toolkit            3.0.48
psutil                    6.1.1
py4j                      0.10.9.7
pycparser                 2.22
pycrypto                  2.6.1
pycryptodome              3.21.0
pydantic                  2.10.4
pydantic_core             2.27.2
pydantic-extra-types      2.10.1
pydantic-settings         2.7.0
Pygments                  2.18.0
PyMySQL                   1.1.1
pyspark                   3.5.4
python-dateutil           2.9.0.post0
python-dotenv             1.0.1
python-Levenshtein        0.26.1
python-slugify            8.0.4
python-socks              2.5.3
pytz                      2024.2
PyYAML                    6.0.2
RapidFuzz                 3.11.0
readchar                  4.2.1
redis                     5.2.1
referencing               0.35.1
regex                     2024.11.6
requests                  2.32.3
requests-oauthlib         2.0.0
rfc3339-validator         0.1.4
rich                      13.9.4
rpds-py                   0.22.3
ruamel.yaml               0.18.6
ruamel.yaml.clib          0.2.12
setuptools                58.1.0
shellingham               1.5.4
six                       1.17.0
sniffio                   1.3.1
sortedcontainers          2.4.0
soupsieve                 2.6
SQLAlchemy                2.0.36
starlette                 0.41.3
tblib                     3.0.0
text-unidecode            1.3
time-machine              2.16.0
timeout-decorator         0.5.0
toml                      0.10.2
toolz                     1.0.0
tornado                   6.4.2
tqdm                      4.67.1
typer                     0.12.5
typing_extensions         4.12.2
tzdata                    2024.2
tzlocal                   5.2
ujson                     5.10.0
urllib3                   2.3.0
uvicorn                   0.34.0
vine                      5.1.0
wcwidth                   0.2.13
websockets                13.1
Werkzeug                  3.1.3
wrapt                     1.17.0
zhon                      2.1.1
zict                      3.0.0
zipp                      3.21.0
@WTSRUVF WTSRUVF added the bug Something isn't working label Dec 26, 2024
@WTSRUVF WTSRUVF changed the title sqlalchemy.pool.impl.NullPool Error message when multithreaded operation is closed:sqlalchemy.pool.impl.NullPool Dec 30, 2024
@WTSRUVF WTSRUVF changed the title Error message when multithreaded operation is closed:sqlalchemy.pool.impl.NullPool Error message when program is closed:sqlalchemy.pool.impl.NullPool Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant