Skip to content

ComfyUI fails to start with database error since #11315 #11792

@Leseratte10

Description

@Leseratte10

Custom Node Testing

Expected Behavior

Updated ComfyUI with git pull, installed new requirements. Now fails to start.

Actual Behavior

Failed to start with database errors:

Context impl SQLiteImpl.
Will assume non-transactional DDL.
Assets scan(roots=['models']) completed in 0.020s (created=0, skipped_existing=0, total_seen=11)
Failed to initialize database. Please ensure you have installed the latest requirements. If the error persists, please report this as in future the database will be required: Can't use explicit RETURNING for bulk INSERT operation with sqlite+pysqlite backend; executemany with RETURNING is not enabled for this dialect.

Steps to Reproduce

This isn't a bug with custom nodes, ComfyUI doesn't even start properly, and the error also occurs with "--disable-all-custom-nodes".

I deleted my ComfyUI folder and cloned it again, same error. I deleted my venv and created it again, same error.

I did a git bisect and the first bad commit is 1dc3da6 which is part of PR #11315.

I checked bug #11754 which seems related but is probably a different bug.

If I revert back to version 114fc73 (one commit before the one mentioned above), ComfyUI starts and works again.

Debug Logs

$ python3 main.py 
Checkpoint files will always be loaded safely.
Total VRAM 11004 MB, total RAM 64215 MB
pytorch version: 2.9.1+cu128
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2080 Ti : cudaMallocAsync
Using async weight offloading with 2 streams
Enabled pinned memory 61003.0
working around nvidia conv3d memory bug.
WARNING: You need pytorch with cu130 or higher to use optimized CUDA operations.
Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend cuda: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
Using pytorch attention
Python version: 3.11.10 (main, Sep  7 2024, 18:35:42) [GCC 9.4.0]
ComfyUI version: 0.8.2
ComfyUI frontend version: 1.36.13
[Prompt Server] web root: /home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/comfyui_frontend_package/static

Import times for custom nodes:
   0.0 seconds: /home/florian/comfy_ggufs/ComfyUI/custom_nodes/websocket_image_save.py

Context impl SQLiteImpl.
Will assume non-transactional DDL.
Assets scan(roots=['models']) completed in 0.020s (created=0, skipped_existing=0, total_seen=11)
Failed to initialize database. Please ensure you have installed the latest requirements. If the error persists, please report this as in future the database will be required: Can't use explicit RETURNING for bulk INSERT operation with sqlite+pysqlite backend; executemany with RETURNING is not enabled for this dialect.
Starting server

To see the GUI go to: http://127.0.0.1:8188
Error handling request from 127.0.0.1
Traceback (most recent call last):
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/aiohttp/web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/ComfyUI/middleware/cache_middleware.py", line 27, in cache_control
    response: web.Response = await handler(request)
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/ComfyUI/server.py", line 83, in deprecation_warning
    response: web.Response = await handler(request)
                             ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/ComfyUI/server.py", line 173, in origin_only_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/ComfyUI/server.py", line 689, in get_object_info
    seed_assets(["models"])
  File "/home/florian/comfy_ggufs/ComfyUI/app/assets/scanner.py", line 82, in seed_assets
    result = seed_from_paths_batch(sess, specs=specs, owner_id="")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/ComfyUI/app/assets/database/bulk_ops.py", line 102, in seed_from_paths_batch
    winners_by_path.update((session.execute(ins_state, chunk)).scalars().all())
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2365, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2251, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py", line 1292, in orm_execute_statement
    result = _bulk_insert(
             ^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/sqlalchemy/orm/bulk_persistence.py", line 222, in _bulk_insert
    result = persistence._emit_insert_statements(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/florian/comfy_ggufs/.venv_neu/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1107, in _emit_insert_statements
    raise sa_exc.InvalidRequestError(
sqlalchemy.exc.InvalidRequestError: Can't use explicit RETURNING for bulk INSERT operation with sqlite+pysqlite backend; executemany with RETURNING is not enabled for this dialect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugUser is reporting a bug. This should be tested.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions