Skip to content

VERSION missing from docker file causes server error #594

Closed
@ad-astra-video

Description

@ad-astra-video

Describe the bug

Need to add to the batch pipeline dockerfiles:

ARG VERSION="undefined"
ENV VERSION=${VERSION}

cc @leszko

timestamp=2025-05-22 01:44:50 level=INFO location=hardware.py:130:log_gpu_compute_info gateway_request_id= stream_id= message=Device 0: id='GPU-6771ec54-80c0-cb30-d72a-c477d320cd2b' name='NVIDIA GeForce RTX 3090 Ti' memory_total=25757220864 memory_free=23220060160 major=8 minor=6
timestamp=2025-05-22 01:44:50 level=INFO location=main.py:34:lifespan gateway_request_id= stream_id= message=Started up with pipeline AudioToTextPipeline model_id=deepdml/faster-whisper-large-v3-turbo-ct2
timestamp=2025-05-22 01:44:50 level=INFO location=main.py:38:lifespan gateway_request_id= stream_id= message=Runner version: undefined
2025-05-22 01:44:50,585 INFO:     Application startup complete.
2025-05-22 01:44:50,585 INFO:     Uvicorn running on http://:8000 (Press CTRL+C to quit)
2025-05-22 01:44:50,651 INFO:     172.17.0.1:43040 - "GET /health HTTP/1.1" 200 OK
2025-05-22 01:44:50,653 INFO:     172.17.0.1:43040 - "GET /hardware/info HTTP/1.1" 200 OK
2025-05-22 01:44:50,653 INFO:     172.17.0.1:43040 - "GET /version HTTP/1.1" 500 Internal Server Error
2025-05-22 01:44:50,653 ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/root/.pyenv/versions/3.11.12/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 967, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/app/routes/version.py", line 14, in version
    version=os.environ["VERSION"],
            ~~~~~~~~~~^^^^^^^^^^^
  File "<frozen os>", line 679, in __getitem__
KeyError: 'VERSION'

Reproduction steps

  1. Build docker container without adding --build-arg VERSION=0.13.5
  2. Observe 500 error with go-livepeer ai-worker startup

Expected behaviour

Default to 0.0.0 or blank.

Severity

Minor

Screenshots / Live demo link

No response

OS

None

Running on

None

AI-worker version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions