adryfish / llm-web-api

将ChatGPT网页转换成API接口。实现Cloudflare 5s盾破解,Arkose FunCaptcha验证码破解,邮箱账号自动登录,支持GPT-4o模型、多轮对话、高速流式输出、并完全兼容 ChatGPT接口。ChatGPT Free Web API.
GNU General Public License v3.0
62 stars 10 forks source link

EACCES: permission denied, mkdir '/app/browser_data/openai' #1

Closed holzora closed 5 months ago

holzora commented 5 months ago

容器日志

ERROR: Application startup failed. Exiting. 2024-05-28 12:53:39,471 - AppLogger - INFO - Start xvfb service INFO: Started server process [1] INFO: Waiting for application startup. ERROR: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 732, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/lib/python3.10/contextlib.py", line 199, in aenter return await anext(self.gen) File "/app/llm/main.py", line 22, in lifespan await provider_manager.start_all() File "/app/llm/provider_manager.py", line 31, in start_all await crawler.start() File "/app/llm/provider/openai/core.py", line 40, in start self.browser_context = await self.launch_browser( File "/app/llm/provider/openai/core.py", line 110, in launch_browser browser_context = await chromium.launch_persistent_context( File "/usr/local/lib/python3.10/dist-packages/playwright/async_api/_generated.py", line 14217, in launch_persistent_context await self._impl_obj.launch_persistent_context( File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_browser_type.py", line 157, in launch_persistent_context from_channel(await self._channel.send("launchPersistentContext", params)), File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_connection.py", line 59, in send return await self._connection.wrap_api_call( File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.Error: BrowserType.launch_persistent_context: EACCES: permission denied, mkdir '/app/browser_data/openai'

holzora commented 5 months ago

好吧,需要chmod挂载的目录,不过还是不能用

holzora commented 5 months ago

用了ChatGPTNextWeb “INFO: 192.168.160.3:33052 - "POST /v1/chat/completions?path=v1&path=chat&path=completions HTTP/1.1" 200 OK root@mail:/www/llm-web-api# docker logs 93b4fa4d6977 2024-05-28 14:49:07,724 - AppLogger - INFO - Start xvfb service INFO: Started server process [1] INFO: Waiting for application startup. 2024-05-28 14:49:12,972 - AppLogger - INFO - [OpenAILogin.begin] OpenAILogin start... ERROR: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 732, in lifespan async with self.lifespan_context(app) as maybe_state: File "/usr/lib/python3.10/contextlib.py", line 199, in aenter return await anext(self.gen) File "/app/llm/main.py", line 22, in lifespan await provider_manager.start_all() File "/app/llm/provider_manager.py", line 31, in start_all await crawler.start() File "/app/llm/provider/openai/core.py", line 68, in start await self.openai_client.post_init() File "/app/llm/provider/openai/client.py", line 49, in post_init await self.login() File "/app/llm/provider/openai/client.py", line 59, in login await login_obj.begin() File "/app/llm/provider/openai/login.py", line 27, in begin await self.bypass_cloudflare() File "/app/llm/provider/openai/login.py", line 36, in bypass_cloudflare challenge_form = await self.context_page.query_selector("#challenge-form") File "/usr/local/lib/python3.10/dist-packages/playwright/async_api/_generated.py", line 7737, in query_selector await self._impl_obj.query_selector(selector=selector, strict=strict) File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_page.py", line 380, in query_selector return await self._main_frame.query_selector(selector, strict) File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_frame.py", line 304, in query_selector await self._channel.send("querySelector", locals_to_params(locals())) File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_connection.py", line 59, in send return await self._connection.wrap_api_call( File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.Error: Page.query_selector: Execution context was destroyed, most likely because of a navigation

ERROR: Application startup failed. Exiting. 2024-05-28 14:49:18,515 - AppLogger - INFO - Start xvfb service INFO: Started server process [1] INFO: Waiting for application startup. 2024-05-28 14:49:23,858 - AppLogger - INFO - [OpenAILogin.begin] OpenAILogin start... 2024-05-28 14:49:29,393 - AppLogger - INFO - [OpenAILogin.login_by_email] start login 2024-05-28 14:49:34,880 - AppLogger - INFO - [OpenAILogin.login_by_email] finish login 2024-05-28 14:49:34,881 - AppLogger - INFO - [OpenAILogin.begin] OpenAILogin finished... INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:5000 (Press CTRL+C to quit) 2024-05-28 14:50:29,400 - AppLogger - INFO - [OpenAIClient.create_completion] Start chat_completion 2024-05-28 14:53:31,771 - AppLogger - ERROR - [OpenAIClient.chat_completion] Error happened Locator.click: Timeout 180000ms exceeded. Call log: waiting for locator("#prompt-textarea")

INFO: 192.168.160.3:56040 - "POST /v1/chat/completions?path=v1&path=chat&path=completions HTTP/1.1" 200 OK 2024-05-28 14:54:05,671 - AppLogger - INFO - [OpenAIClient.create_completion] Start chat_completion 2024-05-28 14:54:05,674 - AppLogger - INFO - [OpenAIClient.new_converstion] Start new_converstion INFO: 198.235.24.28:57327 - "GET / HTTP/1.0" 404 Not Found 2024-05-28 14:57:05,726 - AppLogger - ERROR - [OpenAIClient.chat_completion] Error happened Locator.click: Timeout 180000ms exceeded. Call log: waiting for locator("#prompt-textarea")

INFO: 192.168.160.3:33052 - "POST /v1/chat/completions?path=v1&path=chat&path=completions HTTP/1.1" 200 OK”

adryfish commented 5 months ago

看一下docker-compose.yml文件

holzora commented 5 months ago

看一下docker-compose.yml文件

就你提供的那个 version: '3.8'

services: chatgpt-next-web: image: yidadaa/chatgpt-next-web ports:

adryfish commented 5 months ago

你的USER-AGENT,OPENAI_LOGIN_EMAIL和OPENAI_LOGIN_PASSWORD都是有值的吗?

holzora commented 5 months ago

你的USER-AGENT,OPENAI_LOGIN_EMAIL和OPENAI_LOGIN_PASSWORD都是有值的吗?

是的

adryfish commented 5 months ago

20240529-004638 我这边尝试是可以的,用上方的docker-compose.yml文件,填入我自己的认证信息。

能否本地启动看看有什么问题?

holzora commented 5 months ago

能否本地启动看看有什么问题?

我另一台试试

holzora commented 5 months ago

能登录了,但是还是

holzora commented 5 months ago

莫名其妙好了...感谢