songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
16.47k stars 3.8k forks source link

无法访问到one-api #1415

Open luommy opened 2 months ago

luommy commented 2 months ago

例行检查

问题描述 使用docker-compose编排启动后无法访问连接到One-api3001,FastGPT3000却可以访问到,这点很奇怪 ; 我尝试排查端口、防火墙、容器日志并未发现问题; 系统:centOS7.9

其中one-api容器日志如下: 清一色的这种,个人感觉不像是影响访问的问题 FATAL] 2024/05/08 - 06:52:25 | [failed to get gpt-3.5-turbo token encoder: Get "https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken": dial tcp: lookup openaipublic.blob.core.windows.net on 127.0.0.11:53: server misbehaving] [SYS] 2024/05/08 - 06:52:25 | One API v0.6.6-alpha.15 started [SYS] 2024/05/08 - 06:52:25 | using MySQL as database [SYS] 2024/05/08 - 06:52:25 | database migration started [SYS] 2024/05/08 - 06:52:25 | database migrated [SYS] 2024/05/08 - 06:52:25 | REDIS_CONN_STRING not set, Redis is not enabled [SYS] 2024/05/08 - 06:52:25 | using theme default [SYS] 2024/05/08 - 06:52:25 | memory cache enabled [SYS] 2024/05/08 - 06:52:25 | sync frequency: 600 seconds [SYS] 2024/05/08 - 06:52:25 | channels synced from database [SYS] 2024/05/08 - 06:52:25 | batch update enabled with interval 10s [SYS] 2024/05/08 - 06:52:25 | initializing token encoders [SYS] 2024/05/08 - 06:52:35 | batch update started [SYS] 2024/05/08 - 06:52:35 | batch update finished [FATAL] 2024/05/08 - 06:52:41 | [failed to get gpt-3.5-turbo token encoder: Get "https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken": dial tcp: lookup openaipublic.blob.core.windows.net on 127.0.0.11:53: server misbehaving] [SYS] 2024/05/08 - 06:52:42 | One API v0.6.6-alpha.15 started [SYS] 2024/05/08 - 06:52:42 | using MySQL as database [SYS] 2024/05/08 - 06:52:42 | database migration started [SYS] 2024/05/08 - 06:52:42 | database migrated [SYS] 2024/05/08 - 06:52:42 | REDIS_CONN_STRING not set, Redis is not enabled [SYS] 2024/05/08 - 06:52:42 | using theme default [SYS] 2024/05/08 - 06:52:42 | memory cache enabled [SYS] 2024/05/08 - 06:52:42 | sync frequency: 600 seconds [SYS] 2024/05/08 - 06:52:42 | channels synced from database [SYS] 2024/05/08 - 06:52:42 | batch update enabled with interval 10s [SYS] 2024/05/08 - 06:52:42 | initializing token encoders [SYS] 2024/05/08 - 06:52:52 | batch update started [SYS] 2024/05/08 - 06:52:52 | batch update finished 复现步骤

预期结果

相关截图 image image

QAbot-zh commented 2 months ago

有个日志:[FATAL] 2024/05/08 - 06:52:41 | [failed to get gpt-3.5-turbo token encoder: Get "https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken": dial tcp: lookup openaipublic.blob.core.windows.net on 127.0.0.11:53: server misbehaving] 这是部署没成功啊,如果一直报这个编码器下载错误的话

luommy commented 2 months ago

有个日志:[FATAL] 2024/05/08 - 06:52:41 | [failed to get gpt-3.5-turbo token encoder: Get "https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken": dial tcp: lookup openaipublic.blob.core.windows.net on 127.0.0.11:53: server misbehaving]有个日志:[FATAL] 2024/05/08 - 06:52:41 |[无法获取 GPT-3.5-Turbo 令牌编码器:获取“https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken”:拨号 tcp:在 127.0.0.11:53 上查找 openaipublic.blob.core.windows.net:服务器行为异常] 这是部署没成功啊,如果一直报这个编码器下载错误的话

那这是为什么呢,我尝试了好几次都是一直报这个,我有仔细看过文档,如果没启动成功的话,添加--privileged=true可以解决吗? 但我看的#482和我报的问题并不一样

Lovening commented 1 month ago

image 我也有这个问题.... 解决这个是不是要去修改源码

luommy commented 1 month ago

tiktoken 改源码应该可以的,我没有尝试,我改的是配置,见可解决 image

luommy commented 1 month ago

image 我也有这个问题.... 解决这个是不是要去修改源码

这个确实挺坑的,对离线部署十分不友好,我也搞了好多天才弄好

songquanpeng commented 1 month ago

离线部署这个得后续优化了,确定会处理但是我时间比较紧张