Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 deepseek-chat 模型报错,貌似是 401 权限问题 #9514

Open
yanglindong0725 opened this issue Mar 25, 2025 · 0 comments
Open

Comments

@yanglindong0725
Copy link

报错内容如下:

LiteLLM.Info: If you need to debug this error, use litellm._turn_on_debug()'.

Traceback (most recent call last):
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/llm_http_handler.py", line 118, in _make_common_sync_call
response = sync_httpx_client.post(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/http_handler.py", line 557, in post
raise e
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/http_handler.py", line 538, in post
response.raise_for_status()
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/httpx/_models.py", line 829, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://api.deepseek.com/chat/completions'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/main.py", line 1422, in completion
raise e
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/main.py", line 1397, in completion
response = base_llm_http_handler.completion(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/llm_http_handler.py", line 377, in completion
response = self._make_common_sync_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/llm_http_handler.py", line 139, in _make_common_sync_call
raise self._handle_error(e=e, provider_config=provider_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/llms/custom_httpx/llm_http_handler.py", line 1209, in _handle_error
raise provider_config.get_error_class(
litellm.llms.openai.common_utils.OpenAIError: Authentication Fails (governor)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/main.py", line 15, in
result = run_agent_workflow(user_input=user_query, debug=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/src/workflow.py", line 40, in run_agent_workflow
result = graph.invoke(
^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langgraph/pregel/init.py", line 2367, in invoke
for chunk in self.stream(
^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langgraph/pregel/init.py", line 2024, in stream
for _ in runner.tick(
^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langgraph/pregel/runner.py", line 230, in tick
run_with_retry(
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langgraph/pregel/retry.py", line 40, in run_with_retry
return task.proc.invoke(task.input, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langgraph/utils/runnable.py", line 546, in invoke
input = step.invoke(input, config, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langgraph/utils/runnable.py", line 310, in invoke
ret = context.run(self.func, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/src/graph/nodes.py", line 173, in coordinator_node
response = get_llm_by_type(AGENT_LLM_MAP["coordinator"]).invoke(messages)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 307, in invoke
self.generate_prompt(
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 843, in generate_prompt
return self.generate(prompt_messages, stop=stop, callbacks=callbacks, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 683, in generate
self._generate_with_cache(
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 908, in _generate_with_cache
result = self._generate(
^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langchain_community/chat_models/litellm.py", line 404, in _generate
response = self.completion_with_retry(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langchain_community/chat_models/litellm.py", line 337, in completion_with_retry
return _completion_with_retry(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/tenacity/init.py", line 336, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/tenacity/init.py", line 475, in call
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/tenacity/init.py", line 376, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/tenacity/init.py", line 398, in
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/tenacity/init.py", line 478, in call
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/langchain_community/chat_models/litellm.py", line 335, in _completion_with_retry
return self.client.completion(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/utils.py", line 1235, in wrapper
raise e
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/utils.py", line 1113, in wrapper
result = original_function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/main.py", line 3137, in completion
raise exception_type(
^^^^^^^^^^^^^^^
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2214, in exception_type
raise e
File "/Users/yanglindong/CodeHub/2025/Openmanus/langmanus/.venv/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 393, in exception_type
raise AuthenticationError(
litellm.exceptions.AuthenticationError: litellm.AuthenticationError: AuthenticationError: DeepseekException - Authentication Fails (governor)
During task with name 'coordinator' and id 'a6e9472b-aeec-be26-f4cf-74352e81ed6a'`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant