Skip to content

Error downloading models in init phase: ZeroDivisionError: division by zero #432

@kyteinsky

Description

@kyteinsky

Describe the bug

Which version of Nextcloud are you using?

32.0.9.2

Which version of Live Transcription are you using?

1.3.1

Which version of Nextcloud Talk are you using?

22.0.12

Nextcloud deployment method?

apche

Describe the Bug

Hi. While deploying application I get error
ZeroDivisionError: division by zero
The server has access to internet, but it seems like it doen't even try to download anything. At least I don't see any connections in my gateway logs

To Reproduce

intall app

Server logs

Ex-App logs

HP_SHARED_KEY is set, creating /frpc.toml configuration file...
Found /certs/frp directory. Creating configuration with TLS certificates.
Starting frpc in the background...
Starting application: /venv/bin/supervisord -c /etc/supervisor/supervisord.conf
2026-05-17 14:15:15.420 [I] [sub/root.go:142] start frpc service for config file [/frpc.toml]
2026-05-17 14:15:15.420 [I] [client/service.go:295] try to connect to server...
2026-05-17 14:15:15.437 [I] [client/service.go:287] [af61b7e94663e333] login to server success, get run id [af61b7e94663e333]
2026-05-17 14:15:15.437 [I] [proxy/proxy_manager.go:173] [af61b7e94663e333] proxy added: [live_transcription]
2026-05-17 14:15:15.438 [I] [client/control.go:168] [af61b7e94663e333] [live_transcription] start proxy success
INFO:     Started server process [17]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on unix socket /tmp/exapp.sock (Press CTRL+C to quit)
WARNING ([5.5.0~3-bc5b]:SelectGpuId():cu-device.cc:243) Not in compute-exclusive mode.  Suggestion: use 'nvidia-smi -c 3' to set compute exclusive mode
LOG ([5.5.0~3-bc5b]:SelectGpuIdAuto():cu-device.cc:438) Selecting from 2 GPUs
LOG ([5.5.0~3-bc5b]:SelectGpuIdAuto():cu-device.cc:453) cudaSetDevice(0): Tesla T4      free:14807M, used:104M, total:14912M, free/total:0.992967
LOG ([5.5.0~3-bc5b]:SelectGpuIdAuto():cu-device.cc:453) cudaSetDevice(1): Tesla T4      free:14807M, used:104M, total:14912M, free/total:0.992967
LOG ([5.5.0~3-bc5b]:SelectGpuIdAuto():cu-device.cc:501) Device: 0, mem_ratio: 0.992967
LOG ([5.5.0~3-bc5b]:SelectGpuId():cu-device.cc:382) Trying to select device: 0
LOG ([5.5.0~3-bc5b]:SelectGpuIdAuto():cu-device.cc:511) Success selecting device 0 free mem ratio: 0.992967
LOG ([5.5.0~3-bc5b]:FinalizeActiveGpu():cu-device.cc:338) The active GPU is [0]: Tesla T4       free:14759M, used:152M, total:14912M, free/total:0.989749 version 7.5
INFO:websockets.server:server listening on 127.0.0.1:2702
INFO:      - "GET /heartbeat HTTP/1.1" 200 OK
INFO:      - "POST /init HTTP/1.1" 200 OK
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 415, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/fastapi/applications.py", line 1159, in __call__
    await super().__call__(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/applications.py", line 90, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/venv/lib/python3.12/site-packages/nc_py_api/ex_app/integration_fastapi.py", line 258, in __call__
    await self.app(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/venv/lib/python3.12/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/routing.py", line 660, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/routing.py", line 680, in app
    await route.handle(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/fastapi/routing.py", line 134, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/venv/lib/python3.12/site-packages/fastapi/routing.py", line 121, in app
    await response(scope, receive, send)
  File "/venv/lib/python3.12/site-packages/starlette/responses.py", line 170, in __call__
    await self.background()
  File "/venv/lib/python3.12/site-packages/starlette/background.py", line 36, in __call__
    await task()
  File "/venv/lib/python3.12/site-packages/starlette/background.py", line 23, in __call__
    await run_in_threadpool(self.func, *self.args, **self.kwargs)
  File "/venv/lib/python3.12/site-packages/starlette/concurrency.py", line 32, in run_in_threadpool
    return await anyio.to_thread.run_sync(func)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/anyio/to_thread.py", line 63, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2518, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 1002, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/nc_py_api/ex_app/integration_fastapi.py", line 134, in fetch_models_task
    models[model]["path"] = __fetch_model_as_snapshot(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/nc_py_api/ex_app/integration_fastapi.py", line 202, in __fetch_model_as_snapshot
    return snapshot_download(
           ^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 88, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/huggingface_hub/_snapshot_download.py", line 391, in snapshot_download
    bytes_progress = _create_progress_bar(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/huggingface_hub/utils/tqdm.py", line 312, in _create_progress_bar
    return cls(**kwargs)  # type: ignore[return-value]
           ^^^^^^^^^^^^^
  File "/venv/lib/python3.12/site-packages/tqdm/std.py", line 1098, in __init__
    self.refresh(lock_args=self.lock_args)
  File "/venv/lib/python3.12/site-packages/tqdm/std.py", line 1347, in refresh
    self.display()
  File "/venv/lib/python3.12/site-packages/nc_py_api/ex_app/integration_fastapi.py", line 197, in display
    nc.set_init_status(min(current_progress + int(progress_for_task * self.n / self.total), 99))
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
ZeroDivisionError: division by zero

courtesy of @AndrewSkull

Steps/Code to Reproduce

/

Expected Results

/

Actual Results

/

Setup configuration

/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions