MineContext icon indicating copy to clipboard operation
MineContext copied to clipboard

[BUG]:请求一直失败

Open Kyhero-ai opened this issue 2 months ago • 9 comments

🐛 Bug description [Please make everyone to understand it]

vlm_model: base_url: "https://ark.cn-beijing.volces.com/api/v3/chat/completions" api_key: "xxxxxxxx" model: "ep-20251017102924-5xjch" provider: "doubao"

max_tokens: 4096

temperature: 0.7

embedding_model: base_url: "https://ark.cn-beijing.volces.com/api/v3" api_key: "xxxxxxx" model: "ep-20251017103311-7jbxl" provider: doubao output_dim: 2048

Workflow execution failed: Error code: 500 - {'error': {'code': 'InternalServiceError', 'message': 'The service encountered an unexpected internal error. Please retry later. Request id: 021760670550362747eea32fc41a3946f1fed981da9801d5da5b9', 'param': '', 'type': 'Internal Server Error'}}

🧑‍💻 Step to reproduce

1

👾 Expected result

1

🚑 Any additional information

No response

🛠️ MineContext Version

1

💻 Platform Details

1

Kyhero-ai avatar Oct 17 '25 03:10 Kyhero-ai

看起来是模型服务报错 可以到 cd ~/Library/Application\ Support/MineContext/logs/ 路径下看下详细的报错日志

qin-ctx avatar Oct 17 '25 03:10 qin-ctx

还是有报错吗?

qin-ctx avatar Oct 20 '25 04:10 qin-ctx

Traceback (most recent call last):

File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\threading.py", line 1032, in _bootstrap self._bootstrap_inner() │ └ <function Thread._bootstrap_inner at 0x0000014F631660C0> └ <Thread(Thread-3 (_run_processing_loop), started daemon 17332)> File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\threading.py", line 1075, in _bootstrap_inner self.run() │ └ <function Thread.run at 0x0000014F63165DA0> └ <Thread(Thread-3 (_run_processing_loop), started daemon 17332)> File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\threading.py", line 1012, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {} │ │ │ │ └ <Thread(Thread-3 (_run_processing_loop), started daemon 17332)> │ │ │ └ () │ │ └ <Thread(Thread-3 (_run_processing_loop), started daemon 17332)> │ └ <bound method ScreenshotProcessor._run_processing_loop of <opencontext.context_processing.processor.screenshot_processor.Scre... └ <Thread(Thread-3 (_run_processing_loop), started daemon 17332)>

File "C:\Users\98040\PycharmProjects\MineContext\opencontext\context_processing\processor\screenshot_processor.py", line 195, in run_processing_loop loop.run_until_complete(self.batch_process(unprocessed_contexts)) │ │ │ │ └ [RawContextProperties(content_format=<ContentFormat.IMAGE: 'image'>, source=<ContextSource.SCREENSHOT: 'screenshot'>, create... │ │ │ └ <function ScreenshotProcessor.batch_process at 0x0000014F7F8FD940> │ │ └ <opencontext.context_processing.processor.screenshot_processor.ScreenshotProcessor object at 0x0000014F09B9E660> │ └ <function BaseEventLoop.run_until_complete at 0x0000014F64B7A0C0> └ <ProactorEventLoop running=True closed=False debug=False>

File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\asyncio\base_events.py", line 678, in run_until_complete self.run_forever() │ └ <function ProactorEventLoop.run_forever at 0x0000014F650351C0> └ <ProactorEventLoop running=True closed=False debug=False> File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\asyncio\windows_events.py", line 322, in run_forever super().run_forever() File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\asyncio\base_events.py", line 645, in run_forever self._run_once() │ └ <function BaseEventLoop._run_once at 0x0000014F64B7BE20> └ <ProactorEventLoop running=True closed=False debug=False> File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\asyncio\base_events.py", line 1999, in _run_once handle._run() │ └ <function Handle._run at 0x0000014F64B0C400> └ <Handle <_asyncio.TaskStepMethWrapper object at 0x0000014F0A5262F0>()> File "C:\Users\98040\AppData\Roaming\uv\python\cpython-3.12.12-windows-x86_64-none\Lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) │ │ │ │ │ └ <member '_args' of 'Handle' objects> │ │ │ │ └ <Handle <_asyncio.TaskStepMethWrapper object at 0x0000014F0A5262F0>()> │ │ │ └ <member '_callback' of 'Handle' objects> │ │ └ <Handle <_asyncio.TaskStepMethWrapper object at 0x0000014F0A5262F0>()> │ └ <member '_context' of 'Handle' objects> └ <Handle <_asyncio.TaskStepMethWrapper object at 0x0000014F0A5262F0>()>

File "C:\Users\98040\PycharmProjects\MineContext\opencontext\context_processing\processor\screenshot_processor.py", line 278, in batch_process raw_llm_response = await generate_with_messages_async( └ <function generate_with_messages_async at 0x0000014F680B36A0>

File "C:\Users\98040\PycharmProjects\MineContext\opencontext\llm\global_vlm_client.py", line 303, in generate_with_messages_async return await GlobalVLMClient.get_instance().generate_with_messages_async( │ └ <classmethod(<function GlobalVLMClient.get_instance at 0x0000014F680B11C0>)> └ <class 'opencontext.llm.global_vlm_client.GlobalVLMClient'>

File "C:\Users\98040\PycharmProjects\MineContext\opencontext\llm\global_vlm_client.py", line 179, in generate_with_messages_async response = await self._vlm_client.generate_with_messages_async(messages, **kwargs) │ │ │ │ └ {'tools': [{'type': 'function', 'function': {'name': 'retrieve_activity_context', 'description': 'Retrieve behavioral activit... │ │ │ └ [{'role': 'system', 'content': '你是current_user屏幕截图的分析专家,负责深度理解current_user的桌面截图内容,生成全面详尽的自然语言描述,并与历史上下文融合。current_user是截图的拍摄者... │ │ └ <function LLMClient.generate_with_messages_async at 0x0000014F6802FF60> │ └ <opencontext.llm.llm_client.LLMClient object at 0x0000014F09CA4D40> └ <opencontext.llm.global_vlm_client.GlobalVLMClient object at 0x0000014F096659A0>

File "C:\Users\98040\PycharmProjects\MineContext\opencontext\llm\llm_client.py", line 59, in generate_with_messages_async return await self._openai_chat_completion_async(messages, **kwargs) │ │ │ └ {'tools': [{'type': 'function', 'function': {'name': 'retrieve_activity_context', 'description': 'Retrieve behavioral activit... │ │ └ [{'role': 'system', 'content': '你是current_user屏幕截图的分析专家,负责深度理解current_user的桌面截图内容,生成全面详尽的自然语言描述,并与历史上下文融合。current_user是截图的拍摄者... │ └ <function LLMClient._openai_chat_completion_async at 0x0000014F680509A0> └ <opencontext.llm.llm_client.LLMClient object at 0x0000014F09CA4D40>

File "C:\Users\98040\PycharmProjects\MineContext\opencontext\llm\llm_client.py", line 146, in _openai_chat_completion_async response = await self.async_client.chat.completions.create(**create_params) │ │ │ │ │ └ {'model': 'ep-20251017102924-5xjch', 'messages': [{'role': 'system', 'content': '你是current_user屏幕截图的分析专家,负责深度理解current_user的桌... │ │ │ │ └ <function AsyncCompletions.create at 0x0000014F0A003880> │ │ │ └ <openai.resources.chat.completions.completions.AsyncCompletions object at 0x0000014F09EC5460> │ │ └ <openai.resources.chat.chat.AsyncChat object at 0x0000014F09B86BA0> │ └ <openai.AsyncOpenAI object at 0x0000014F09CA4DA0> └ <opencontext.llm.llm_client.LLMClient object at 0x0000014F09CA4D40>

File "C:\Users\98040\PycharmProjects\MineContext.venv\Lib\site-packages\openai\resources\chat\completions\completions.py", line 2603, in create return await self.post( │ └ <bound method AsyncAPIClient.post of <openai.AsyncOpenAI object at 0x0000014F09CA4DA0>> └ <openai.resources.chat.completions.completions.AsyncCompletions object at 0x0000014F09EC5460> File "C:\Users\98040\PycharmProjects\MineContext.venv\Lib\site-packages\openai_base_client.py", line 1794, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) │ │ │ │ │ └ openai.AsyncStream[openai.types.chat.chat_completion_chunk.ChatCompletionChunk] │ │ │ │ └ False │ │ │ └ FinalRequestOptions(method='post', url='/chat/completions', params={}, headers=NOT_GIVEN, max_retries=NOT_GIVEN, timeout=NOT... │ │ └ <class 'openai.types.chat.chat_completion.ChatCompletion'> │ └ <function AsyncAPIClient.request at 0x0000014F67ED6C00> └ <openai.AsyncOpenAI object at 0x0000014F09CA4DA0> File "C:\Users\98040\PycharmProjects\MineContext.venv\Lib\site-packages\openai_base_client.py", line 1594, in request raise self._make_status_error_from_response(err.response) from None │ └ <function BaseClient._make_status_error_from_response at 0x0000014F67EC3D80> └ <openai.AsyncOpenAI object at 0x0000014F09CA4DA0>

openai.InternalServerError: Error code: 500 - {'error': {'code': 'InternalServiceError', 'message': 'The service encountered an unexpected internal error. Please retry later. Request id: 021760670740054eb5cd35b58dcbd0d14b1782773d336b1ce5e44', 'param': '', 'type': 'Internal Server Error'}} 2025-10-17 11:12:20 | ERROR | Failed to get raw LLM response for batch of screenshots. Error: Error code: 500 - {'error': {'code': 'InternalServiceError', 'message': 'The service encountered an unexpected internal error. Please retry later. Request id: 021760670740054eb5cd35b58dcbd0d14b1782773d336b1ce5e44', 'param': '', 'type': 'Internal Server Error'}} 2025-10-17 11:12:20 | INFO | processed 1 cost: 2 seconds 2025-10-17 11:12:29 | INFO | Received signal 2, safely shutting down ChromaDB... 2025-10-17 11:12:29 | INFO | Persisting ChromaDB index... 2025-10-17 11:12:29 | INFO | ChromaDB safely shut down 2025-10-17 11:12:29 | INFO | Web server closed, shutting down capture modules... 2025-10-17 11:12:29 | INFO | Shutting down all components... 2025-10-17 11:12:29 | INFO | Scheduled tasks stopped 2025-10-17 11:12:29 | INFO | Content generation scheduled tasks stopped 2025-10-17 11:12:29 | INFO | Shutting down Context Capture Manager... 2025-10-17 11:12:29 | INFO | ScreenshotCapture: Capture thread stopped 2025-10-17 11:12:29 | INFO | Screenshot capture component stopped 2025-10-17 11:12:29 | INFO | ScreenshotCapture: Stop successful 2025-10-17 11:12:29 | INFO | Component 'screenshot' stopped successfully 2025-10-17 11:12:29 | INFO | Context Capture Manager has been shut down. 2025-10-17 11:12:29 | INFO | Shutting down context processing manager... 2025-10-17 11:12:29 | INFO | Shutting down DocumentProcessor... 2025-10-17 11:12:29 | INFO | DocumentProcessor has been shut down. 2025-10-17 11:12:29 | INFO | Shutting down ScreenshotProcessor... 2025-10-17 11:12:29 | INFO | Received sentinel value, exiting processing loop 2025-10-17 11:12:29 | INFO | ScreenshotProcessor has been shut down. 2025-10-17 11:12:29 | INFO | Context processing manager has been shut down 2025-10-17 11:12:29 | INFO | All components shut down successfully. 2025-10-17 11:12:29 | INFO | Received signal 2, safely shutting down ChromaDB... 2025-10-17 11:12:29 | INFO | Persisting ChromaDB index... 2025-10-17 11:12:29 | INFO | ChromaDB safely shut down 2025-10-17 11:12:29 | INFO | Persisting ChromaDB index... 2025-10-17 11:12:29 | INFO | ChromaDB safely shut down 2025-10-17 11:16:02 | INFO | Logging setup completed 2025-10-17 11:16:02 | DEBUG | Command line arguments: Namespace(command='start', config=None, host=None, port=None, workers=1) 2025-10-17 11:16:02 | INFO | OpenContext initialization completed 2025-10-17 11:16:02 | INFO | Starting initialization of all components... 2025-10-17 11:16:02 | INFO | GlobalEmbeddingClient auto-initialized successfully 2025-10-17 11:16:03 | DEBUG | ChromaDB graceful shutdown handlers registered 2025-10-17 11:16:03 | INFO | Initializing ChromaDB in local persistence mode: ./persist/chromadb 2025-10-17 11:16:03 | INFO | ChromaDB vector backend initialized successfully, created 6 collections 2025-10-17 11:16:03 | INFO | Storage backend default_vector (vector_db) initialized successfully 2025-10-17 11:16:03 | INFO | SQLite backend initialized successfully, database path: ./persist/sqlite/app.db 2025-10-17 11:16:03 | INFO | Storage backend document_store (document_db) initialized successfully 2025-10-17 11:16:03 | INFO | GlobalStorage auto-initialized successfully 2025-10-17 11:16:03 | INFO | GlobalVLMClient auto-initialized successfully 2025-10-17 11:16:03 | INFO | Component 'screenshot' registered successfully 2025-10-17 11:16:03 | INFO | Using mss library for screenshots 2025-10-17 11:16:03 | INFO | Screenshots will be saved to directory: ./screenshots 2025-10-17 11:16:03 | INFO | ScreenshotCapture: Initialization successful 2025-10-17 11:16:03 | INFO | Component 'screenshot' initialized successfully 2025-10-17 11:16:03 | INFO | Capture component 'screenshot' initialized successfully 2025-10-17 11:16:03 | INFO | Context capture modules initialization complete 2025-10-17 11:16:03 | INFO | Capture modules initialization completed 2025-10-17 11:16:03 | DEBUG | Registered processor type 'document_processor' -> DocumentProcessor 2025-10-17 11:16:03 | DEBUG | Registered processor type 'screenshot_processor' -> ScreenshotProcessor 2025-10-17 11:16:03 | INFO | Registered 2 built-in processor types 2025-10-17 11:16:03 | INFO | Successfully created processor instance of type 'document_processor' 2025-10-17 11:16:03 | INFO | Processing component 'document_processor' registered successfully 2025-10-17 11:16:03 | INFO | Processor component 'document_processor' created and registered successfully 2025-10-17 11:16:03 | INFO | Successfully created processor instance of type 'screenshot_processor' 2025-10-17 11:16:03 | INFO | Processing component 'screenshot_processor' registered successfully 2025-10-17 11:16:03 | INFO | Processor component 'screenshot_processor' created and registered successfully 2025-10-17 11:16:03 | INFO | Context processors initialization complete 2025-10-17 11:16:03 | INFO | Activity timer started, check interval: 180s, generation interval: 900s 2025-10-17 11:16:03 | INFO | Tips timer started, check interval: 200s, generation interval: 3600s 2025-10-17 11:16:03 | INFO | Todos timer started, check interval: 250s, generation interval: 1800s 2025-10-17 11:16:03 | INFO | Context consumption components initialization complete 2025-10-17 11:16:03 | INFO | Initializing completion service... 2025-10-17 11:16:03 | INFO | CompletionCache initialized: max_size=1000, ttl=300s, strategy=hybrid 2025-10-17 11:16:03 | INFO | CompletionService initialized successfully 2025-10-17 11:16:03 | INFO | Completion service initialized successfully 2025-10-17 11:16:03 | INFO | System monitor initialized 2025-10-17 11:16:03 | INFO | Monitoring system initialized with storage backend 2025-10-17 11:16:03 | INFO | All components initialization completed successfully 2025-10-17 11:16:03 | INFO | Starting all modules 2025-10-17 11:16:03 | INFO | Starting all capture components... 2025-10-17 11:16:03 | INFO | Screenshot capture component started using mss library 2025-10-17 11:16:03 | INFO | ScreenshotCapture: Capture thread started, interval: 5.0s 2025-10-17 11:16:03 | INFO | ScreenshotCapture: Startup successful 2025-10-17 11:16:03 | INFO | Component 'screenshot' started successfully 2025-10-17 11:16:03 | INFO | All capture components started successfully 2025-10-17 11:16:03 | INFO | Starting web server on 127.0.0.1:10001 2025-10-17 11:16:08 | INFO | Received signal 2, safely shutting down ChromaDB... 2025-10-17 11:16:08 | INFO | Persisting ChromaDB index... 2025-10-17 11:16:08 | INFO | ChromaDB safely shut down 2025-10-17 11:16:08 | INFO | Web server closed, shutting down capture modules... 2025-10-17 11:16:08 | INFO | Shutting down all components... 2025-10-17 11:16:08 | INFO | Scheduled tasks stopped 2025-10-17 11:16:08 | INFO | Content generation scheduled tasks stopped 2025-10-17 11:16:08 | INFO | Shutting down Context Capture Manager... 2025-10-17 11:16:08 | INFO | ScreenshotCapture: Capture thread stopped 2025-10-17 11:16:08 | INFO | Screenshot capture component stopped 2025-10-17 11:16:08 | INFO | ScreenshotCapture: Stop successful 2025-10-17 11:16:08 | INFO | Component 'screenshot' stopped successfully 2025-10-17 11:16:08 | INFO | Context Capture Manager has been shut down. 2025-10-17 11:16:08 | INFO | Shutting down context processing manager... 2025-10-17 11:16:08 | INFO | Shutting down DocumentProcessor... 2025-10-17 11:16:08 | INFO | DocumentProcessor has been shut down. 2025-10-17 11:16:08 | INFO | Shutting down ScreenshotProcessor... 2025-10-17 11:16:08 | INFO | Received sentinel value, exiting processing loop 2025-10-17 11:16:08 | INFO | ScreenshotProcessor has been shut down. 2025-10-17 11:16:08 | INFO | Context processing manager has been shut down 2025-10-17 11:16:08 | INFO | All components shut down successfully. 2025-10-17 11:16:08 | INFO | Received signal 2, safely shutting down ChromaDB... 2025-10-17 11:16:08 | INFO | Persisting ChromaDB index... 2025-10-17 11:16:08 | INFO | ChromaDB safely shut down 2025-10-17 11:16:08 | INFO | Persisting ChromaDB index... 2025-10-17 11:16:08 | INFO | ChromaDB safely shut down

Kyhero-ai avatar Oct 21 '25 02:10 Kyhero-ai

服务器配置按照规范配置的, vlm_model: base_url: https://ark.cn-beijing.volces.com/api/v3/chat/completions api_key: xxxxxxxxxxxx model: ep-20251017102924-5xjch provider: doubao

max_tokens: 4096

temperature: 0.7

embedding_model: base_url: https://ark.cn-beijing.volces.com/api/v3 api_key: xxxxxxxxxxxx model: ep-20251017103311-7jbxl provider: doubao output_dim: 2048

Kyhero-ai avatar Oct 21 '25 03:10 Kyhero-ai

ep-20251017102924-5xjch

vlm是哪个模型呢?要不换一个试试?

qin-ctx avatar Oct 21 '25 06:10 qin-ctx

有参考的配置吗

Kyhero-ai avatar Oct 22 '25 20:10 Kyhero-ai

有参考的配置吗

我一般都使用公司提供的 doubao flash

qin-ctx avatar Oct 23 '25 03:10 qin-ctx

我也报了这个错误,是不是豆包要开启哪个模型?这个报错信息没看到具体的模型id 不太正常,我的截图第一个问题是有回答,第二个问题出错

Image

zhaozfgzsendi avatar Oct 29 '25 01:10 zhaozfgzsendi

我也报了这个错误,是不是豆包要开启哪个模型?这个报错信息没看到具体的模型id 不太正常,我的截图第一个问题是有回答,第二个问题出错

Image

原来是没有token可用了,这个有点耗token啊,50w的半小时就耗没了 Image

zhaozfgzsendi avatar Oct 29 '25 02:10 zhaozfgzsendi