Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

启动成功了,但是请求api 的文档返回的是如下信息

Open griftt opened this issue 11 months ago • 4 comments

启动成功了,但是请求api文档页面返回了如下的错误信息:Invalid request url: /docs,补充一下,我访问web-ui是能正常打开的

griftt avatar Mar 03 '24 12:03 griftt

Based on a similar issue found in the Langchain-Chatchat repository, it seems that the error message "Invalid request url: /docs" might be related to the local network environment. You can check your network environment and update to the latest code to see if the issue persists. If it does, you can consider reopening the issue for further assistance. Here is the link to the similar issue: 启动api服务以后出现Invalid request url: /docs.

However, another possible reason for this error could be due to the FastAPI application being configured to run in an offline mode, which disables the automatic generation of the documentation pages (Swagger UI and ReDoc). This is done by the MakeFastAPIOffline(app) function call in the create_app function in the server/api.py file.

To resolve this, you could either remove or comment out the MakeFastAPIOffline(app) call in the create_app function, or modify the MakeFastAPIOffline function's implementation to not disable the documentation endpoints. This would depend on your application's requirements and the behavior of the MakeFastAPIOffline function. Here is the link to the relevant code: server/api.py.

Unfortunately, I wasn't able to find the exact function of MakeFastAPIOffline(app) in the server/api.py file within the repository. It might be beneficial to look into this function further to understand its exact behavior and how it might be affecting the availability of the documentation endpoints.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Mar 03 '24 12:03 dosubot[bot]

我也遇到一样的问题

loveHao avatar Mar 08 '24 01:03 loveHao

我也是 报错是 GET http://region-9.autodl.pro:43612/static-offline-docs/swagger-ui.css net::ERR_ABORTED 404 (Not Found) docs:12 GET http://region-9.autodl.pro:43612/static-offline-docs/swagger-ui-bundle.js net::ERR_ABORTED 404 (Not Found) docs:15 Uncaught ReferenceError: SwaggerUIBundle is not defined 看起来是找不到css js

302658980 avatar Mar 11 '24 07:03 302658980

我也遇到这个问题了,请问你解决了吗?我使用dsw部署的,webui也是正常,但是 Chatchat API Server: http://127.0.0.1:7861 点进去就是Invalid request url: /docs ,没有报错,响应就是这几个字符串

New-King avatar Mar 11 '24 10:03 New-King

我也遇到这个问题了,请问你解决了吗?我使用dsw部署的,webui也是正常,但是 Chatchat API Server: http://127.0.0.1:7861 点进去就是Invalid request url: /docs ,没有报错,响应就是这几个字符串

一样 请问有找到解决方案吗

如果是dsw部署可以试试我的解决办法 https://github.com/chatchat-space/Langchain-Chatchat/issues/3435#issuecomment-2008618078

chenxin03 avatar Mar 20 '24 02:03 chenxin03

我也遇到这个问题了,请问你解决了吗?我使用dsw部署的,webui也是正常,但是 Chatchat API Server: http://127.0.0.1:7861 点进去就是Invalid request url: /docs ,没有报错,响应就是这几个字符串

一样 请问有找到解决方案吗

如果是dsw部署可以试试我的解决办法 #3435 (comment)

👍👍👍

New-King avatar Mar 25 '24 02:03 New-King