[GH-ISSUE #24] 请问一下dokcer部署之后应该怎么操作啊 #23

Closed
opened 2026-02-27 07:17:27 +03:00 by kerem · 5 comments
Owner

Originally created by @djhdj1 on GitHub (Aug 7, 2025).
Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/24

以下是我的日志,我也跑rundocker.sh了有以下日志
未找到AWS SSO缓存目录: /home/ubuntu/.aws/sso/cache 注意:AWS SSO缓存目录不存在,Docker容器可能无法访问AWS凭证 未找到Gemini配置文件: /home/ubuntu/.gemini/oauth_creds.json 注意:Gemini配置文件不存在,Docker容器可能无法访问Gemini API
以下是运行docker的日志

[Config] Loaded configuration from config.json
[System Prompt] Specified system prompt file not found: /app/input_system_prompt.txt
[Initialization] Initializing service adapter for gemini-cli-oauth...
[Gemini] Initializing Gemini API Service...
[Initialization] Initializing service adapter for openai-custom...
[Initialization] Initializing service adapter for claude-custom...
[Initialization] Initializing service adapter for claude-kiro-oauth...
[Kiro] Initializing Gemini API Service...
[Kiro Auth] Attempting to load credentials from specified file: /home/nextjs/.aws/sso/cache/kiro-auth-token.json
--- Unified API Server Configuration ---
Model Provider: gemini-cli-oauth
Gemini OAuth Creds File Path: Default
Project ID: your-gcp-project-id
System Prompt File: /app/input_system_prompt.txt
System Prompt Mode: undefined
Host: 0.0.0.0

Port: 3000
Required API Key: 123456
Prompt Logging: console


Unified API Server running on http://0.0.0.0:3000
Supports multiple API formats:
• OpenAI-compatible: /v1/chat/completions, /v1/models
• Gemini-compatible: /v1beta/models, /v1beta/models/{model}:generateContent
• Claude-compatible: /v1/messages
• Health check: /health
[Kiro Auth] Credential file not found: /home/nextjs/.aws/sso/cache/kiro-auth-token.json
[Kiro Auth] Could not load credentials from specified file path: /home/nextjs/.aws/sso/cache/kiro-auth-token.json
[Kiro Auth] Attempting to load credentials from directory: /home/nextjs/.aws/sso/cache
[Kiro Auth] Region not found in credentials. Using default region us-east-1 for URLs.
Failed to initialize kiroApiService: Error: No access token available after initialization and refresh attempts.
at KiroApiService.initializeAuth (file:///app/src/claude/claude-kiro.js:440:15)
at async KiroApiService.initialize (file:///app/src/claude/claude-kiro.js:264:9)
[Gemini Auth] Failed to initialize authentication from file: Error: EISDIR: illegal operation on a directory, read
at async readFileHandle (node:internal/fs/promises:553:24)
at async GeminiApiService.initializeAuth (file:///app/src/gemini/gemini-core.js:77:26)
at async GeminiApiService.initialize (file:///app/src/gemini/gemini-core.js:44:9) {
errno: -21,
code: 'EISDIR',
syscall: 'read'
}
Failed to initialize geminiApiService: Error: Failed to load OAuth credentials.
at GeminiApiService.initializeAuth (file:///app/src/gemini/gemini-core.js:96:23)
at async GeminiApiService.initialize (file:///app/src/gemini/gemini-core.js:44:9)
8/7/2025, 9:22:50 AM
[Server] Received request: GET http://220.158.68.218:3128/
[Auth] Unauthorized request denied. Bearer: "N/A", Query Key: "null", x-goog-api-key: "undefined", x-api-key: "undefined"

Originally created by @djhdj1 on GitHub (Aug 7, 2025). Original GitHub issue: https://github.com/justlovemaki/AIClient-2-API/issues/24 以下是我的日志,我也跑rundocker.sh了有以下日志 `未找到AWS SSO缓存目录: /home/ubuntu/.aws/sso/cache 注意:AWS SSO缓存目录不存在,Docker容器可能无法访问AWS凭证 未找到Gemini配置文件: /home/ubuntu/.gemini/oauth_creds.json 注意:Gemini配置文件不存在,Docker容器可能无法访问Gemini API ` 以下是运行docker的日志 > [Config] Loaded configuration from config.json [System Prompt] Specified system prompt file not found: /app/input_system_prompt.txt [Initialization] Initializing service adapter for gemini-cli-oauth... [Gemini] Initializing Gemini API Service... [Initialization] Initializing service adapter for openai-custom... [Initialization] Initializing service adapter for claude-custom... [Initialization] Initializing service adapter for claude-kiro-oauth... [Kiro] Initializing Gemini API Service... [Kiro Auth] Attempting to load credentials from specified file: /home/nextjs/.aws/sso/cache/kiro-auth-token.json --- Unified API Server Configuration --- Model Provider: gemini-cli-oauth Gemini OAuth Creds File Path: Default Project ID: your-gcp-project-id System Prompt File: /app/input_system_prompt.txt System Prompt Mode: undefined Host: 0.0.0.0  Port: 3000 Required API Key: 123456 Prompt Logging: console ------------------------------------------ Unified API Server running on http://0.0.0.0:3000 Supports multiple API formats: • OpenAI-compatible: /v1/chat/completions, /v1/models • Gemini-compatible: /v1beta/models, /v1beta/models/{model}:generateContent • Claude-compatible: /v1/messages • Health check: /health [Kiro Auth] Credential file not found: /home/nextjs/.aws/sso/cache/kiro-auth-token.json [Kiro Auth] Could not load credentials from specified file path: /home/nextjs/.aws/sso/cache/kiro-auth-token.json [Kiro Auth] Attempting to load credentials from directory: /home/nextjs/.aws/sso/cache [Kiro Auth] Region not found in credentials. Using default region us-east-1 for URLs. Failed to initialize kiroApiService: Error: No access token available after initialization and refresh attempts. at KiroApiService.initializeAuth (file:///app/src/claude/claude-kiro.js:440:15) at async KiroApiService.initialize (file:///app/src/claude/claude-kiro.js:264:9) [Gemini Auth] Failed to initialize authentication from file: Error: EISDIR: illegal operation on a directory, read at async readFileHandle (node:internal/fs/promises:553:24) at async GeminiApiService.initializeAuth (file:///app/src/gemini/gemini-core.js:77:26) at async GeminiApiService.initialize (file:///app/src/gemini/gemini-core.js:44:9) { errno: -21, code: 'EISDIR', syscall: 'read' } Failed to initialize geminiApiService: Error: Failed to load OAuth credentials. at GeminiApiService.initializeAuth (file:///app/src/gemini/gemini-core.js:96:23) at async GeminiApiService.initialize (file:///app/src/gemini/gemini-core.js:44:9) 8/7/2025, 9:22:50 AM [Server] Received request: GET http://220.158.68.218:3128/ [Auth] Unauthorized request denied. Bearer: "N/A", Query Key: "null", x-goog-api-key: "undefined", x-api-key: "undefined"
kerem closed this issue 2026-02-27 07:17:28 +03:00
Author
Owner

@djhdj1 commented on GitHub (Aug 7, 2025):

请问大佬应该怎么使用,没搞懂

<!-- gh-comment-id:3163288463 --> @djhdj1 commented on GitHub (Aug 7, 2025): 请问大佬应该怎么使用,没搞懂
Author
Owner

@justlovemaki commented on GitHub (Aug 7, 2025):

用gemini cli,需要授权登陆后,生成授权的json,在系统目录:/home/ubuntu/.gemini/oauth_creds.json
用kiro,需要授权登陆后,生成授权的json,在系统目录:/home/ubuntu/.aws/sso/cache,里面有多个json
先授权有json配置后,才能docker部署去使用gemini cli,kiro

<!-- gh-comment-id:3163960132 --> @justlovemaki commented on GitHub (Aug 7, 2025): 用gemini cli,需要授权登陆后,生成授权的json,在系统目录:/home/ubuntu/.gemini/oauth_creds.json 用kiro,需要授权登陆后,生成授权的json,在系统目录:/home/ubuntu/.aws/sso/cache,里面有多个json 先授权有json配置后,才能docker部署去使用gemini cli,kiro
Author
Owner

@Promisey commented on GitHub (Dec 21, 2025):

是不是,意思是通过docker方式部署的话,
只能先在docker外主机上授权登录后,再在配置管理页面通过Base64编码的形式设置。
而没法在提供商池管理页面生成授权?我尝试在提供商池管理页面登录账号授权,选择账号、点击登录之后,显示:This site can’t be reached

<!-- gh-comment-id:3678647726 --> @Promisey commented on GitHub (Dec 21, 2025): 是不是,意思是通过docker方式部署的话, 只能先在docker外主机上授权登录后,再在配置管理页面通过Base64编码的形式设置。 而没法在提供商池管理页面生成授权?我尝试在提供商池管理页面登录账号授权,选择账号、点击登录之后,显示:This site can’t be reached
Author
Owner

@Promisey commented on GitHub (Dec 21, 2025):

然后遇到个问题,使用claude协议时,在Cheery Studio 跟Claude Code里面,都只能发信息,收不到回复。

使用OpenAI协议能正常使用。

AI2Client2API 日志显示:
[4:34:57 PM] [INFO] 12/21/2025, 8:34:57 AM
[4:34:57 PM] [INFO] [Server] Received request: POST http://localhost:8087/gemini-cli-oauth/v1/messages
[4:34:57 PM] [INFO] [Config] MODEL_PROVIDER overridden by path segment to: gemini-cli-oauth
[4:34:57 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined
[4:34:57 PM] [INFO] [Request Convert] Converting request from claude to gemini-cli-oauth
[4:34:57 PM] [INFO] [Content Generation] Model: gemini-2.5-flash, Stream: false
[4:34:57 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined
[4:34:57 PM] [INFO] [Content Generation] Re-selected service adapter based on model: gemini-2.5-flash
[4:34:57 PM] [INFO] [Auth Token] Time until expiry: 00h 20m 44s
[4:34:58 PM] [ERROR] [API] Error calling generateContent: 429 You have exhausted your capacity on this model. Your quota will reset after 38s.
[4:34:58 PM] [INFO] [API] Received 429 (Too Many Requests). Retrying in 5000ms... (attempt 1/31)
[4:35:02 PM] [ERROR] [API] Error during stream streamGenerateContent: 429 Request failed with status code 429
[4:35:02 PM] [INFO] [API] Received 429 (Too Many Requests) during stream. Retrying in 20000ms... (attempt 3/31)
[4:35:03 PM] [ERROR] [API] Error calling generateContent: 429 You have exhausted your capacity on this model. Your quota will reset after 33s.
[4:35:03 PM] [INFO] [API] Received 429 (Too Many Requests). Retrying in 10000ms... (attempt 2/31)
[4:35:08 PM] [INFO] 12/21/2025, 8:35:08 AM
[4:35:08 PM] [INFO] [Server] Received request: GET http://localhost:3000/health
[4:35:14 PM] [INFO] [Response Convert] Converting response from gemini-cli-oauth to claude
[4:35:16 PM] [INFO] 12/21/2025, 8:35:16 AM
[4:35:16 PM] [INFO] [Server] Received request: POST http://localhost:8087/gemini-cli-oauth/v1/messages
[4:35:16 PM] [INFO] [Config] MODEL_PROVIDER overridden by path segment to: gemini-cli-oauth
[4:35:16 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined
[4:35:16 PM] [INFO] [Request Convert] Converting request from claude to gemini-cli-oauth
[4:35:16 PM] [INFO] [Content Generation] Model: gemini-2.5-flash, Stream: false
[4:35:16 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined
[4:35:16 PM] [INFO] [Content Generation] Re-selected service adapter based on model: gemini-2.5-flash
[4:35:16 PM] [INFO] [Auth Token] Time until expiry: 00h 20m 24s
[4:35:17 PM] [ERROR] [API] Error calling generateContent: 429 You have exhausted your capacity on this model. Your quota will reset after 19s.
[4:35:17 PM] [INFO] [API] Received 429 (Too Many Requests). Retrying in 5000ms... (attempt 1/31)
[4:35:23 PM] [ERROR] [API] Error during stream streamGenerateContent: 429 Request failed with status code 429
[4:35:23 PM] [INFO] [API] Received 429 (Too Many Requests) during stream. Retrying in 40000ms... (attempt 4/31)

Cheery Studio报错:
错误名称: AI_TypeValidationError
错误信息: Type validation failed: Value: {"type":"error","message":{"type":"api_error","message":"{"type":"invalid_request_error","message":"request to https://oauth2.googleapis.com/token failed, reason: socket hang up"}"}}.
Error message: [
{
"expected": "object",
"code": "invalid_type",
"path": [
"error"
],
"message": "Invalid input"
}
]
堆栈信息: AI_TypeValidationError: Type validation failed: Value: {"type":"error","message":{"type":"api_error","message":"{"type":"invalid_request_error","message":"request to https://oauth2.googleapis.com/token failed, reason: socket hang up"}"}}.
Error message: [
{
"expected": "object",
"code": "invalid_type",
"path": [
"error"
],
"message": "Invalid input"
}
]
at _TypeValidationError$1.wrap (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:875:86)
at safeValidateTypes (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:4891:31)
at async safeParseJSON (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:4932:10)
at async Object.transform (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:4958:22)
错误原因: {
"name": "ZodError",
"message": "[\n {\n "expected": "object",\n "code": "invalid_type",\n "path": [\n "error"\n ],\n "message": "Invalid input"\n }\n]"
}

<!-- gh-comment-id:3678650254 --> @Promisey commented on GitHub (Dec 21, 2025): 然后遇到个问题,使用claude协议时,在Cheery Studio 跟Claude Code里面,都只能发信息,收不到回复。 使用OpenAI协议能正常使用。 AI2Client2API 日志显示: [4:34:57 PM] [INFO] 12/21/2025, 8:34:57 AM [4:34:57 PM] [INFO] [Server] Received request: POST http://localhost:8087/gemini-cli-oauth/v1/messages [4:34:57 PM] [INFO] [Config] MODEL_PROVIDER overridden by path segment to: gemini-cli-oauth [4:34:57 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined [4:34:57 PM] [INFO] [Request Convert] Converting request from claude to gemini-cli-oauth [4:34:57 PM] [INFO] [Content Generation] Model: gemini-2.5-flash, Stream: false [4:34:57 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined [4:34:57 PM] [INFO] [Content Generation] Re-selected service adapter based on model: gemini-2.5-flash [4:34:57 PM] [INFO] [Auth Token] Time until expiry: 00h 20m 44s [4:34:58 PM] [ERROR] [API] Error calling generateContent: 429 You have exhausted your capacity on this model. Your quota will reset after 38s. [4:34:58 PM] [INFO] [API] Received 429 (Too Many Requests). Retrying in 5000ms... (attempt 1/31) [4:35:02 PM] [ERROR] [API] Error during stream streamGenerateContent: 429 Request failed with status code 429 [4:35:02 PM] [INFO] [API] Received 429 (Too Many Requests) during stream. Retrying in 20000ms... (attempt 3/31) [4:35:03 PM] [ERROR] [API] Error calling generateContent: 429 You have exhausted your capacity on this model. Your quota will reset after 33s. [4:35:03 PM] [INFO] [API] Received 429 (Too Many Requests). Retrying in 10000ms... (attempt 2/31) [4:35:08 PM] [INFO] 12/21/2025, 8:35:08 AM [4:35:08 PM] [INFO] [Server] Received request: GET http://localhost:3000/health [4:35:14 PM] [INFO] [Response Convert] Converting response from gemini-cli-oauth to claude [4:35:16 PM] [INFO] 12/21/2025, 8:35:16 AM [4:35:16 PM] [INFO] [Server] Received request: POST http://localhost:8087/gemini-cli-oauth/v1/messages [4:35:16 PM] [INFO] [Config] MODEL_PROVIDER overridden by path segment to: gemini-cli-oauth [4:35:16 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined [4:35:16 PM] [INFO] [Request Convert] Converting request from claude to gemini-cli-oauth [4:35:16 PM] [INFO] [Content Generation] Model: gemini-2.5-flash, Stream: false [4:35:16 PM] [INFO] [Adapter] getServiceAdapter, provider: gemini-cli-oauth, uuid: undefined [4:35:16 PM] [INFO] [Content Generation] Re-selected service adapter based on model: gemini-2.5-flash [4:35:16 PM] [INFO] [Auth Token] Time until expiry: 00h 20m 24s [4:35:17 PM] [ERROR] [API] Error calling generateContent: 429 You have exhausted your capacity on this model. Your quota will reset after 19s. [4:35:17 PM] [INFO] [API] Received 429 (Too Many Requests). Retrying in 5000ms... (attempt 1/31) [4:35:23 PM] [ERROR] [API] Error during stream streamGenerateContent: 429 Request failed with status code 429 [4:35:23 PM] [INFO] [API] Received 429 (Too Many Requests) during stream. Retrying in 40000ms... (attempt 4/31) Cheery Studio报错: 错误名称: AI_TypeValidationError 错误信息: Type validation failed: Value: {"type":"error","message":{"type":"api_error","message":"{\"type\":\"invalid_request_error\",\"message\":\"request to https://oauth2.googleapis.com/token failed, reason: socket hang up\"}"}}. Error message: [ { "expected": "object", "code": "invalid_type", "path": [ "error" ], "message": "Invalid input" } ] 堆栈信息: AI_TypeValidationError: Type validation failed: Value: {"type":"error","message":{"type":"api_error","message":"{\"type\":\"invalid_request_error\",\"message\":\"request to https://oauth2.googleapis.com/token failed, reason: socket hang up\"}"}}. Error message: [ { "expected": "object", "code": "invalid_type", "path": [ "error" ], "message": "Invalid input" } ] at _TypeValidationError$1.wrap (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:875:86) at safeValidateTypes (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:4891:31) at async safeParseJSON (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:4932:10) at async Object.transform (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DFUFcu2x.js:4958:22) 错误原因: { "name": "ZodError", "message": "[\n {\n \"expected\": \"object\",\n \"code\": \"invalid_type\",\n \"path\": [\n \"error\"\n ],\n \"message\": \"Invalid input\"\n }\n]" }
Author
Owner

@justlovemaki commented on GitHub (Dec 21, 2025):

429

<!-- gh-comment-id:3678880363 --> @justlovemaki commented on GitHub (Dec 21, 2025): 429
Sign in to join this conversation.
No labels
pull-request
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
starred/AIClient-2-API-justlovemaki#23
No description provided.