[GH-ISSUE #166] Error with anthropic_manifold_pipeline #80

Open
opened 2026-10-18 21:02:13 +00:00 by bsakaguchi · 47 comments
Owner

Originally created by @dannykorpan on GitHub (Jul 19, 2024).
Original GitHub issue: https://github.com/open-webui/pipelines/issues/166

Bug Report

Description

Bug Summary:
When using Claude 3.5 via anthropic_manifold_pipeline.py from https://github.com/open-webui/pipelines/blob/main/examples/pipelines/providers/anthropic_manifold_pipeline.py, I get the following error after a while. The API Key is correct.
grafik

Steps to Reproduce:
I deployed Pipelines via docker and set up the API Key via the admin interface.
grafik

After using Claude 3.5 the pipelines container prints the following error after 2-3 uses.

INFO:     192.168.0.4:59372 - "GET /models HTTP/1.1" 200 OK
INFO:     192.168.0.4:57282 - "GET /models HTTP/1.1" 200 OK
INFO:     192.168.0.4:36000 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
anthropic.claude-3-5-sonnet-20240620
anthropic.claude-3-5-sonnet-20240620
INFO:     192.168.0.4:36014 - "POST /chat/completions HTTP/1.1" 200 OK
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
    await func()
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
    yield await anyio.to_thread.run_sync(_next, as_iterator)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/app/main.py", line 665, in stream_content
    for line in res:
  File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response
    stream = self.client.messages.create(**payload)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}}

Environment

  • Open WebUI Version: [e.g., 0.1.120]
    v0.3.10

  • Operating System: [e.g., Windows 10, macOS Big Sur, Ubuntu 20.04]
    Server: Latest Docker, x64
    Client: Latest macOS Sonoma, ARM64

  • Browser (if applicable): [e.g., Chrome 100.0, Firefox 98.0]
    Latest Firefox, ARM64

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
Originally created by @dannykorpan on GitHub (Jul 19, 2024). Original GitHub issue: https://github.com/open-webui/pipelines/issues/166 # Bug Report ## Description **Bug Summary:** When using Claude 3.5 via anthropic_manifold_pipeline.py from https://github.com/open-webui/pipelines/blob/main/examples/pipelines/providers/anthropic_manifold_pipeline.py, I get the following error after a while. The API Key is correct. <img width="1034" alt="grafik" src="https://github.com/user-attachments/assets/7c9e9fd8-b480-4d42-a276-9d0b376f98dd"> **Steps to Reproduce:** I deployed Pipelines via docker and set up the API Key via the admin interface. <img width="1480" alt="grafik" src="https://github.com/user-attachments/assets/10779c83-a6fd-416b-8e6f-32e8cb5b8fb1"> After using Claude 3.5 the pipelines container prints the following error after 2-3 uses. ``` INFO: 192.168.0.4:59372 - "GET /models HTTP/1.1" 200 OK INFO: 192.168.0.4:57282 - "GET /models HTTP/1.1" 200 OK INFO: 192.168.0.4:36000 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK anthropic.claude-3-5-sonnet-20240620 anthropic.claude-3-5-sonnet-20240620 INFO: 192.168.0.4:36014 - "POST /chat/completions HTTP/1.1" 200 OK ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap await func() File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response async for chunk in self.body_iterator: File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool yield await anyio.to_thread.run_sync(_next, as_iterator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next return next(iterator) ^^^^^^^^^^^^^^ File "/app/main.py", line 665, in stream_content for line in res: File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response stream = self.client.messages.create(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create return self._post( ^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request return self._request( ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request raise self._make_status_error_from_response(err.response) from None anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}} ``` ## Environment - **Open WebUI Version:** [e.g., 0.1.120] v0.3.10 - **Operating System:** [e.g., Windows 10, macOS Big Sur, Ubuntu 20.04] Server: Latest Docker, x64 Client: Latest macOS Sonoma, ARM64 - **Browser (if applicable):** [e.g., Chrome 100.0, Firefox 98.0] Latest Firefox, ARM64 **Confirmation:** - [X] I have read and followed all the instructions provided in the README.md. - [X] I am on the latest version of both Open WebUI and Ollama. - [X] I have included the browser console logs. - [X] I have included the Docker container logs.
Author
Owner

@eddienubes commented on GitHub (Jul 19, 2024):

We often experience the same thing.

<!-- gh-comment-id:2239474541 --> @eddienubes commented on GitHub (Jul 19, 2024): We often experience the same thing.
Author
Owner

@justinh-rahb commented on GitHub (Jul 19, 2024):

I'll have a look when I've got time, but I've been mostly using my Anthropic Function nowadays. I haven't noticed this issue in that, but then it's just using requests and not using the anthropic library actually, so there could be differences there.

<!-- gh-comment-id:2239837822 --> @justinh-rahb commented on GitHub (Jul 19, 2024): I'll have a look when I've got time, but I've been mostly using my Anthropic Function nowadays. I haven't noticed this issue in that, but then it's just using `requests` and not using the `anthropic` library actually, so there could be differences there.
Author
Owner

@dannykorpan commented on GitHub (Jul 23, 2024):

Any solution yet? Today I have the same problem.

RESET_PIPELINES_DIR is not set to true. No action taken.
PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements.
PIPELINES_URLS not specified. Skipping pipelines download and installation.
INFO:     Started server process [7]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit)
Loaded module: anthropic_manifold_pipeline
Loaded module: openai_dalle_manifold_pipeline
on_startup:anthropic_manifold_pipeline
on_startup:openai_dalle_manifold_pipeline
INFO:     192.168.0.4:52276 - "GET /models HTTP/1.1" 200 OK
RESET_PIPELINES_DIR is not set to true. No action taken.
PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements.
PIPELINES_URLS not specified. Skipping pipelines download and installation.
INFO:     Started server process [7]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit)
Loaded module: anthropic_manifold_pipeline
Loaded module: openai_dalle_manifold_pipeline
on_startup:anthropic_manifold_pipeline
on_startup:openai_dalle_manifold_pipeline
INFO:     192.168.0.4:59008 - "GET /models HTTP/1.1" 200 OK
INFO:     192.168.0.4:60898 - "GET /models HTTP/1.1" 200 OK
INFO:     192.168.0.4:60940 - "GET /models HTTP/1.1" 200 OK
INFO:     192.168.0.4:51132 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
anthropic.claude-3-5-sonnet-20240620
anthropic.claude-3-5-sonnet-20240620
INFO:     192.168.0.4:51134 - "POST /chat/completions HTTP/1.1" 200 OK
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
    await func()
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
    yield await anyio.to_thread.run_sync(_next, as_iterator)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/app/main.py", line 665, in stream_content
    for line in res:
  File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response
    stream = self.client.messages.create(**payload)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}}
INFO:     192.168.0.4:52738 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
anthropic.claude-3-5-sonnet-20240620
anthropic.claude-3-5-sonnet-20240620
INFO:     192.168.0.4:52740 - "POST /chat/completions HTTP/1.1" 200 OK
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
    await func()
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
    yield await anyio.to_thread.run_sync(_next, as_iterator)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/app/main.py", line 665, in stream_content
    for line in res:
  File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response
    stream = self.client.messages.create(**payload)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}}
<!-- gh-comment-id:2244294570 --> @dannykorpan commented on GitHub (Jul 23, 2024): Any solution yet? Today I have the same problem. ``` RESET_PIPELINES_DIR is not set to true. No action taken. PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements. PIPELINES_URLS not specified. Skipping pipelines download and installation. INFO: Started server process [7] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit) Loaded module: anthropic_manifold_pipeline Loaded module: openai_dalle_manifold_pipeline on_startup:anthropic_manifold_pipeline on_startup:openai_dalle_manifold_pipeline INFO: 192.168.0.4:52276 - "GET /models HTTP/1.1" 200 OK RESET_PIPELINES_DIR is not set to true. No action taken. PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements. PIPELINES_URLS not specified. Skipping pipelines download and installation. INFO: Started server process [7] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit) Loaded module: anthropic_manifold_pipeline Loaded module: openai_dalle_manifold_pipeline on_startup:anthropic_manifold_pipeline on_startup:openai_dalle_manifold_pipeline INFO: 192.168.0.4:59008 - "GET /models HTTP/1.1" 200 OK INFO: 192.168.0.4:60898 - "GET /models HTTP/1.1" 200 OK INFO: 192.168.0.4:60940 - "GET /models HTTP/1.1" 200 OK INFO: 192.168.0.4:51132 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK anthropic.claude-3-5-sonnet-20240620 anthropic.claude-3-5-sonnet-20240620 INFO: 192.168.0.4:51134 - "POST /chat/completions HTTP/1.1" 200 OK ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap await func() File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response async for chunk in self.body_iterator: File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool yield await anyio.to_thread.run_sync(_next, as_iterator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next return next(iterator) ^^^^^^^^^^^^^^ File "/app/main.py", line 665, in stream_content for line in res: File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response stream = self.client.messages.create(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create return self._post( ^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request return self._request( ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request raise self._make_status_error_from_response(err.response) from None anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}} INFO: 192.168.0.4:52738 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK anthropic.claude-3-5-sonnet-20240620 anthropic.claude-3-5-sonnet-20240620 INFO: 192.168.0.4:52740 - "POST /chat/completions HTTP/1.1" 200 OK ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap await func() File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response async for chunk in self.body_iterator: File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool yield await anyio.to_thread.run_sync(_next, as_iterator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next return next(iterator) ^^^^^^^^^^^^^^ File "/app/main.py", line 665, in stream_content for line in res: File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response stream = self.client.messages.create(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create return self._post( ^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request return self._request( ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request raise self._make_status_error_from_response(err.response) from None anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}} ```
Author
Owner

@justinh-rahb commented on GitHub (Jul 23, 2024):

401 Authentication error. Have you checked your keys work if you do a request manually with cURL?

<!-- gh-comment-id:2245499307 --> @justinh-rahb commented on GitHub (Jul 23, 2024): 401 Authentication error. Have you checked your keys work if you do a request manually with cURL?
Author
Owner

@dannykorpan commented on GitHub (Jul 23, 2024):

The API Key is correct.

See my initial post.

<!-- gh-comment-id:2245595370 --> @dannykorpan commented on GitHub (Jul 23, 2024): > The API Key is correct. See my initial post.
Author
Owner

@justinh-rahb commented on GitHub (Jul 23, 2024):

Your logs are either at odds with the reality, or your key is bad. You didn't answer the question of whether you've tried that key with anything else. You're certain your account is in good-standing, and adequately funded ($5 minimum balance required IIRC)?

If I deliberately set an incorrect key I get this error, same as you:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
    await func()
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
    yield await anyio.to_thread.run_sync(_next, as_iterator)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/app/main.py", line 665, in stream_content
    for line in res:
  File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response
    stream = self.client.messages.create(**payload)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create
    return self._post(
           ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}}
<!-- gh-comment-id:2245959469 --> @justinh-rahb commented on GitHub (Jul 23, 2024): Your logs are either at odds with the reality, or your key is bad. You didn't answer the question of whether you've tried that key with anything else. You're certain your account is in good-standing, and adequately funded ($5 minimum balance required IIRC)? If I deliberately set an incorrect key I get this error, same as you: ```log ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap await func() File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response async for chunk in self.body_iterator: File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool yield await anyio.to_thread.run_sync(_next, as_iterator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next return next(iterator) ^^^^^^^^^^^^^^ File "/app/main.py", line 665, in stream_content for line in res: File "/app/./pipelines/anthropic_manifold_pipeline.py", line 141, in stream_response stream = self.client.messages.create(**payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/resources/messages.py", line 904, in create return self._post( ^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1266, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 942, in request return self._request( ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anthropic/_base_client.py", line 1046, in _request raise self._make_status_error_from_response(err.response) from None anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}} ```
Author
Owner

@dannykorpan commented on GitHub (Jul 24, 2024):

