Skip to content

NIM ANYWHERE -> 500 Server Error TypeError: argument of type 'bool' is not iterable #82

@gittiery

Description

@gittiery

Hi -I've been trying to get this 'NIM Anywhere' project to run via NVIDIA Ai Workbench, and I get all of these started and all seem to be running fine:


Compose
RUNNING

milvus | RUNNING
redis | RUNNING

Project Container
RUNNING

Applications
VS Code

Chat Frontend
RUNNING

Chain Server
RUNNING

Tutorial
RUNNING

JupyterLab
RUNNING


But when I click on 'Open Chat Frontend' I get a double column page in my browser, where both columns are identical, and say:

500 Server Error TypeError: argument of type 'bool' is not iterable

And under that is this long 'Traceback' that I have posted below. Can anyone tell me what is wrong here? As I haven't edited the files or anything. And the tutorial in this works ok I guess - though it doesn't seem like much of a tutorial at all. And I can't find any info regarding this particular error for the NIM Anywhere container. If anyone can please help me it would be GREATLY APPRECIATED !

Thanks in advance for any replies!

-patrick

traceback posted below:

Traceback

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 887, in get_type ‒

  1. def get_type(schema: dict):

  2. if "const" in schema:
    
  3.     return "const"
    
  4. if "enum" in schema:
    
  5.     return "enum"
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 928, in _json_schema_to_python_type ‒

  1. """Convert the json schema into a python type hint"""
    
  2. if schema == {}:
    
  3.     return "Any"
    
  4. type_ = get_type(schema)
    
  5. if type_ == {}:
    
  6.     if "json" in schema.get("description", {}):
    
  7.         return "str | float | bool | list | dict"
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 982, in _json_schema_to_python_type ‒

  1.     if "additionalProperties" in schema:
    
  2.         des += [
    
  3.             f"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}"
    
  4.         ]
    
  5.     des = ", ".join(des)
    
  6.     return f"dict({des})"
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 975, in ‒

  1.     props = schema.get("properties", {})
    
  2.     des = [
    
  3.         f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}"
    
  4.         for n, v in props.items()
    
  5.         if n != "$defs"
    
  6.     ]
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 974, in _json_schema_to_python_type ‒

  1.     props = schema.get("properties", {})
    
  2.     des = [
    
  3.         f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}"
    
  4.         for n, v in props.items()
    
  5.         if n != "$defs"
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 935, in _json_schema_to_python_type ‒

  1.     else:
    
  2.         return "Any"
    
  3. elif type_ == "$ref":
    
  4.     return _json_schema_to_python_type(defs[schema["$ref"].split("/")[-1]], defs)
    
  5. elif type_ == "null":
    
  6.     return "None"
    
  7. elif type_ == "const":
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 965, in _json_schema_to_python_type ‒

  1.         )
    
  2.         return f"tuple[{elements}]"
    
  3.     else:
    
  4.         elements = _json_schema_to_python_type(items, defs)
    
  5.         return f"list[{elements}]"
    
  6. elif type_ == "object":
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio_client/utils.py, line 920, in json_schema_to_python_type ‒

  1. def json_schema_to_python_type(schema: Any) -> str:

  2. type_ = _json_schema_to_python_type(schema, schema.get("$defs"))
    
  3. return type_.replace(CURRENT_FILE_DATA_FORMAT, "filepath")
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio/blocks.py, line 2925, in get_api_info ‒

  1.                 raise TypeError(f"{comp!r} is not a Component")
    
  2.             info = component.get("api_info_as_input", component.get("api_info"))
    
  3.             example = comp.example_inputs()
    
  4.             python_type = client_utils.json_schema_to_python_type(info)
    
  5.             # Since the clients use "api_name" and "fn_index" to designate the endpoint and
    
  6.             # "result_callbacks" to specify the callbacks, we need to make sure that no parameters
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio/routes.py, line 582, in api_info ‒

  1.                 app.all_app_info = app.get_blocks().get_api_info(all_endpoints=True)
    
  2.             return app.all_app_info
    
  3.         if not app.api_info:
    
  4.             api_info = utils.safe_deepcopy(app.get_blocks().get_api_info())
    
  5.             api_info = cast(dict[str, Any], api_info)
    
  6.             api_info = route_utils.update_example_values_to_use_public_url(api_info)
    
  7.             app.api_info = api_info
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio/routes.py, line 552, in main ‒

  1.             template = (
    
  2.                 "frontend/share.html" if blocks.share else "frontend/index.html"
    
  3.             )
    
  4.             gradio_api_info = api_info(request)
    
  5.             return templates.TemplateResponse(
    
  6.                 request=request,
    
  7.                 name=template,
    

File /usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py, line 962, in run ‒

  1.                 exception: BaseException | None = None
    
  2.                 threadlocals.current_cancel_scope = cancel_scope
    
  3.                 try:
    
  4.                     result = context.run(func, *args)
    
  5.                 except BaseException as exc:
    
  6.                     exception = exc
    
  7.                 finally:
    

File /usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py, line 2461, in run_sync_in_worker_thread ‒

  1.                 worker_scope = scope._parent_scope
    
  2.             worker.queue.put_nowait((context, func, args, future, worker_scope))
    
  3.             return await future
    
  4. @classmethod
    
  5. def check_cancelled(cls) -> None:
    

File /usr/local/lib/python3.10/dist-packages/anyio/to_thread.py, line 56, in run_sync ‒

  1.         stacklevel=2,
    
  2.     )
    
  3. return await get_async_backend().run_sync_in_worker_thread(
    
  4.     func, args, abandon_on_cancel=abandon_on_cancel, limiter=limiter
    
  5. )
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/concurrency.py, line 39, in run_in_threadpool ‒

  1. if kwargs:  # pragma: no cover
    
  2.     # run_sync doesn't accept 'kwargs', so bind them in here
    
  3.     func = functools.partial(func, **kwargs)
    
  4. return await anyio.to_thread.run_sync(func, *args)
    
  5. class _StopIteration(Exception):

File /home/workbench/.local/lib/python3.10/site-packages/fastapi/routing.py, line 214, in run_endpoint_function ‒

  1. if is_coroutine:
    
  2.     return await dependant.call(**values)
    
  3. else:
    
  4.     return await run_in_threadpool(dependant.call, **values)
    
  5. def get_request_handler(

File /home/workbench/.local/lib/python3.10/site-packages/fastapi/routing.py, line 301, in app ‒

  1.             )
    
  2.             errors = solved_result.errors
    
  3.             if not errors:
    
  4.                 raw_response = await run_endpoint_function(
    
  5.                     dependant=dependant,
    
  6.                     values=solved_result.values,
    
  7.                     is_coroutine=is_coroutine,
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/routing.py, line 73, in app ‒

  1.     request = Request(scope, receive, send)
    
  2.     async def app(scope: Scope, receive: Receive, send: Send) -> None:
    
  3.         response = await f(request)
    
  4.         await response(scope, receive, send)
    
  5.     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/_exception_handler.py, line 42, in wrapped_app ‒

  1.         await send(message)
    
  2.     try:
    
  3.         await app(scope, receive, sender)
    
  4.     except Exception as exc:
    
  5.         handler = None
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/_exception_handler.py, line 53, in wrapped_app ‒

  1.             handler = _lookup_exception_handler(exception_handlers, exc)
    
  2.         if handler is None:
    
  3.             raise exc
    
  4.         if response_started:
    
  5.             raise RuntimeError("Caught handled exception, but response already started.") from exc
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/routing.py, line 76, in app ‒

  1.         response = await f(request)
    
  2.         await response(scope, receive, send)
    
  3.     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    
  4. return app
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/routing.py, line 288, in handle ‒

  1.             response = PlainTextResponse("Method Not Allowed", status_code=405, headers=headers)
    
  2.         await response(scope, receive, send)
    
  3.     else:
    
  4.         await self.app(scope, receive, send)
    
  5. def __eq__(self, other: typing.Any) -> bool:
    
  6.     return (
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/routing.py, line 735, in app ‒

  1.         match, child_scope = route.matches(scope)
    
  2.         if match == Match.FULL:
    
  3.             scope.update(child_scope)
    
  4.             await route.handle(scope, receive, send)
    
  5.             return
    
  6.         elif match == Match.PARTIAL and partial is None:
    
  7.             partial = route
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/_exception_handler.py, line 42, in wrapped_app +

  1.         await send(message)
    
  2.     try:
    
  3.         await app(scope, receive, sender)
    
  4.     except Exception as exc:
    
  5.         handler = None
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/_exception_handler.py, line 53, in wrapped_app ‒

  1.             handler = _lookup_exception_handler(exception_handlers, exc)
    
  2.         if handler is None:
    
  3.             raise exc
    
  4.         if response_started:
    
  5.             raise RuntimeError("Caught handled exception, but response already started.") from exc
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/routing.py, line 715, in call

  1.     """
    
  2.     The main entry point to the Router class.
    
  3.     """
    
  4.     await self.middleware_stack(scope, receive, send)
    
  5. async def app(self, scope: Scope, receive: Receive, send: Send) -> None:
    
  6.     assert scope["type"] in ("http", "websocket", "lifespan")
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py, line 62, in call

  1.     else:
    
  2.         conn = WebSocket(scope, receive, send)
    
  3.     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
    
  4. def http_exception(self, request: Request, exc: Exception) -> Response:
    
  5.     assert isinstance(exc, HTTPException)
    

File /home/workbench/.local/lib/python3.10/site-packages/gradio/route_utils.py, line 789, in call

  1.     headers = Headers(scope=scope)
    
  2.     origin = headers.get("origin")
    
  3.     if origin is None:
    
  4.         await self.app(scope, receive, send)
    
  5.         return
    
  6.     if scope["method"] == "OPTIONS" and "access-control-request-method" in headers:
    
  7.         response = self.preflight_response(request_headers=headers)
    

File /home/workbench/.local/lib/python3.10/site-packages/starlette/middleware/errors.py, line 165, in call

  1.         await send(message)
    
  2.     try:
    
  3.         await self.app(scope, receive, _send)
    
  4.     except Exception as exc:
    
  5.         request = Request(scope)
    
  6.         if self.debug:
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions