SciPhi-AI / R2R

Containerized, state of the art Retrieval-Augmented Generation (RAG) system with a RESTful API
https://r2r-docs.sciphi.ai/
MIT License
3.72k stars 280 forks source link

Just running the r2r command in terminal or with some args throws exceptions #1386

Open AriaShishegaran opened 1 month ago

AriaShishegaran commented 1 month ago

Describe the bug


r2r
Usage: r2r [OPTIONS] COMMAND [ARGS]...

  R2R CLI for all core operations.

Options:
  --base-url TEXT  Base URL for the API
  --help           Show this message and exit.

Commands:
  analytics
  app-settings                    Retrieve application settings.
  clone                           Clones a template repository.
  create-graph
  delete                          Delete documents based on filters.
  docker-down                     Bring down the Docker Compose...
  document-chunks                 Get chunks of a specific document.
  documents-overview              Get an overview of documents.
  enrich-graph                    Enrich an existing graph.
  generate-private-key            Generate a secure private key...
  generate-report                 Generate a system report...
  get-entities                    Retrieve entities from the...
  get-triples                     Retrieve triples from the...
  health                          Check the health of the server.
  ingest-files                    Ingest files into R2R.
  ingest-sample-file              Ingest the first sample file...
  ingest-sample-files             Ingest multiple sample files...
  ingest-sample-files-from-unstructured
                                  Ingest multiple sample files...
  list-templates                  Lists all available templates.
  logs                            Retrieve logs with optional type...
  rag                             Perform a RAG query.
  retry-ingest-files              Retry ingestion for failed...
  search                          Perform a search query.
  serve                           Start the R2R server.
  server-stats
  update                          Update the R2R package to the...
  update-files                    Update existing files in R2R.
  users-overview                  Get an overview of users.
  version                         Print the version of R2R.
Task exception was never retrieved
future: <Task finished name='asyncclick.core.BaseCommand._main' coro=<BaseCommand._main() done, defined at /Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/anyio/_backends/_asyncio.py:2229> exception=SystemExit(0)>
Traceback (most recent call last):
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/asyncclick/core.py", line 1119, in main
    async with await self.make_context(prog_name, args, **extra) as ctx:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/asyncclick/core.py", line 985, in make_context
    await self.parse_args(ctx, args)
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/asyncclick/core.py", line 1693, in parse_args
    ctx.exit()
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/asyncclick/core.py", line 731, in exit
    raise Exit(code)
asyncclick.exceptions.Exit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/cli/main.py", line 59, in main
    cli(_anyio_backend="asyncio")
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/asyncclick/core.py", line 1205, in __call__
    return anyio.run(self._main, main, args, kwargs, **opts)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/anyio/_core/_eventloop.py", line 74, in run
    return async_backend.run(func, args, {}, backend_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2248, in run
    return runner.run(wrapper())
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/nest_asyncio.py", line 92, in run_until_complete
    self._run_once()
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/nest_asyncio.py", line 133, in _run_once
    handle._run()
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/asyncio/tasks.py", line 267, in __step
    result = coro.send(None)
             ^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2236, in wrapper
    return await func(*args)
           ^^^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/asyncclick/core.py", line 1208, in _main
    return await main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lucifer/.pyenv/versions/3.11.5/lib/python3.11/site-packages/asyncclick/core.py", line 1148, in main
    sys.exit(e.exit_code)
SystemExit: 0

To Reproduce just run r2r in terminal

emrgnt-cmplxty commented 1 month ago

Are you unable to use actual cli methods like r2r health ?

AriaShishegaran commented 1 month ago

@emrgnt-cmplxty I am, this is just an FYI that the command constantly is throwing exceptions, even while working.

abdulharb commented 1 month ago

Same!! I've had this issue on Linux and MacOS.

I've installed r2r thought pip btw. Everything else seems to be working (well seems like I'm running into other bugs that have issues opened for them).

AriaShishegaran commented 1 month ago

On the latest version the issue has morphed into a new phone, showing a Hatchet SDK error in the beginning of the command running:


r2r
ImportError: `No module named 'hatchet_sdk'`, likely due to core dependencies not being installed.
Usage: r2r [OPTIONS] COMMAND [ARGS]...

  R2R CLI for all core operations.

Options:
  --base-url TEXT  Base URL for the API
  --help           Show this message and exit.

Commands:
  analytics
  app-settings                    Retrieve application settings.
  create-graph
  create-vector-index             Create a vector index for...
  current                         Show current database revision...
  db                              Database management commands.
  deduplicate-entities            Deduplicate entities in the...
  delete                          Delete documents based on filters.
  delete-graph-for-collection     Delete the graph for a given...
  delete-vector-index             Delete a vector index.
  docker-down                     Bring down the Docker Compose...
  document-chunks                 Get chunks of a specific document.
  documents-overview              Get an overview of documents.
  downgrade                       Downgrade database schema to the...
  enrich-graph                    Enrich an existing graph.
  generate-private-key            Generate a secure private key...
  generate-report                 Generate a system report...
  get-entities                    Retrieve entities from the...
  get-triples                     Retrieve triples from the...
  health                          Check the health of the server.
  history                         Show database migration history...
  ingest-files                    Ingest files into R2R.
  ingest-sample-file              Ingest the first sample file...
  ingest-sample-files             Ingest multiple sample files...
  ingest-sample-files-from-unstructured
                                  Ingest multiple sample files...
  list-vector-indices             List all vector indices for a...
  logs                            Retrieve logs with optional type...
  rag                             Perform a RAG query.
  search                          Perform a search query.
  serve                           Start the R2R server.
  server-stats
  update                          Update the R2R package to the...
  update-files                    Update existing files in R2R.
  upgrade                         Upgrade database schema to the...
  users-overview                  Get an overview of users.
  version                         Print the version of R2R.

this is the latest version 3.2.24