Your logs are either at odds with the reality, or your key is bad. You didn't answer the question of whether you've tried that key with anything else. You're certain your account is in good-standing, and adequately funded ($5 minimum balance required IIRC)?

25$ Balance

Here is the cURL Example with output

curl https://api.anthropic.com/v1/messages --header "x-api-key: MYAPIKEY" --header "anthropic-version: 2023-06-01" --header "content-type: application/json" --data '{"model": "claude-3-5-sonnet-20240620", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello, world"}]}'
{"id":"msg_018VV4ca8WAiR8iTgSfMcx3d","type":"message","role":"assistant","model":"claude-3-5-sonnet-20240620","content":[{"type":"text","text":"Hello! How can I assist you today? Is there anything specific you'd like to talk about or any questions you have?"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":10,"output_tokens":28}}
<!-- gh-comment-id:2247335171 --> @dannykorpan commented on GitHub (Jul 24, 2024): > Your logs are either at odds with the reality, or your key is bad. You didn't answer the question of whether you've tried that key with anything else. You're certain your account is in good-standing, and adequately funded ($5 minimum balance required IIRC)? 25$ Balance Here is the cURL Example with output ``` curl https://api.anthropic.com/v1/messages --header "x-api-key: MYAPIKEY" --header "anthropic-version: 2023-06-01" --header "content-type: application/json" --data '{"model": "claude-3-5-sonnet-20240620", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello, world"}]}' {"id":"msg_018VV4ca8WAiR8iTgSfMcx3d","type":"message","role":"assistant","model":"claude-3-5-sonnet-20240620","content":[{"type":"text","text":"Hello! How can I assist you today? Is there anything specific you'd like to talk about or any questions you have?"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":10,"output_tokens":28}} ```
Author
Owner

@justinh-rahb commented on GitHub (Jul 24, 2024):

Well, I'm truly at a loss then, I've been unable to reproduce this by any easy means, and I don't wish to push the issue too much further for fear of affecting my own access to their API.

<!-- gh-comment-id:2247630999 --> @justinh-rahb commented on GitHub (Jul 24, 2024): Well, I'm truly at a loss then, I've been unable to reproduce this by any easy means, and I don't wish to push the issue too much further for fear of affecting my own access to their API.
Author
Owner

@dannykorpan commented on GitHub (Jul 24, 2024):

If I create a second API key and use it, it works. The first API key, however, functions flawlessly via cURL.

<!-- gh-comment-id:2248021848 --> @dannykorpan commented on GitHub (Jul 24, 2024): If I create a second API key and use it, it works. The first API key, however, functions flawlessly via cURL.
Author
Owner

@justinh-rahb commented on GitHub (Jul 24, 2024):

Strange... is it possible they're using a weird character in your first key that isn't being escaped properly?

<!-- gh-comment-id:2248093795 --> @justinh-rahb commented on GitHub (Jul 24, 2024): Strange... is it possible they're using a weird character in your first key that isn't being escaped properly?
Author
Owner

@dannykorpan commented on GitHub (Jul 25, 2024):

Sometimes it's working with the key and after some time the same key won't work anymore.

<!-- gh-comment-id:2249934236 --> @dannykorpan commented on GitHub (Jul 25, 2024): Sometimes it's working with the key and after some time the same key won't work anymore.
Author
Owner

@realies commented on GitHub (Jul 26, 2024):

I occasionally see the same issue with a working key. Seems reproducible when I restart the pipelines container. If I go into Open WebUI/Pipelines and select the anthropic_manifold_pipeline (manifold), the saved API key loads up. After pressing save without changing anything, it starts working as it should. The mounted appdata folder has the correct file/folder permissions and ownership.

PS: I have to do the same steps for openai_manifold_pipeline (manifold) for OpenAI models to load up and be usable.

<!-- gh-comment-id:2253134986 --> @realies commented on GitHub (Jul 26, 2024): I occasionally see the same issue with a working key. Seems reproducible when I restart the pipelines container. If I go into Open WebUI/Pipelines and select the anthropic_manifold_pipeline (manifold), the saved API key loads up. After pressing save without changing anything, it starts working as it should. The mounted appdata folder has the correct file/folder permissions and ownership. PS: I have to do the same steps for openai_manifold_pipeline (manifold) for OpenAI models to load up and be usable.
Author
Owner

@justinh-rahb commented on GitHub (Jul 26, 2024):

Now there's a clue I can work on. Thanks @realies, I'll see if this new information uncovers anything.

<!-- gh-comment-id:2253360503 --> @justinh-rahb commented on GitHub (Jul 26, 2024): Now there's a clue I can work on. Thanks @realies, I'll see if this new information uncovers anything.
Author
Owner

@Digit404 commented on GitHub (Jul 26, 2024):

I am also experiencing this same error. With curl, the key works fine before I use it with Pipelines, but after I use it in Open WebUI, like a banshee, the key is marked for death (figuratively speaking) and will unceremoniously expire in <24 hours. After this, not even curl can revive the key. I have made dozens of new keys trying to get around this issue and I have not been banned from the API or anything, but my keys are dropping like flies.

This is the error that happens after a key has been cursed:

{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "invalid x-api-key"
  }
}
<!-- gh-comment-id:2253549444 --> @Digit404 commented on GitHub (Jul 26, 2024): I am also experiencing this same error. With curl, the key works fine before I use it with Pipelines, but after I use it in Open WebUI, like a banshee, the key is marked for death (figuratively speaking) and will unceremoniously expire in <24 hours. After this, not even curl can revive the key. I have made dozens of new keys trying to get around this issue and I have not been banned from the API or anything, but my keys are dropping like flies. This is the error that happens after a key has been cursed: ```json { "type": "error", "error": { "type": "authentication_error", "message": "invalid x-api-key" } } ```
Author
Owner

@justinh-rahb commented on GitHub (Jul 26, 2024):

If you're paying customers, have any of you tried contacting Anthropic's support to inquire as to the reason your keys are being revoked?

<!-- gh-comment-id:2253555838 --> @justinh-rahb commented on GitHub (Jul 26, 2024): If you're paying customers, have any of you tried contacting Anthropic's support to inquire as to the reason your keys are being revoked?
Author
Owner

@Digit404 commented on GitHub (Jul 26, 2024):

I have, and Anthropic took the entirety of the month to respond (Thanks, Claude 3.5). Today, they're asking for what the header sent from the app looks like and I don't really know how to find that out.

<!-- gh-comment-id:2253559594 --> @Digit404 commented on GitHub (Jul 26, 2024): I have, and Anthropic took the entirety of the month to respond (Thanks, Claude 3.5). Today, they're asking for what the header sent from the app looks like and I don't really know how to find that out.
Author
Owner

@justinh-rahb commented on GitHub (Jul 26, 2024):

Thanks for the additional datapoint @Digit404. I've no intention of closing this until I figure out what the heck is going on 😅

<!-- gh-comment-id:2253561824 --> @justinh-rahb commented on GitHub (Jul 26, 2024): Thanks for the additional datapoint @Digit404. I've no intention of closing this until I figure out what the heck is going on 😅
Author
Owner

@sriparashiva commented on GitHub (Jul 27, 2024):

While this issue is being looked at, anyone who wants to temporarily bypass this problem can use the following working anthropic pipeline which uses the HTTP API directly and is currently working without any errors (no invalid x-api-key error):

"""
title: Anthropic Manifold HTTP Pipeline
author: sriparashiva
date: 2024-07-27
version: 1.0
license: MIT
description: A pipeline for generating text and processing images using the Anthropic HTTP API.
requirements: requests, sseclient-py
environment_variables: ANTHROPIC_API_KEY
"""

import os

from typing import List, Union, Generator, Iterator
from pydantic import BaseModel
import requests

from utils.pipelines.main import pop_system_message

import requests
import sseclient
from typing import Generator
import json

class Pipeline:
    class Valves(BaseModel):
        ANTHROPIC_API_KEY: str = ""

    def __init__(self):
        self.type = "manifold"
        self.id = "anthropic"
        self.name = "anthropic/"

        self.valves = self.Valves(
            **{"ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY", "your-api-key-here")}
        )
        self.api_key = self.valves.ANTHROPIC_API_KEY
        self.url = 'https://api.anthropic.com/v1/messages'
        self.headers = {
            'anthropic-version': '2023-06-01',
            'content-type': 'application/json',
            'x-api-key': self.api_key
        }

    def get_anthropic_models(self):
        return [
            {"id": "claude-3-haiku-20240307", "name": "claude-3-haiku"},
            {"id": "claude-3-opus-20240229", "name": "claude-3-opus"},
            {"id": "claude-3-sonnet-20240229", "name": "claude-3-sonnet"},
            {"id": "claude-3-5-sonnet-20240620", "name": "claude-3.5-sonnet"},
        ]

    async def on_startup(self):
        print(f"on_startup:{__name__}")
        pass

    async def on_shutdown(self):
        print(f"on_shutdown:{__name__}")
        pass

    async def on_valves_updated(self):
        self.api_key = self.valves.ANTHROPIC_API_KEY
        self.headers = {
                    'anthropic-version': '2023-06-01',
                    'content-type': 'application/json',
                    'x-api-key': self.api_key
                }
        pass

    def pipelines(self) -> List[dict]:
        return self.get_anthropic_models()

    def process_image(self, image_data):
        if image_data["url"].startswith("data:image"):
            mime_type, base64_data = image_data["url"].split(",", 1)
            media_type = mime_type.split(":")[1].split(";")[0]
            return {
                "type": "image",
                "source": {
                    "type": "base64",
                    "media_type": media_type,
                    "data": base64_data,
                },
            }
        else:
            return {
                "type": "image",
                "source": {"type": "url", "url": image_data["url"]},
            }

    def pipe(
        self, user_message: str, model_id: str, messages: List[dict], body: dict
    ) -> Union[str, Generator, Iterator]:
        try:
            # Remove unnecessary keys
            for key in ['user', 'chat_id', 'title']:
                body.pop(key, None)

            system_message, messages = pop_system_message(messages)

            processed_messages = []
            image_count = 0
            total_image_size = 0

            for message in messages:
                processed_content = []
                if isinstance(message.get("content"), list):
                    for item in message["content"]:
                        if item["type"] == "text":
                            processed_content.append({"type": "text", "text": item["text"]})
                        elif item["type"] == "image_url":
                            if image_count >= 5:
                                raise ValueError("Maximum of 5 images per API call exceeded")

                            processed_image = self.process_image(item["image_url"])
                            processed_content.append(processed_image)

                            if processed_image["source"]["type"] == "base64":
                                image_size = len(processed_image["source"]["data"]) * 3 / 4
                            else:
                                image_size = 0

                            total_image_size += image_size
                            if total_image_size > 100 * 1024 * 1024:
                                raise ValueError("Total size of images exceeds 100 MB limit")

                            image_count += 1
                else:
                    processed_content = [{"type": "text", "text": message.get("content", "")}]

                processed_messages.append({"role": message["role"], "content": processed_content})

            # Prepare the payload
            payload = {
                "model": model_id,
                "messages": processed_messages,
                "max_tokens": body.get("max_tokens", 4096),
                "temperature": body.get("temperature", 0.8),
                "top_k": body.get("top_k", 40),
                "top_p": body.get("top_p", 0.9),
                "stop_sequences": body.get("stop", []),
                **({"system": str(system_message)} if system_message else {}),
                "stream": body.get("stream", False),
            }

            if body.get("stream", False):
                return self.stream_response(model_id, payload)
            else:
                return self.get_completion(model_id, payload)
        except Exception as e:
            return f"Error: {e}"

    def stream_response(self, model_id: str, payload: dict) -> Generator:
        response = requests.post(self.url, headers=self.headers, json=payload, stream=True)

        if response.status_code == 200:
            client = sseclient.SSEClient(response)
            for event in client.events():
                event_data = event.data
                try:
                    event_json = json.loads(event_data)
                    if event_json['type'] == "content_block_start":
                        yield event_json['content_block']['text']
                    elif event_json['type'] == "content_block_delta":
                        yield event_json['delta']['text']
                except ValueError:
                    # Handle any JSON decoding errors if necessary
                    print(f"Unable to decode JSON: {event_data}")
                    raise ValueError
        else:
            raise Exception(f"Error: {response.status_code} - {response.text}")

    def get_completion(self, model_id: str, payload: dict) -> str:
        response = requests.post(self.url, headers=self.headers, json=payload)
        if response.status_code == 200:
            response_json = response.json()
            # Assuming we're interested in the first text content block.
            return response_json['content'][0]['text']
        else:
            raise Exception(f"Error: {response.status_code} - {response.text}")
<!-- gh-comment-id:2254120609 --> @sriparashiva commented on GitHub (Jul 27, 2024): While this issue is being looked at, anyone who wants to temporarily bypass this problem can use the following working anthropic pipeline which uses the HTTP API directly and is currently working without any errors (no invalid x-api-key error): ``` """ title: Anthropic Manifold HTTP Pipeline author: sriparashiva date: 2024-07-27 version: 1.0 license: MIT description: A pipeline for generating text and processing images using the Anthropic HTTP API. requirements: requests, sseclient-py environment_variables: ANTHROPIC_API_KEY """ import os from typing import List, Union, Generator, Iterator from pydantic import BaseModel import requests from utils.pipelines.main import pop_system_message import requests import sseclient from typing import Generator import json class Pipeline: class Valves(BaseModel): ANTHROPIC_API_KEY: str = "" def __init__(self): self.type = "manifold" self.id = "anthropic" self.name = "anthropic/" self.valves = self.Valves( **{"ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY", "your-api-key-here")} ) self.api_key = self.valves.ANTHROPIC_API_KEY self.url = 'https://api.anthropic.com/v1/messages' self.headers = { 'anthropic-version': '2023-06-01', 'content-type': 'application/json', 'x-api-key': self.api_key } def get_anthropic_models(self): return [ {"id": "claude-3-haiku-20240307", "name": "claude-3-haiku"}, {"id": "claude-3-opus-20240229", "name": "claude-3-opus"}, {"id": "claude-3-sonnet-20240229", "name": "claude-3-sonnet"}, {"id": "claude-3-5-sonnet-20240620", "name": "claude-3.5-sonnet"}, ] async def on_startup(self): print(f"on_startup:{__name__}") pass async def on_shutdown(self): print(f"on_shutdown:{__name__}") pass async def on_valves_updated(self): self.api_key = self.valves.ANTHROPIC_API_KEY self.headers = { 'anthropic-version': '2023-06-01', 'content-type': 'application/json', 'x-api-key': self.api_key } pass def pipelines(self) -> List[dict]: return self.get_anthropic_models() def process_image(self, image_data): if image_data["url"].startswith("data:image"): mime_type, base64_data = image_data["url"].split(",", 1) media_type = mime_type.split(":")[1].split(";")[0] return { "type": "image", "source": { "type": "base64", "media_type": media_type, "data": base64_data, }, } else: return { "type": "image", "source": {"type": "url", "url": image_data["url"]}, } def pipe( self, user_message: str, model_id: str, messages: List[dict], body: dict ) -> Union[str, Generator, Iterator]: try: # Remove unnecessary keys for key in ['user', 'chat_id', 'title']: body.pop(key, None) system_message, messages = pop_system_message(messages) processed_messages = [] image_count = 0 total_image_size = 0 for message in messages: processed_content = [] if isinstance(message.get("content"), list): for item in message["content"]: if item["type"] == "text": processed_content.append({"type": "text", "text": item["text"]}) elif item["type"] == "image_url": if image_count >= 5: raise ValueError("Maximum of 5 images per API call exceeded") processed_image = self.process_image(item["image_url"]) processed_content.append(processed_image) if processed_image["source"]["type"] == "base64": image_size = len(processed_image["source"]["data"]) * 3 / 4 else: image_size = 0 total_image_size += image_size if total_image_size > 100 * 1024 * 1024: raise ValueError("Total size of images exceeds 100 MB limit") image_count += 1 else: processed_content = [{"type": "text", "text": message.get("content", "")}] processed_messages.append({"role": message["role"], "content": processed_content}) # Prepare the payload payload = { "model": model_id, "messages": processed_messages, "max_tokens": body.get("max_tokens", 4096), "temperature": body.get("temperature", 0.8), "top_k": body.get("top_k", 40), "top_p": body.get("top_p", 0.9), "stop_sequences": body.get("stop", []), **({"system": str(system_message)} if system_message else {}), "stream": body.get("stream", False), } if body.get("stream", False): return self.stream_response(model_id, payload) else: return self.get_completion(model_id, payload) except Exception as e: return f"Error: {e}" def stream_response(self, model_id: str, payload: dict) -> Generator: response = requests.post(self.url, headers=self.headers, json=payload, stream=True) if response.status_code == 200: client = sseclient.SSEClient(response) for event in client.events(): event_data = event.data try: event_json = json.loads(event_data) if event_json['type'] == "content_block_start": yield event_json['content_block']['text'] elif event_json['type'] == "content_block_delta": yield event_json['delta']['text'] except ValueError: # Handle any JSON decoding errors if necessary print(f"Unable to decode JSON: {event_data}") raise ValueError else: raise Exception(f"Error: {response.status_code} - {response.text}") def get_completion(self, model_id: str, payload: dict) -> str: response = requests.post(self.url, headers=self.headers, json=payload) if response.status_code == 200: response_json = response.json() # Assuming we're interested in the first text content block. return response_json['content'][0]['text'] else: raise Exception(f"Error: {response.status_code} - {response.text}") ```
Author
Owner

@justinh-rahb commented on GitHub (Jul 27, 2024):

@sriparashiva ironically that's exactly what I was planning to do to "resolve" this if I had to, since using requests has been working just fine on my Function version of this: https://openwebui.com/f/justinrahb/anthropic

<!-- gh-comment-id:2254170915 --> @justinh-rahb commented on GitHub (Jul 27, 2024): @sriparashiva ironically that's exactly what I was planning to do to "resolve" this if I had to, since using `requests` has been working just fine on my Function version of this: https://openwebui.com/f/justinrahb/anthropic
Author
Owner

@dannykorpan commented on GitHub (Jul 29, 2024):

While this issue is being looked at, anyone who wants to temporarily bypass this problem can use the following working anthropic pipeline which uses the HTTP API directly and is currently working without any errors (no invalid x-api-key error.

Hi, thank you. I have downloaded your script and uploaded it through the OpenWebUI interface. Afterwards, the file is immediately moved to the "failed" subfolder within the pipeline folder. In the pipeline docker Logs, I see the following:

WARNING:root:No Pipeline class found in Anthropic
Error loading module: Anthropic
No module named 'sseclient'
<!-- gh-comment-id:2255057314 --> @dannykorpan commented on GitHub (Jul 29, 2024): > While this issue is being looked at, anyone who wants to temporarily bypass this problem can use the following working anthropic pipeline which uses the HTTP API directly and is currently working without any errors (no invalid x-api-key error. Hi, thank you. I have downloaded your script and uploaded it through the OpenWebUI interface. Afterwards, the file is immediately moved to the "failed" subfolder within the pipeline folder. In the pipeline docker Logs, I see the following: ``` WARNING:root:No Pipeline class found in Anthropic Error loading module: Anthropic No module named 'sseclient' ```
Author
Owner

@sriparashiva commented on GitHub (Jul 29, 2024):

@dannykorpan Since the pipeline has an additional dependency sseclient, you need to install it manually on the pipelines python environment. This currently needs to be done manually (I couldn't find any existing documentation showing how to have the dependencies of a custom pipeline auto-installed).

I am using a Docker setup for pipelines, so I just executed the command pip3 install sseclient-py inside the pipelines docker container. That should make it work.

Or alternatively, you can use the code snippet from @justinh-rahb's linked custom function which does not use any external dependencies.

<!-- gh-comment-id:2255066008 --> @sriparashiva commented on GitHub (Jul 29, 2024): @dannykorpan Since the pipeline has an additional dependency `sseclient`, you need to install it manually on the pipelines python environment. This currently needs to be done manually (I couldn't find any existing documentation showing how to have the dependencies of a custom pipeline auto-installed). I am using a Docker setup for pipelines, so I just executed the command `pip3 install sseclient-py` inside the pipelines docker container. That should make it work. Or alternatively, you can use the code snippet from @justinh-rahb's linked custom function which does not use any external dependencies.
Author
Owner

@dannykorpan commented on GitHub (Jul 29, 2024):

@dannykorpan Since the pipeline has an additional dependency sseclient, you need to install it manually on the pipelines python environment. This currently needs to be done manually (I couldn't find any existing documentation showing how to have the dependencies of a custom pipeline auto-installed).

I am using a Docker setup for pipelines, so I just executed the command pip3 install sseclient-py inside the pipelines docker container. That should make it work.

Or alternatively, you can use the code snippet from @justinh-rahb's linked custom function which does not use any external dependencies.

Your workaround works :-) Thank you!

<!-- gh-comment-id:2255072897 --> @dannykorpan commented on GitHub (Jul 29, 2024): > @dannykorpan Since the pipeline has an additional dependency `sseclient`, you need to install it manually on the pipelines python environment. This currently needs to be done manually (I couldn't find any existing documentation showing how to have the dependencies of a custom pipeline auto-installed). > > I am using a Docker setup for pipelines, so I just executed the command `pip3 install sseclient-py` inside the pipelines docker container. That should make it work. > > Or alternatively, you can use the code snippet from @justinh-rahb's linked custom function which does not use any external dependencies. Your workaround works :-) Thank you!
Author
Owner

@justinh-rahb commented on GitHub (Jul 30, 2024):

@dannykorpan @Digit404 @sriparashiva please give this PR a try:

If you install it by putting the raw URL into your PIPELINES_URLS environment variable, the server will pull it and install dependency sseclient-py automatically on startup:

https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py
<!-- gh-comment-id:2258323865 --> @justinh-rahb commented on GitHub (Jul 30, 2024): @dannykorpan @Digit404 @sriparashiva please give this PR a try: - #179 If you install it by putting the raw URL into your `PIPELINES_URLS` environment variable, the server will pull it and install dependency `sseclient-py` automatically on startup: ``` https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py ```
Author
Owner

@dannykorpan commented on GitHub (Jul 30, 2024):

Thank you, but still get the following error after importing into pipelines:

WARNING:root:No Pipeline class found in anthropic_manifold_pipeline
https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py
Error loading module: anthropic_manifold_pipeline
No module named 'sseclient'
<!-- gh-comment-id:2258841344 --> @dannykorpan commented on GitHub (Jul 30, 2024): Thank you, but still get the following error after importing into pipelines: ``` WARNING:root:No Pipeline class found in anthropic_manifold_pipeline https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py Error loading module: anthropic_manifold_pipeline No module named 'sseclient' ```
Author
Owner

@justinh-rahb commented on GitHub (Jul 30, 2024):

Thank you, but still get the following error after importing into pipelines:

WARNING:root:No Pipeline class found in anthropic_manifold_pipeline
https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py
Error loading module: anthropic_manifold_pipeline
No module named 'sseclient'

@dannykorpan as noted, the dependency only installs on server startup if it is already in the pipelines/ dir or you've added the URL to PIPELINES_URLS, if you attempt to upload the pipeline from Admin Settings > Pipelines, you'll get such an error.

Screenshot 2024-07-30 at 1 26 10 PM

<!-- gh-comment-id:2258847434 --> @justinh-rahb commented on GitHub (Jul 30, 2024): > Thank you, but still get the following error after importing into pipelines: > > ``` > WARNING:root:No Pipeline class found in anthropic_manifold_pipeline > https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py > Error loading module: anthropic_manifold_pipeline > No module named 'sseclient' > ``` @dannykorpan as noted, the dependency only installs on server startup if it is already in the `pipelines/` dir or you've added the URL to `PIPELINES_URLS`, if you attempt to upload the pipeline from **Admin Settings > Pipelines**, you'll get such an error. ![Screenshot 2024-07-30 at 1 26 10 PM](https://github.com/user-attachments/assets/cf23f2fd-43c3-4ba7-b830-760d8cc72e54)
Author
Owner

@dannykorpan commented on GitHub (Jul 30, 2024):

Thank you, but I think it represents a potential source of error.

If I restart the server, the sseclient module still won't be installed automatically. I always have to install it manually, even after a restart. Or am I misunderstanding something?

<!-- gh-comment-id:2258855766 --> @dannykorpan commented on GitHub (Jul 30, 2024): Thank you, but I think it represents a potential source of error. If I restart the server, the sseclient module still won't be installed automatically. I always have to install it manually, even after a restart. Or am I misunderstanding something?
Author
Owner

@justinh-rahb commented on GitHub (Jul 30, 2024):

You are misunderstanding something, yes. The frontmatter at the top of the file specifies what depends it uses:

requirements: requests, sseclient-py

When the server is started (or restarted) with start.sh, it loops through all of the installed pipelines and will pip install their requirements:
github.com/open-webui/pipelines@cd6c092a53/start.sh (L85-L105)

<!-- gh-comment-id:2258866844 --> @justinh-rahb commented on GitHub (Jul 30, 2024): You are misunderstanding something, yes. The frontmatter at the top of the file specifies what depends it uses: > ```python > requirements: requests, sseclient-py > ``` When the server is started (or restarted) with `start.sh`, it loops through all of the installed pipelines and will `pip install` their requirements: https://github.com/open-webui/pipelines/blob/cd6c092a531f886810f2789066a628907e1d2478/start.sh#L85-L105
Author
Owner

@dannykorpan commented on GitHub (Jul 30, 2024):

But I start the pipelines server via docker.

<!-- gh-comment-id:2258871102 --> @dannykorpan commented on GitHub (Jul 30, 2024): But I start the pipelines server via docker.
Author
Owner

@justinh-rahb commented on GitHub (Jul 30, 2024):

But I start the pipelines server via docker.

Two options:

Bind mount the pipelines volume:

docker run -d \
  -p 9099:9099 \
  --add-host=host.docker.internal:host-gateway \
  -v /home/your-username/pipelines:/app/pipelines \
  --name pipelines \
  --restart always \
  ghcr.io/open-webui/pipelines:main

You can then drop the anthropic_manifold_pipeline.py file in the pipelines dir, restart the container, and it should install.

Alternatively, use the PIPELINES_URLS environment variable:

docker run -d \
  -p 9099:9099 \
  --add-host=host.docker.internal:host-gateway \
  -v pipelines:/app/pipelines \
  -e PIPELINES_URLS="github_raw_urls;separated_by_semicolons"
  --name pipelines \
  --restart always \
  ghcr.io/open-webui/pipelines:main

This should install the depends immediately after downloading the pipeline when the container starts.

<!-- gh-comment-id:2258879572 --> @justinh-rahb commented on GitHub (Jul 30, 2024): > But I start the pipelines server via docker. #### Two options: **Bind mount the `pipelines` volume:** ```sh docker run -d \ -p 9099:9099 \ --add-host=host.docker.internal:host-gateway \ -v /home/your-username/pipelines:/app/pipelines \ --name pipelines \ --restart always \ ghcr.io/open-webui/pipelines:main ``` You can then drop the `anthropic_manifold_pipeline.py` file in the `pipelines` dir, restart the container, and it should install. **Alternatively, use the `PIPELINES_URLS` environment variable:** ```sh docker run -d \ -p 9099:9099 \ --add-host=host.docker.internal:host-gateway \ -v pipelines:/app/pipelines \ -e PIPELINES_URLS="github_raw_urls;separated_by_semicolons" --name pipelines \ --restart always \ ghcr.io/open-webui/pipelines:main ``` This should install the depends immediately after downloading the pipeline when the container starts.
Author
Owner

@dannykorpan commented on GitHub (Jul 31, 2024):

Works, thank you!

<!-- gh-comment-id:2259856273 --> @dannykorpan commented on GitHub (Jul 31, 2024): Works, thank you!
Author
Owner

@Digit404 commented on GitHub (Jul 31, 2024):

After installing the new pipeline, it's been a while and my key still works. Thanks for the fix!

<!-- gh-comment-id:2260968088 --> @Digit404 commented on GitHub (Jul 31, 2024): After installing the new pipeline, it's been a while and my key still works. Thanks for the fix!
Author
Owner

@realies commented on GitHub (Aug 3, 2024):

@justinh-rahb, for some reason I still have to re-submit API keys for each pipeline for the service to continue to work after a restart; this is the compose file:

$ cat docker-compose.yml
services:
  pipelines:
    image: ghcr.io/open-webui/pipelines:main
    container_name: pipelines
    volumes:
      - ./data:/app/pipelines
    environment:
      - PIPELINES_URLS=https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/anthropic_manifold_pipeline.py;https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/openai_manifold_pipeline.py;https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/ollama_manifold_pipeline.py
    restart: unless-stopped

here's a log of starting the container, trying to use anthropic and failing to do so because

pipelines  | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}

going to the settings page for anthropic_manifold_pipeline and pressing save can be seen to fix it further down the logs

any idea why this is happening?

realies@rpi-1:~/compose/pipelines $ docker compose up -d && docker compose logs -f
[+] Running 1/1
 ✔ Container pipelines  Started                                                                                                                                                                  0.4s
pipelines  | RESET_PIPELINES_DIR is not set to true. No action taken.
pipelines  | PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements.
pipelines  | Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/anthropic_manifold_pipeline.py to ./pipelines...
pipelines  |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
pipelines  |                                  Dload  Upload   Total   Spent    Left  Speed
100  6523  100  6523    0     0  36722      0 --:--:-- --:--:-- --:--:-- 36853
pipelines  | Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/openai_manifold_pipeline.py to ./pipelines...
pipelines  |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
pipelines  |                                  Dload  Upload   Total   Spent    Left  Speed
100  3917  100  3917    0     0  36027      0 --:--:-- --:--:-- --:--:-- 36268
pipelines  | Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/ollama_manifold_pipeline.py to ./pipelines...
pipelines  |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
pipelines  |                                  Dload  Upload   Total   Spent    Left  Speed
100  3488  100  3488    0     0  28807      0 --:--:-- --:--:-- --:--:-- 29066
pipelines  | pip install requests  sseclient-py
pipelines  | Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (2.32.2)
pipelines  | Collecting sseclient-py
pipelines  |   Downloading sseclient_py-1.8.0-py2.py3-none-any.whl.metadata (2.0 kB)
pipelines  | Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests) (3.3.2)
pipelines  | Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests) (3.7)
pipelines  | Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests) (2.2.2)
pipelines  | Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests) (2024.7.4)
pipelines  | Downloading sseclient_py-1.8.0-py2.py3-none-any.whl (8.8 kB)
pipelines  | Installing collected packages: sseclient-py
pipelines  | Successfully installed sseclient-py-1.8.0
pipelines  | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
pipelines  |
pipelines  | [notice] A new release of pip is available: 24.0 -> 24.2
pipelines  | [notice] To update, run: pip install --upgrade pip
pipelines  | No requirements found in frontmatter of ./pipelines/ollama_manifold_pipeline.py.
pipelines  | No requirements found in frontmatter of ./pipelines/openai_manifold_pipeline.py.
pipelines  | INFO:     Started server process [55]
pipelines  | INFO:     Waiting for application startup.
pipelines  | INFO:     Application startup complete.
pipelines  | INFO:     Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit)
pipelines  | Loaded module: anthropic_manifold_pipeline
pipelines  | Loaded module: openai_manifold_pipeline
pipelines  | Error: 'data'
pipelines  | Loaded module: ollama_manifold_pipeline
pipelines  | on_startup:anthropic_manifold_pipeline
pipelines  | on_startup:openai_manifold_pipeline
pipelines  | on_startup:ollama_manifold_pipeline
pipelines  | INFO:     172.18.0.9:38112 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:55694 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | INFO:     172.18.0.9:55706 - "POST /chat/completions HTTP/1.1" 200 OK
pipelines  | ERROR:    Exception in ASGI application
pipelines  |   + Exception Group Traceback (most recent call last):
pipelines  |   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__
pipelines  |   |     await response(scope, wrapped_receive, send)
pipelines  |   |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
pipelines  |   |     async with anyio.create_task_group() as task_group:
pipelines  |   |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
pipelines  |   |     raise BaseExceptionGroup(
pipelines  |   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
pipelines  |   +-+---------------- 1 ----------------
pipelines  |     | Exception Group Traceback (most recent call last):
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
pipelines  |     |     await func()
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
pipelines  |     |     return await super().stream_response(send)
pipelines  |     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
pipelines  |     |     async for chunk in self.body_iterator:
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
pipelines  |     |     raise app_exc
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
pipelines  |     |     await self.app(scope, receive_or_disconnect, send_no_error)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
pipelines  |     |     await self.app(scope, receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
pipelines  |     |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
pipelines  |     |     raise exc
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
pipelines  |     |     await app(scope, receive, sender)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
pipelines  |     |     await self.middleware_stack(scope, receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
pipelines  |     |     await route.handle(scope, receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
pipelines  |     |     await self.app(scope, receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
pipelines  |     |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
pipelines  |     |     raise exc
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
pipelines  |     |     await app(scope, receive, sender)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
pipelines  |     |     await response(scope, receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
pipelines  |     |     async with anyio.create_task_group() as task_group:
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
pipelines  |     |     raise BaseExceptionGroup(
pipelines  |     | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
pipelines  |     +-+---------------- 1 ----------------
pipelines  |       | Traceback (most recent call last):
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
pipelines  |       |     result = await app(  # type: ignore[func-returns-value]
pipelines  |       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
pipelines  |       |     return await self.app(scope, receive, send)
pipelines  |       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
pipelines  |       |     await super().__call__(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
pipelines  |       |     await self.middleware_stack(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
pipelines  |       |     raise exc
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
pipelines  |       |     await self.app(scope, receive, _send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
pipelines  |       |     with collapse_excgroups():
pipelines  |       |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
pipelines  |       |     self.gen.throw(typ, value, traceback)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
pipelines  |       |     raise exc
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
pipelines  |       |     await func()
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
pipelines  |       |     async for chunk in self.body_iterator:
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
pipelines  |       |     yield await anyio.to_thread.run_sync(_next, as_iterator)
pipelines  |       |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
pipelines  |       |     return await get_async_backend().run_sync_in_worker_thread(
pipelines  |       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
pipelines  |       |     return await future
pipelines  |       |            ^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
pipelines  |       |     result = context.run(func, *args)
pipelines  |       |              ^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
pipelines  |       |     return next(iterator)
pipelines  |       |            ^^^^^^^^^^^^^^
pipelines  |       |   File "/app/main.py", line 665, in stream_content
pipelines  |       |     for line in res:
pipelines  |       |   File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response
pipelines  |       |     raise Exception(f"Error: {response.status_code} - {response.text}")
pipelines  |       | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
pipelines  |       +------------------------------------
pipelines  |
pipelines  | During handling of the above exception, another exception occurred:
pipelines  |
pipelines  |   + Exception Group Traceback (most recent call last):
pipelines  |   |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
pipelines  |   |     yield
pipelines  |   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__
pipelines  |   |     async with anyio.create_task_group() as task_group:
pipelines  |   |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
pipelines  |   |     raise BaseExceptionGroup(
pipelines  |   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
pipelines  |   +-+---------------- 1 ----------------
pipelines  |     | Traceback (most recent call last):
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__
pipelines  |     |     await wrap(partial(self.listen_for_disconnect, receive))
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
pipelines  |     |     await func()
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect
pipelines  |     |     message = await receive()
pipelines  |     |               ^^^^^^^^^^^^^^^
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive
pipelines  |     |     msg = await self.receive()
pipelines  |     |           ^^^^^^^^^^^^^^^^^^^^
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive
pipelines  |     |     await self.message_event.wait()
pipelines  |     |   File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait
pipelines  |     |     await fut
pipelines  |     | asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f957d9cd0
pipelines  |     |
pipelines  |     | During handling of the above exception, another exception occurred:
pipelines  |     |
pipelines  |     | Exception Group Traceback (most recent call last):
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__
pipelines  |     |     await response(scope, wrapped_receive, send)
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
pipelines  |     |     async with anyio.create_task_group() as task_group:
pipelines  |     |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
pipelines  |     |     raise BaseExceptionGroup(
pipelines  |     | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
pipelines  |     +-+---------------- 1 ----------------
pipelines  |       | Traceback (most recent call last):
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__
pipelines  |       |     await wrap(partial(self.listen_for_disconnect, receive))
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
pipelines  |       |     await func()
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect
pipelines  |       |     message = await receive()
pipelines  |       |               ^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 128, in receive_or_disconnect
pipelines  |       |     message = await wrap(wrapped_receive)
pipelines  |       |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 123, in wrap
pipelines  |       |     result = await func()
pipelines  |       |              ^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive
pipelines  |       |     msg = await self.receive()
pipelines  |       |           ^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive
pipelines  |       |     await self.message_event.wait()
pipelines  |       |   File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait
pipelines  |       |     await fut
pipelines  |       | asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f957eeed0
pipelines  |       |
pipelines  |       | During handling of the above exception, another exception occurred:
pipelines  |       |
pipelines  |       | Exception Group Traceback (most recent call last):
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
pipelines  |       |     await func()
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
pipelines  |       |     return await super().stream_response(send)
pipelines  |       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
pipelines  |       |     async for chunk in self.body_iterator:
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
pipelines  |       |     raise app_exc
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
pipelines  |       |     await self.app(scope, receive_or_disconnect, send_no_error)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
pipelines  |       |     await self.app(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
pipelines  |       |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
pipelines  |       |     raise exc
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
pipelines  |       |     await app(scope, receive, sender)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
pipelines  |       |     await self.middleware_stack(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
pipelines  |       |     await route.handle(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
pipelines  |       |     await self.app(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
pipelines  |       |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
pipelines  |       |     raise exc
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
pipelines  |       |     await app(scope, receive, sender)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
pipelines  |       |     await response(scope, receive, send)
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
pipelines  |       |     async with anyio.create_task_group() as task_group:
pipelines  |       |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
pipelines  |       |     raise BaseExceptionGroup(
pipelines  |       | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
pipelines  |       +-+---------------- 1 ----------------
pipelines  |         | Traceback (most recent call last):
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
pipelines  |         |     result = await app(  # type: ignore[func-returns-value]
pipelines  |         |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
pipelines  |         |     return await self.app(scope, receive, send)
pipelines  |         |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
pipelines  |         |     await super().__call__(scope, receive, send)
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
pipelines  |         |     await self.middleware_stack(scope, receive, send)
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
pipelines  |         |     raise exc
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
pipelines  |         |     await self.app(scope, receive, _send)
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
pipelines  |         |     with collapse_excgroups():
pipelines  |         |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
pipelines  |         |     self.gen.throw(typ, value, traceback)
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
pipelines  |         |     raise exc
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
pipelines  |         |     await func()
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
pipelines  |         |     async for chunk in self.body_iterator:
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
pipelines  |         |     yield await anyio.to_thread.run_sync(_next, as_iterator)
pipelines  |         |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
pipelines  |         |     return await get_async_backend().run_sync_in_worker_thread(
pipelines  |         |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
pipelines  |         |     return await future
pipelines  |         |            ^^^^^^^^^^^^
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
pipelines  |         |     result = context.run(func, *args)
pipelines  |         |              ^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |         |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
pipelines  |         |     return next(iterator)
pipelines  |         |            ^^^^^^^^^^^^^^
pipelines  |         |   File "/app/main.py", line 665, in stream_content
pipelines  |         |     for line in res:
pipelines  |         |   File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response
pipelines  |         |     raise Exception(f"Error: {response.status_code} - {response.text}")
pipelines  |         | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
pipelines  |         +------------------------------------
pipelines  |
pipelines  | During handling of the above exception, another exception occurred:
pipelines  |
pipelines  | Traceback (most recent call last):
pipelines  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
pipelines  |     result = await app(  # type: ignore[func-returns-value]
pipelines  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
pipelines  |     return await self.app(scope, receive, send)
pipelines  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
pipelines  |     await super().__call__(scope, receive, send)
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
pipelines  |     await self.middleware_stack(scope, receive, send)
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
pipelines  |     raise exc
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
pipelines  |     await self.app(scope, receive, _send)
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
pipelines  |     with collapse_excgroups():
pipelines  |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
pipelines  |     self.gen.throw(typ, value, traceback)
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
pipelines  |     raise exc
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
pipelines  |     await func()
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
pipelines  |     async for chunk in self.body_iterator:
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
pipelines  |     yield await anyio.to_thread.run_sync(_next, as_iterator)
pipelines  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |   File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
pipelines  |     return await get_async_backend().run_sync_in_worker_thread(
pipelines  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
pipelines  |     return await future
pipelines  |            ^^^^^^^^^^^^
pipelines  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
pipelines  |     result = context.run(func, *args)
pipelines  |              ^^^^^^^^^^^^^^^^^^^^^^^^
pipelines  |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
pipelines  |     return next(iterator)
pipelines  |            ^^^^^^^^^^^^^^
pipelines  |   File "/app/main.py", line 665, in stream_content
pipelines  |     for line in res:
pipelines  |   File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response
pipelines  |     raise Exception(f"Error: {response.status_code} - {response.text}")
pipelines  | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
pipelines  | INFO:     172.18.0.9:55708 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | INFO:     172.18.0.9:55724 - "POST /chat/completions HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35642 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35654 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35664 - "GET /pipelines HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35668 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35672 - "GET /anthropic/valves/spec HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35686 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35700 - "GET /anthropic/valves HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35714 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35716 - "POST /anthropic/valves/update HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35724 - "GET /pipelines HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35738 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35754 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35760 - "GET /anthropic/valves/spec HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35764 - "GET /models HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:35774 - "GET /anthropic/valves HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:43800 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | INFO:     172.18.0.9:43812 - "POST /chat/completions HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:43826 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/outlet HTTP/1.1" 200 OK
pipelines  | INFO:     172.18.0.9:43842 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | anthropic.claude-3-5-sonnet-20240620
pipelines  | INFO:     172.18.0.9:43844 - "POST /chat/completions HTTP/1.1" 200 OK
^Ccanceled
<!-- gh-comment-id:2267097608 --> @realies commented on GitHub (Aug 3, 2024): @justinh-rahb, for some reason I still have to re-submit API keys for each pipeline for the service to continue to work after a restart; this is the compose file: ``` $ cat docker-compose.yml services: pipelines: image: ghcr.io/open-webui/pipelines:main container_name: pipelines volumes: - ./data:/app/pipelines environment: - PIPELINES_URLS=https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/anthropic_manifold_pipeline.py;https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/openai_manifold_pipeline.py;https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/ollama_manifold_pipeline.py restart: unless-stopped ``` here's a log of starting the container, trying to use anthropic and failing to do so because ``` pipelines | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} ``` going to the settings page for anthropic_manifold_pipeline and pressing save can be seen to fix it further down the logs any idea why this is happening? ``` realies@rpi-1:~/compose/pipelines $ docker compose up -d && docker compose logs -f [+] Running 1/1 ✔ Container pipelines Started 0.4s pipelines | RESET_PIPELINES_DIR is not set to true. No action taken. pipelines | PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements. pipelines | Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/anthropic_manifold_pipeline.py to ./pipelines... pipelines | % Total % Received % Xferd Average Speed Time Time Time Current pipelines | Dload Upload Total Spent Left Speed 100 6523 100 6523 0 0 36722 0 --:--:-- --:--:-- --:--:-- 36853 pipelines | Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/openai_manifold_pipeline.py to ./pipelines... pipelines | % Total % Received % Xferd Average Speed Time Time Time Current pipelines | Dload Upload Total Spent Left Speed 100 3917 100 3917 0 0 36027 0 --:--:-- --:--:-- --:--:-- 36268 pipelines | Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/ollama_manifold_pipeline.py to ./pipelines... pipelines | % Total % Received % Xferd Average Speed Time Time Time Current pipelines | Dload Upload Total Spent Left Speed 100 3488 100 3488 0 0 28807 0 --:--:-- --:--:-- --:--:-- 29066 pipelines | pip install requests sseclient-py pipelines | Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (2.32.2) pipelines | Collecting sseclient-py pipelines | Downloading sseclient_py-1.8.0-py2.py3-none-any.whl.metadata (2.0 kB) pipelines | Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests) (3.3.2) pipelines | Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests) (3.7) pipelines | Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests) (2.2.2) pipelines | Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests) (2024.7.4) pipelines | Downloading sseclient_py-1.8.0-py2.py3-none-any.whl (8.8 kB) pipelines | Installing collected packages: sseclient-py pipelines | Successfully installed sseclient-py-1.8.0 pipelines | WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv pipelines | pipelines | [notice] A new release of pip is available: 24.0 -> 24.2 pipelines | [notice] To update, run: pip install --upgrade pip pipelines | No requirements found in frontmatter of ./pipelines/ollama_manifold_pipeline.py. pipelines | No requirements found in frontmatter of ./pipelines/openai_manifold_pipeline.py. pipelines | INFO: Started server process [55] pipelines | INFO: Waiting for application startup. pipelines | INFO: Application startup complete. pipelines | INFO: Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit) pipelines | Loaded module: anthropic_manifold_pipeline pipelines | Loaded module: openai_manifold_pipeline pipelines | Error: 'data' pipelines | Loaded module: ollama_manifold_pipeline pipelines | on_startup:anthropic_manifold_pipeline pipelines | on_startup:openai_manifold_pipeline pipelines | on_startup:ollama_manifold_pipeline pipelines | INFO: 172.18.0.9:38112 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:55694 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | INFO: 172.18.0.9:55706 - "POST /chat/completions HTTP/1.1" 200 OK pipelines | ERROR: Exception in ASGI application pipelines | + Exception Group Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__ pipelines | | await response(scope, wrapped_receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ pipelines | | async with anyio.create_task_group() as task_group: pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ pipelines | | raise BaseExceptionGroup( pipelines | | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) pipelines | +-+---------------- 1 ---------------- pipelines | | Exception Group Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap pipelines | | await func() pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response pipelines | | return await super().stream_response(send) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response pipelines | | async for chunk in self.body_iterator: pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream pipelines | | raise app_exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro pipelines | | await self.app(scope, receive_or_disconnect, send_no_error) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__ pipelines | | await self.app(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ pipelines | | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app pipelines | | await app(scope, receive, sender) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ pipelines | | await self.middleware_stack(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app pipelines | | await route.handle(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle pipelines | | await self.app(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app pipelines | | await wrap_app_handling_exceptions(app, request)(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app pipelines | | await app(scope, receive, sender) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app pipelines | | await response(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ pipelines | | async with anyio.create_task_group() as task_group: pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ pipelines | | raise BaseExceptionGroup( pipelines | | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) pipelines | +-+---------------- 1 ---------------- pipelines | | Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi pipelines | | result = await app( # type: ignore[func-returns-value] pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ pipelines | | return await self.app(scope, receive, send) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ pipelines | | await super().__call__(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ pipelines | | await self.middleware_stack(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ pipelines | | await self.app(scope, receive, _send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ pipelines | | with collapse_excgroups(): pipelines | | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ pipelines | | self.gen.throw(typ, value, traceback) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap pipelines | | await func() pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response pipelines | | async for chunk in self.body_iterator: pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool pipelines | | yield await anyio.to_thread.run_sync(_next, as_iterator) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync pipelines | | return await get_async_backend().run_sync_in_worker_thread( pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread pipelines | | return await future pipelines | | ^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run pipelines | | result = context.run(func, *args) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next pipelines | | return next(iterator) pipelines | | ^^^^^^^^^^^^^^ pipelines | | File "/app/main.py", line 665, in stream_content pipelines | | for line in res: pipelines | | File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response pipelines | | raise Exception(f"Error: {response.status_code} - {response.text}") pipelines | | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} pipelines | +------------------------------------ pipelines | pipelines | During handling of the above exception, another exception occurred: pipelines | pipelines | + Exception Group Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups pipelines | | yield pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__ pipelines | | async with anyio.create_task_group() as task_group: pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ pipelines | | raise BaseExceptionGroup( pipelines | | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) pipelines | +-+---------------- 1 ---------------- pipelines | | Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__ pipelines | | await wrap(partial(self.listen_for_disconnect, receive)) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap pipelines | | await func() pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect pipelines | | message = await receive() pipelines | | ^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive pipelines | | msg = await self.receive() pipelines | | ^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive pipelines | | await self.message_event.wait() pipelines | | File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait pipelines | | await fut pipelines | | asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f957d9cd0 pipelines | | pipelines | | During handling of the above exception, another exception occurred: pipelines | | pipelines | | Exception Group Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__ pipelines | | await response(scope, wrapped_receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ pipelines | | async with anyio.create_task_group() as task_group: pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ pipelines | | raise BaseExceptionGroup( pipelines | | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) pipelines | +-+---------------- 1 ---------------- pipelines | | Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__ pipelines | | await wrap(partial(self.listen_for_disconnect, receive)) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap pipelines | | await func() pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect pipelines | | message = await receive() pipelines | | ^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 128, in receive_or_disconnect pipelines | | message = await wrap(wrapped_receive) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 123, in wrap pipelines | | result = await func() pipelines | | ^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive pipelines | | msg = await self.receive() pipelines | | ^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive pipelines | | await self.message_event.wait() pipelines | | File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait pipelines | | await fut pipelines | | asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f957eeed0 pipelines | | pipelines | | During handling of the above exception, another exception occurred: pipelines | | pipelines | | Exception Group Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap pipelines | | await func() pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response pipelines | | return await super().stream_response(send) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response pipelines | | async for chunk in self.body_iterator: pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream pipelines | | raise app_exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro pipelines | | await self.app(scope, receive_or_disconnect, send_no_error) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__ pipelines | | await self.app(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ pipelines | | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app pipelines | | await app(scope, receive, sender) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ pipelines | | await self.middleware_stack(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app pipelines | | await route.handle(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle pipelines | | await self.app(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app pipelines | | await wrap_app_handling_exceptions(app, request)(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app pipelines | | await app(scope, receive, sender) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app pipelines | | await response(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ pipelines | | async with anyio.create_task_group() as task_group: pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ pipelines | | raise BaseExceptionGroup( pipelines | | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) pipelines | +-+---------------- 1 ---------------- pipelines | | Traceback (most recent call last): pipelines | | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi pipelines | | result = await app( # type: ignore[func-returns-value] pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ pipelines | | return await self.app(scope, receive, send) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ pipelines | | await super().__call__(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ pipelines | | await self.middleware_stack(scope, receive, send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ pipelines | | await self.app(scope, receive, _send) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ pipelines | | with collapse_excgroups(): pipelines | | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ pipelines | | self.gen.throw(typ, value, traceback) pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups pipelines | | raise exc pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap pipelines | | await func() pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response pipelines | | async for chunk in self.body_iterator: pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool pipelines | | yield await anyio.to_thread.run_sync(_next, as_iterator) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync pipelines | | return await get_async_backend().run_sync_in_worker_thread( pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread pipelines | | return await future pipelines | | ^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run pipelines | | result = context.run(func, *args) pipelines | | ^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next pipelines | | return next(iterator) pipelines | | ^^^^^^^^^^^^^^ pipelines | | File "/app/main.py", line 665, in stream_content pipelines | | for line in res: pipelines | | File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response pipelines | | raise Exception(f"Error: {response.status_code} - {response.text}") pipelines | | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} pipelines | +------------------------------------ pipelines | pipelines | During handling of the above exception, another exception occurred: pipelines | pipelines | Traceback (most recent call last): pipelines | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi pipelines | result = await app( # type: ignore[func-returns-value] pipelines | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ pipelines | return await self.app(scope, receive, send) pipelines | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ pipelines | await super().__call__(scope, receive, send) pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ pipelines | await self.middleware_stack(scope, receive, send) pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ pipelines | raise exc pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ pipelines | await self.app(scope, receive, _send) pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ pipelines | with collapse_excgroups(): pipelines | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ pipelines | self.gen.throw(typ, value, traceback) pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups pipelines | raise exc pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap pipelines | await func() pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response pipelines | async for chunk in self.body_iterator: pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool pipelines | yield await anyio.to_thread.run_sync(_next, as_iterator) pipelines | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync pipelines | return await get_async_backend().run_sync_in_worker_thread( pipelines | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread pipelines | return await future pipelines | ^^^^^^^^^^^^ pipelines | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run pipelines | result = context.run(func, *args) pipelines | ^^^^^^^^^^^^^^^^^^^^^^^^ pipelines | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next pipelines | return next(iterator) pipelines | ^^^^^^^^^^^^^^ pipelines | File "/app/main.py", line 665, in stream_content pipelines | for line in res: pipelines | File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response pipelines | raise Exception(f"Error: {response.status_code} - {response.text}") pipelines | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} pipelines | INFO: 172.18.0.9:55708 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | INFO: 172.18.0.9:55724 - "POST /chat/completions HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35642 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35654 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35664 - "GET /pipelines HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35668 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35672 - "GET /anthropic/valves/spec HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35686 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35700 - "GET /anthropic/valves HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35714 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35716 - "POST /anthropic/valves/update HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35724 - "GET /pipelines HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35738 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35754 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35760 - "GET /anthropic/valves/spec HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35764 - "GET /models HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:35774 - "GET /anthropic/valves HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:43800 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | INFO: 172.18.0.9:43812 - "POST /chat/completions HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:43826 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/outlet HTTP/1.1" 200 OK pipelines | INFO: 172.18.0.9:43842 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | anthropic.claude-3-5-sonnet-20240620 pipelines | INFO: 172.18.0.9:43844 - "POST /chat/completions HTTP/1.1" 200 OK ^Ccanceled ```
Author
Owner

@dannykorpan commented on GitHub (Aug 5, 2024):

Today getting the same error as @realies. After resaving the API-Key in the UI under Pipelines it works for a while.

RESET_PIPELINES_DIR is not set to true. No action taken.
PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements.
Downloading pipeline files from https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py to ./pipelines...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6523  100  6523    0     0  26845      0 --:--:-- --:--:-- --:--:-- 26843
Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/openai_dalle_manifold_pipeline.py to ./pipelines...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2491  100  2491    0     0  10863      0 --:--:-- --:--:-- --:--:-- 10877
pip install requests  sseclient-py
Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (2.32.2)
Collecting sseclient-py
  Downloading sseclient_py-1.8.0-py2.py3-none-any.whl.metadata (2.0 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests) (2.2.2)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests) (2024.7.4)
Downloading sseclient_py-1.8.0-py2.py3-none-any.whl (8.8 kB)
Installing collected packages: sseclient-py
Successfully installed sseclient-py-1.8.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
No requirements found in frontmatter of ./pipelines/openai_dalle_manifold_pipeline.py.
INFO:     Started server process [42]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit)
Loaded module: anthropic_manifold_pipeline
Loaded module: openai_dalle_manifold_pipeline
on_startup:anthropic_manifold_pipeline
on_startup:openai_dalle_manifold_pipeline
INFO:     192.168.0.4:49114 - "GET /models HTTP/1.1" 200 OK
INFO:     192.168.0.4:46652 - "GET /models HTTP/1.1" 200 OK
INFO:     192.168.0.4:46658 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK
anthropic.claude-3-5-sonnet-20240620
anthropic.claude-3-5-sonnet-20240620
INFO:     192.168.0.4:46674 - "POST /chat/completions HTTP/1.1" 200 OK
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__
  |     await response(scope, wrapped_receive, send)
  |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
    |     await func()
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
    |     return await super().stream_response(send)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
    |     async for chunk in self.body_iterator:
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
    |     raise app_exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
    |     await self.app(scope, receive_or_disconnect, send_no_error)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
    |     await self.app(scope, receive, send)
    |   File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
    |     await route.handle(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
    |     await self.app(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
    |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    |     raise exc
    |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    |     await app(scope, receive, sender)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
    |     await response(scope, receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
    |     async with anyio.create_task_group() as task_group:
    |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
    |     raise BaseExceptionGroup(
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
      |     result = await app(  # type: ignore[func-returns-value]
      |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
      |     return await self.app(scope, receive, send)
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
      |     await super().__call__(scope, receive, send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
      |     await self.middleware_stack(scope, receive, send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
      |     raise exc
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
      |     await self.app(scope, receive, _send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
      |     with collapse_excgroups():
      |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
      |     self.gen.throw(typ, value, traceback)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
      |     raise exc
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
      |     await func()
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
      |     async for chunk in self.body_iterator:
      |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
      |     yield await anyio.to_thread.run_sync(_next, as_iterator)
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
      |     return await future
      |            ^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
      |     result = context.run(func, *args)
      |              ^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
      |     return next(iterator)
      |            ^^^^^^^^^^^^^^
      |   File "/app/main.py", line 665, in stream_content
      |     for line in res:
      |   File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response
      |     raise Exception(f"Error: {response.status_code} - {response.text}")
      | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
      +------------------------------------

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
  |     yield
  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__
    |     await wrap(partial(self.listen_for_disconnect, receive))
    |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
    |     await func()
    |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect
    |     message = await receive()
    |               ^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive
    |     msg = await self.receive()
    |           ^^^^^^^^^^^^^^^^^^^^
    |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive
    |     await self.message_event.wait()
    |   File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait
    |     await fut
    | asyncio.exceptions.CancelledError: Cancelled by cancel scope 77ced5b27890
    |
    | During handling of the above exception, another exception occurred:
    |
    | Exception Group Traceback (most recent call last):
    |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__
    |     await response(scope, wrapped_receive, send)
    |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
    |     async with anyio.create_task_group() as task_group:
    |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
    |     raise BaseExceptionGroup(
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__
      |     await wrap(partial(self.listen_for_disconnect, receive))
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
      |     await func()
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect
      |     message = await receive()
      |               ^^^^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 128, in receive_or_disconnect
      |     message = await wrap(wrapped_receive)
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 123, in wrap
      |     result = await func()
      |              ^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive
      |     msg = await self.receive()
      |           ^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive
      |     await self.message_event.wait()
      |   File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait
      |     await fut
      | asyncio.exceptions.CancelledError: Cancelled by cancel scope 77ced5b376d0
      |
      | During handling of the above exception, another exception occurred:
      |
      | Exception Group Traceback (most recent call last):
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
      |     await func()
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response
      |     return await super().stream_response(send)
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
      |     async for chunk in self.body_iterator:
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream
      |     raise app_exc
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
      |     await self.app(scope, receive_or_disconnect, send_no_error)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__
      |     await self.app(scope, receive, send)
      |   File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
      |     raise exc
      |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
      |     await app(scope, receive, sender)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__
      |     await self.middleware_stack(scope, receive, send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
      |     await route.handle(scope, receive, send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
      |     await self.app(scope, receive, send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
      |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
      |     raise exc
      |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
      |     await app(scope, receive, sender)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
      |     await response(scope, receive, send)
      |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__
      |     async with anyio.create_task_group() as task_group:
      |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__
      |     raise BaseExceptionGroup(
      | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
      +-+---------------- 1 ----------------
        | Traceback (most recent call last):
        |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
        |     result = await app(  # type: ignore[func-returns-value]
        |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
        |     return await self.app(scope, receive, send)
        |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
        |     await super().__call__(scope, receive, send)
        |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
        |     await self.middleware_stack(scope, receive, send)
        |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
        |     raise exc
        |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
        |     await self.app(scope, receive, _send)
        |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
        |     with collapse_excgroups():
        |   File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
        |     self.gen.throw(typ, value, traceback)
        |   File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
        |     raise exc
        |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
        |     await func()
        |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
        |     async for chunk in self.body_iterator:
        |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
        |     yield await anyio.to_thread.run_sync(_next, as_iterator)
        |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
        |     return await future
        |            ^^^^^^^^^^^^
        |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
        |     result = context.run(func, *args)
        |              ^^^^^^^^^^^^^^^^^^^^^^^^
        |   File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
        |     return next(iterator)
        |            ^^^^^^^^^^^^^^
        |   File "/app/main.py", line 665, in stream_content
        |     for line in res:
        |   File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response
        |     raise Exception(f"Error: {response.status_code} - {response.text}")
        | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
        +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap
    await func()
  File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response
    async for chunk in self.body_iterator:
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool
    yield await anyio.to_thread.run_sync(_next, as_iterator)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next
    return next(iterator)
           ^^^^^^^^^^^^^^
  File "/app/main.py", line 665, in stream_content
    for line in res:
  File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response
    raise Exception(f"Error: {response.status_code} - {response.text}")
Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}}
<!-- gh-comment-id:2268730864 --> @dannykorpan commented on GitHub (Aug 5, 2024): Today getting the same error as @realies. After resaving the API-Key in the UI under Pipelines it works for a while. ``` RESET_PIPELINES_DIR is not set to true. No action taken. PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements. Downloading pipeline files from https://raw.githubusercontent.com/justinh-rahb/open-webui-pipelines/anthropic-fix/examples/pipelines/providers/anthropic_manifold_pipeline.py to ./pipelines... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6523 100 6523 0 0 26845 0 --:--:-- --:--:-- --:--:-- 26843 Downloading pipeline files from https://raw.githubusercontent.com/open-webui/pipelines/main/examples/pipelines/providers/openai_dalle_manifold_pipeline.py to ./pipelines... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2491 100 2491 0 0 10863 0 --:--:-- --:--:-- --:--:-- 10877 pip install requests sseclient-py Requirement already satisfied: requests in /usr/local/lib/python3.11/site-packages (2.32.2) Collecting sseclient-py Downloading sseclient_py-1.8.0-py2.py3-none-any.whl.metadata (2.0 kB) Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests) (3.7) Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests) (2.2.2) Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests) (2024.7.4) Downloading sseclient_py-1.8.0-py2.py3-none-any.whl (8.8 kB) Installing collected packages: sseclient-py Successfully installed sseclient-py-1.8.0 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [notice] A new release of pip is available: 24.0 -> 24.2 [notice] To update, run: pip install --upgrade pip No requirements found in frontmatter of ./pipelines/openai_dalle_manifold_pipeline.py. INFO: Started server process [42] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit) Loaded module: anthropic_manifold_pipeline Loaded module: openai_dalle_manifold_pipeline on_startup:anthropic_manifold_pipeline on_startup:openai_dalle_manifold_pipeline INFO: 192.168.0.4:49114 - "GET /models HTTP/1.1" 200 OK INFO: 192.168.0.4:46652 - "GET /models HTTP/1.1" 200 OK INFO: 192.168.0.4:46658 - "POST /anthropic.claude-3-5-sonnet-20240620/filter/inlet HTTP/1.1" 200 OK anthropic.claude-3-5-sonnet-20240620 anthropic.claude-3-5-sonnet-20240620 INFO: 192.168.0.4:46674 - "POST /chat/completions HTTP/1.1" 200 OK ERROR: Exception in ASGI application + Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__ | await response(scope, wrapped_receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ | async with anyio.create_task_group() as task_group: | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap | await func() | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response | return await super().stream_response(send) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response | async for chunk in self.body_iterator: | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__ | await self.app(scope, receive, send) | File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app | await route.handle(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle | await self.app(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app | await wrap_app_handling_exceptions(app, request)(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app | await response(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ | async with anyio.create_task_group() as task_group: | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi | result = await app( # type: ignore[func-returns-value] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ | return await self.app(scope, receive, send) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ | await super().__call__(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ | await self.app(scope, receive, _send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap | await func() | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response | async for chunk in self.body_iterator: | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool | yield await anyio.to_thread.run_sync(_next, as_iterator) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread | return await future | ^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run | result = context.run(func, *args) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next | return next(iterator) | ^^^^^^^^^^^^^^ | File "/app/main.py", line 665, in stream_content | for line in res: | File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response | raise Exception(f"Error: {response.status_code} - {response.text}") | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} +------------------------------------ During handling of the above exception, another exception occurred: + Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups | yield | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in __call__ | async with anyio.create_task_group() as task_group: | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__ | await wrap(partial(self.listen_for_disconnect, receive)) | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap | await func() | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect | message = await receive() | ^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive | msg = await self.receive() | ^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive | await self.message_event.wait() | File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait | await fut | asyncio.exceptions.CancelledError: Cancelled by cancel scope 77ced5b27890 | | During handling of the above exception, another exception occurred: | | Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 192, in __call__ | await response(scope, wrapped_receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ | async with anyio.create_task_group() as task_group: | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 265, in __call__ | await wrap(partial(self.listen_for_disconnect, receive)) | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap | await func() | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 238, in listen_for_disconnect | message = await receive() | ^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 128, in receive_or_disconnect | message = await wrap(wrapped_receive) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 123, in wrap | result = await func() | ^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 54, in wrapped_receive | msg = await self.receive() | ^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 596, in receive | await self.message_event.wait() | File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait | await fut | asyncio.exceptions.CancelledError: Cancelled by cancel scope 77ced5b376d0 | | During handling of the above exception, another exception occurred: | | Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap | await func() | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 217, in stream_response | return await super().stream_response(send) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response | async for chunk in self.body_iterator: | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 181, in body_stream | raise app_exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro | await self.app(scope, receive_or_disconnect, send_no_error) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 85, in __call__ | await self.app(scope, receive, send) | File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in __call__ | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app | await route.handle(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle | await self.app(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app | await wrap_app_handling_exceptions(app, request)(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app | await response(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 258, in __call__ | async with anyio.create_task_group() as task_group: | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in __aexit__ | raise BaseExceptionGroup( | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi | result = await app( # type: ignore[func-returns-value] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ | return await self.app(scope, receive, send) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ | await super().__call__(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ | await self.middleware_stack(scope, receive, send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ | await self.app(scope, receive, _send) | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ | with collapse_excgroups(): | File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ | self.gen.throw(typ, value, traceback) | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups | raise exc | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap | await func() | File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response | async for chunk in self.body_iterator: | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool | yield await anyio.to_thread.run_sync(_next, as_iterator) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread | return await future | ^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run | result = context.run(func, *args) | ^^^^^^^^^^^^^^^^^^^^^^^^ | File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next | return next(iterator) | ^^^^^^^^^^^^^^ | File "/app/main.py", line 665, in stream_content | for line in res: | File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response | raise Exception(f"Error: {response.status_code} - {response.text}") | Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} +------------------------------------ During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in __call__ with collapse_excgroups(): File "/usr/local/lib/python3.11/contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups raise exc File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 261, in wrap await func() File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 250, in stream_response async for chunk in self.body_iterator: File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 65, in iterate_in_threadpool yield await anyio.to_thread.run_sync(_next, as_iterator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/starlette/concurrency.py", line 54, in _next return next(iterator) ^^^^^^^^^^^^^^ File "/app/main.py", line 665, in stream_content for line in res: File "/app/./pipelines/anthropic_manifold_pipeline.py", line 166, in stream_response raise Exception(f"Error: {response.status_code} - {response.text}") Exception: Error: 401 - {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} ```
Author
Owner

@realies commented on GitHub (Aug 6, 2024):

Sonnet 3.5 said this could help:

index 81fa910..43d261e 100644
--- a/examples/pipelines/providers/anthropic_manifold_pipeline.py
+++ b/examples/pipelines/providers/anthropic_manifold_pipeline.py
@@ -2,23 +2,22 @@
 title: Anthropic Manifold Pipeline
 author: justinh-rahb, sriparashiva
 date: 2024-06-20
-version: 1.4
+version: 1.5
 license: MIT
 description: A pipeline for generating text and processing images using the Anthropic API.
 requirements: requests, sseclient-py
-environment_variables: ANTHROPIC_API_KEY
 """
 
-import os
-import requests
 import json
+import os
 from typing import List, Union, Generator, Iterator
 from pydantic import BaseModel
+import requests
 import sseclient
+import threading
 
 from utils.pipelines.main import pop_system_message
 
-
 class Pipeline:
     class Valves(BaseModel):
         ANTHROPIC_API_KEY: str = ""
@@ -28,18 +27,27 @@ class Pipeline:
         self.id = "anthropic"
         self.name = "anthropic/"
 
-        self.valves = self.Valves(
-            **{"ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY", "your-api-key-here")}
-        )
+        self.valves = self.Valves()
         self.url = 'https://api.anthropic.com/v1/messages'
+        self._lock = threading.Lock()
+        self.headers = {}
+        self.load_valves()
+
+    def load_valves(self):
+        valves_path = os.path.join(os.path.dirname(__file__), 'valves.json')
+        if os.path.exists(valves_path):
+            with open(valves_path, 'r') as f:
+                valves_data = json.load(f)
+                self.valves = self.Valves(**valves_data)
         self.update_headers()
 
     def update_headers(self):
-        self.headers = {
-            'anthropic-version': '2023-06-01',
-            'content-type': 'application/json',
-            'x-api-key': self.valves.ANTHROPIC_API_KEY
-        }
+        with self._lock:
+            self.headers = {
+                'anthropic-version': '2023-06-01',
+                'content-type': 'application/json',
+                'x-api-key': self.valves.ANTHROPIC_API_KEY
+            }
 
     def get_anthropic_models(self):
         return [
@@ -51,14 +59,14 @@ class Pipeline:
 
     async def on_startup(self):
         print(f"on_startup:{__name__}")
-        pass
+        self.load_valves()
 
     async def on_shutdown(self):
         print(f"on_shutdown:{__name__}")
-        pass
 
     async def on_valves_updated(self):
-        self.update_headers()
+        self.load_valves()
+        print(f"Anthropic API key updated: {self.valves.ANTHROPIC_API_KEY[:5]}...")
 
     def pipelines(self) -> List[dict]:
         return self.get_anthropic_models()
@@ -85,6 +93,9 @@ class Pipeline:
         self, user_message: str, model_id: str, messages: List[dict], body: dict
     ) -> Union[str, Generator, Iterator]:
         try:
+            # Ensure we're using the most up-to-date API key
+            self.load_valves()
+
             # Remove unnecessary keys
             for key in ['user', 'chat_id', 'title']:
                 body.pop(key, None)
@@ -141,12 +152,14 @@ class Pipeline:
             else:
                 return self.get_completion(payload)
         except Exception as e:
+            print(f"Error in pipe: {e}")
             return f"Error: {e}"
 
     def stream_response(self, payload: dict) -> Generator:
-        response = requests.post(self.url, headers=self.headers, json=payload, stream=True)
+        try:
+            response = requests.post(self.url, headers=self.headers, json=payload, stream=True)
+            response.raise_for_status()
 
-        if response.status_code == 200:
             client = sseclient.SSEClient(response)
             for event in client.events():
                 try:
@@ -162,13 +175,16 @@ class Pipeline:
                 except KeyError as e:
                     print(f"Unexpected data structure: {e}")
                     print(f"Full data: {data}")
-        else:
-            raise Exception(f"Error: {response.status_code} - {response.text}")
+        except requests.exceptions.RequestException as e:
+            print(f"Error in stream_response: {e}")
+            yield f"Error: {e}"
 
     def get_completion(self, payload: dict) -> str:
-        response = requests.post(self.url, headers=self.headers, json=payload)
-        if response.status_code == 200:
+        try:
+            response = requests.post(self.url, headers=self.headers, json=payload)
+            response.raise_for_status()
             res = response.json()
             return res["content"][0]["text"] if "content" in res and res["content"] else ""
-        else:
-            raise Exception(f"Error: {response.status_code} - {response.text}")
+        except requests.exceptions.RequestException as e:
+            print(f"Error in get_completion: {e}")
+            return f"Error: {e}"

<!-- gh-comment-id:2271858505 --> @realies commented on GitHub (Aug 6, 2024): Sonnet 3.5 said this could help: ```diff --git a/examples/pipelines/providers/anthropic_manifold_pipeline.py b/examples/pipelines/providers/anthropic_manifold_pipeline.py index 81fa910..43d261e 100644 --- a/examples/pipelines/providers/anthropic_manifold_pipeline.py +++ b/examples/pipelines/providers/anthropic_manifold_pipeline.py @@ -2,23 +2,22 @@ title: Anthropic Manifold Pipeline author: justinh-rahb, sriparashiva date: 2024-06-20 -version: 1.4 +version: 1.5 license: MIT description: A pipeline for generating text and processing images using the Anthropic API. requirements: requests, sseclient-py -environment_variables: ANTHROPIC_API_KEY """ -import os -import requests import json +import os from typing import List, Union, Generator, Iterator from pydantic import BaseModel +import requests import sseclient +import threading from utils.pipelines.main import pop_system_message - class Pipeline: class Valves(BaseModel): ANTHROPIC_API_KEY: str = "" @@ -28,18 +27,27 @@ class Pipeline: self.id = "anthropic" self.name = "anthropic/" - self.valves = self.Valves( - **{"ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY", "your-api-key-here")} - ) + self.valves = self.Valves() self.url = 'https://api.anthropic.com/v1/messages' + self._lock = threading.Lock() + self.headers = {} + self.load_valves() + + def load_valves(self): + valves_path = os.path.join(os.path.dirname(__file__), 'valves.json') + if os.path.exists(valves_path): + with open(valves_path, 'r') as f: + valves_data = json.load(f) + self.valves = self.Valves(**valves_data) self.update_headers() def update_headers(self): - self.headers = { - 'anthropic-version': '2023-06-01', - 'content-type': 'application/json', - 'x-api-key': self.valves.ANTHROPIC_API_KEY - } + with self._lock: + self.headers = { + 'anthropic-version': '2023-06-01', + 'content-type': 'application/json', + 'x-api-key': self.valves.ANTHROPIC_API_KEY + } def get_anthropic_models(self): return [ @@ -51,14 +59,14 @@ class Pipeline: async def on_startup(self): print(f"on_startup:{__name__}") - pass + self.load_valves() async def on_shutdown(self): print(f"on_shutdown:{__name__}") - pass async def on_valves_updated(self): - self.update_headers() + self.load_valves() + print(f"Anthropic API key updated: {self.valves.ANTHROPIC_API_KEY[:5]}...") def pipelines(self) -> List[dict]: return self.get_anthropic_models() @@ -85,6 +93,9 @@ class Pipeline: self, user_message: str, model_id: str, messages: List[dict], body: dict ) -> Union[str, Generator, Iterator]: try: + # Ensure we're using the most up-to-date API key + self.load_valves() + # Remove unnecessary keys for key in ['user', 'chat_id', 'title']: body.pop(key, None) @@ -141,12 +152,14 @@ class Pipeline: else: return self.get_completion(payload) except Exception as e: + print(f"Error in pipe: {e}") return f"Error: {e}" def stream_response(self, payload: dict) -> Generator: - response = requests.post(self.url, headers=self.headers, json=payload, stream=True) + try: + response = requests.post(self.url, headers=self.headers, json=payload, stream=True) + response.raise_for_status() - if response.status_code == 200: client = sseclient.SSEClient(response) for event in client.events(): try: @@ -162,13 +175,16 @@ class Pipeline: except KeyError as e: print(f"Unexpected data structure: {e}") print(f"Full data: {data}") - else: - raise Exception(f"Error: {response.status_code} - {response.text}") + except requests.exceptions.RequestException as e: + print(f"Error in stream_response: {e}") + yield f"Error: {e}" def get_completion(self, payload: dict) -> str: - response = requests.post(self.url, headers=self.headers, json=payload) - if response.status_code == 200: + try: + response = requests.post(self.url, headers=self.headers, json=payload) + response.raise_for_status() res = response.json() return res["content"][0]["text"] if "content" in res and res["content"] else "" - else: - raise Exception(f"Error: {response.status_code} - {response.text}") + except requests.exceptions.RequestException as e: + print(f"Error in get_completion: {e}") + return f"Error: {e}" ```
Author
Owner

@realies commented on GitHub (Aug 6, 2024):

wait, you're supposed to provide the key via ANTHROPIC_API_KEY? can keys be fetched from valves.json as a fallback?

<!-- gh-comment-id:2271876083 --> @realies commented on GitHub (Aug 6, 2024): wait, you're supposed to provide the key via ANTHROPIC_API_KEY? can keys be fetched from valves.json as a fallback?
Author
Owner

@justinh-rahb commented on GitHub (Aug 6, 2024):

wait, you're supposed to provide the key via ANTHROPIC_API_KEY? can keys be fetched from valves.json as a fallback?

Intended to be optional with ability to set via valves as well, but if this is not working it'll need refac. Will look into when my time allows. For now, yes, setting an ANTHROPIC_API_KEY environment variable should resolve the current issue until a new PR is made.

<!-- gh-comment-id:2272215776 --> @justinh-rahb commented on GitHub (Aug 6, 2024): > wait, you're supposed to provide the key via ANTHROPIC_API_KEY? can keys be fetched from valves.json as a fallback? Intended to be _optional_ with ability to set via valves as well, but if this is not working it'll need refac. Will look into when my time allows. For now, yes, setting an `ANTHROPIC_API_KEY` environment variable should resolve the current issue until a new PR is made.
Author
Owner

@dannykorpan commented on GitHub (Aug 7, 2024):

wait, you're supposed to provide the key via ANTHROPIC_API_KEY? can keys be fetched from valves.json as a fallback?

Will try it.

<!-- gh-comment-id:2272749565 --> @dannykorpan commented on GitHub (Aug 7, 2024): > wait, you're supposed to provide the key via ANTHROPIC_API_KEY? can keys be fetched from valves.json as a fallback? Will try it.
Author
Owner

@dannykorpan commented on GitHub (Aug 7, 2024):

The day after... same problem today.

<!-- gh-comment-id:2273470190 --> @dannykorpan commented on GitHub (Aug 7, 2024): The day after... same problem today.
Author
Owner

@justinh-rahb commented on GitHub (Aug 7, 2024):

For what it's worth, I’ve been using my own pipeline since I created it and haven’t personally encountered any of the reported errors or issues. All my troubleshooting and debugging has been based on these reports, but I haven’t been able to fully reproduce them. This means I’m essentially working in the dark. I would greatly appreciate any additional information, such as logs or detailed accounts of the exact sequence of events that led to these outcomes, even if it feels excessive or "too much detail", let me decide that.

<!-- gh-comment-id:2274117222 --> @justinh-rahb commented on GitHub (Aug 7, 2024): For what it's worth, I’ve been using my own pipeline since I created it and haven’t personally encountered any of the reported errors or issues. All my troubleshooting and debugging has been based on these reports, but I haven’t been able to fully reproduce them. This means I’m essentially working in the dark. I would greatly appreciate any additional information, such as logs or detailed accounts of the exact sequence of events that led to these outcomes, even if it feels excessive or "too much detail", let me decide that.
Author
Owner

@dannykorpan commented on GitHub (Aug 7, 2024):

How do I enable debugging, so that I can see the the used API key?

<!-- gh-comment-id:2274255432 --> @dannykorpan commented on GitHub (Aug 7, 2024): How do I enable debugging, so that I can see the the used API key?
Author
Owner

@RamboRogers commented on GitHub (Sep 7, 2024):

I have the same error. Brand new install, valid key used on other things. Google works, anthropic crashes.

image

<!-- gh-comment-id:2336418236 --> @RamboRogers commented on GitHub (Sep 7, 2024): I have the same error. Brand new install, valid key used on other things. Google works, anthropic crashes. ![image](https://github.com/user-attachments/assets/6ca2e5af-9cd2-47b1-a289-377ad9d4f42f)
Author
Owner

@bgeneto commented on GitHub (Sep 23, 2024):

I'm also having to save api key manually (for both Anthropic and Dall-E) manifold pipelines every time the docker container restarts. What is more Strange is that api keys are there and correct, I just have press save button.

<!-- gh-comment-id:2367036372 --> @bgeneto commented on GitHub (Sep 23, 2024): I'm also having to save api key manually (for both Anthropic and Dall-E) manifold pipelines every time the docker container restarts. What is more Strange is that api keys are there and correct, I just have press save button.
Author
Owner

@Aman-14 commented on GitHub (Sep 24, 2024):

@bgeneto Pipeline headers need to be updated at startup, I have create another here #271

<!-- gh-comment-id:2370314740 --> @Aman-14 commented on GitHub (Sep 24, 2024): @bgeneto Pipeline headers need to be updated at startup, I have create another here #271
Author
Owner

@yazon commented on GitHub (Jan 30, 2025):

Same issue. Workaround from https://github.com/open-webui/pipelines/issues/166#issuecomment-2253134986 works but is a bit annoying.

<!-- gh-comment-id:2623930834 --> @yazon commented on GitHub (Jan 30, 2025): Same issue. Workaround from https://github.com/open-webui/pipelines/issues/166#issuecomment-2253134986 works but is a bit annoying.
Author
Owner

@recallmenot commented on GitHub (Feb 11, 2025):

@bgeneto @Aman-14 can confirm, after rebooting (or restarting the pipelines docker container), for the API key to work again, I have to manually go into the pipelines interface in open-webui and hit save so something is not being passed on automatically here.

<!-- gh-comment-id:2650097707 --> @recallmenot commented on GitHub (Feb 11, 2025): @bgeneto @Aman-14 can confirm, after rebooting (or restarting the pipelines docker container), for the API key to work again, I have to manually go into the pipelines interface in open-webui and hit save so something is not being passed on automatically here.
Author
Owner

@Aman-14 commented on GitHub (Feb 11, 2025):

If you are using pipelines just for Anthropic models, you can use functions instead.

https://openwebui.com/f/justinrahb/anthropic

<!-- gh-comment-id:2650106499 --> @Aman-14 commented on GitHub (Feb 11, 2025): If you are using pipelines just for Anthropic models, you can use functions instead. https://openwebui.com/f/justinrahb/anthropic
Author
Owner

@savely-krasovsky commented on GitHub (Apr 20, 2025):

Resaving tokens helps, but why pipelines lose them over time? It happens in my case with Anthropic, Google and OpenAI pipelines. They just stop working at some point even without container restart. Why it stores tokens in /pipelines directory then? Restore mechanism is broken?

cc @justinh-rahb

<!-- gh-comment-id:2817376202 --> @savely-krasovsky commented on GitHub (Apr 20, 2025): Resaving tokens helps, but why pipelines lose them over time? It happens in my case with Anthropic, Google and OpenAI pipelines. They just stop working at some point even without container restart. Why it stores tokens in `/pipelines` directory then? Restore mechanism is broken? cc @justinh-rahb
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/pipelines#80
No description provided.