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

Sqlite: process hanged indefinetly when running aerich migrate #384

Open
waketzheng opened this issue Dec 11, 2024 · 1 comment
Open

Sqlite: process hanged indefinetly when running aerich migrate #384

waketzheng opened this issue Dec 11, 2024 · 1 comment

Comments

@waketzheng
Copy link
Contributor

          So it kind of worked but theres a couple extra errors.

First on init-db, the process outputs

Success create app migrate location ./migrations/models
Success generate schema for app "models"
^CException ignored in: <module 'threading' from '/usr/lib/python3.8/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 1388, in _shutdown
    lock.acquire()
KeyboardInterrupt:

the process hanged indefinetly so i had to terminate it.
Then i did aerich migrate --name "new column"
which output:

Success migrate 0_202018061820221822_init.json

^CException ignored in: <module 'threading' from '/usr/lib/python3.8/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 1388, in _shutdown
    lock.acquire()
KeyboardInterrupt:

But again the process hanged there so had to be terminated.

Then i finally did:
aerich upgrade
but this happened:

returning exception You can only execute one statement at a time.
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 171, in run
    result = function()
  File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 154, in _execute_fetchall
    cursor = self._conn.execute(sql, parameters)
sqlite3.Warning: You can only execute one statement at a time.
Traceback (most recent call last):
  File "/usr/local/bin/aerich", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/aerich/cli.py", line 231, in main
    cli(_anyio_backend="asyncio")
  File "/usr/local/lib/python3.8/dist-packages/asyncclick/core.py", line 799, in __call__
    return anyio.run(self._main, main, args, kwargs, backend=_anyio_backend)
  File "/usr/local/lib/python3.8/dist-packages/anyio/__init__.py", line 68, in run
    return asynclib.run(func, *args, **backend_options)  # type: ignore
  File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 99, in run
    raise exception
  File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 67, in wrapper
    retval = await func(*args)
  File "/usr/local/lib/python3.8/dist-packages/asyncclick/core.py", line 802, in _main
    return await main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/asyncclick/core.py", line 748, in main
    rv = await self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/asyncclick/core.py", line 1175, in invoke
    return await _process_result(await sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/asyncclick/core.py", line 994, in invoke
    return await ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/asyncclick/core.py", line 588, in invoke
    rv = await rv
  File "/usr/local/lib/python3.8/dist-packages/aerich/cli.py", line 103, in upgrade
    await conn.execute_query(upgrade_query)
  File "/usr/local/lib/python3.8/dist-packages/tortoise/backends/sqlite/client.py", line 29, in translate_exceptions_
    return await func(self, query, *args)
  File "/usr/local/lib/python3.8/dist-packages/tortoise/backends/sqlite/client.py", line 132, in execute_query
    rows = await connection.execute_fetchall(query, values)
  File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 255, in execute_fetchall
    return await self._execute(self._execute_fetchall, sql, parameters)
  File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 185, in _execute
    return await future
  File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 171, in run
    result = function()
  File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 154, in _execute_fetchall
    cursor = self._conn.execute(sql, parameters)
sqlite3.Warning: You can only execute one statement at a time.

and again the procees hanged there indefinetly, so had to be killed.

Originally posted by @chrisdewa in #9 (comment)

@waketzheng
Copy link
Contributor Author

Related issue omnilib/aiosqlite#306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant