Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows服务器部署] 在公网IP上部署失败 #132

Closed
LinLuosheng opened this issue Mar 12, 2023 · 6 comments · Fixed by #149
Closed

[Windows服务器部署] 在公网IP上部署失败 #132

LinLuosheng opened this issue Mar 12, 2023 · 6 comments · Fixed by #149
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@LinLuosheng
Copy link

感谢提交 issue! 请尽可能完整填写以下信息,帮助我们更好地定位问题~
如果你不知道怎么填写,请先点击编辑框上方的“Preview”在预览中查看我们的说明,然后点击“Write”在空白行处填写信息~

错误描述

我公网服务器上请求ws://127.0.0.1:17860/queue/join是可以正常访问的,但请求ws://公网ip:17860/queue/join就失败,这是为什么

复现操作

你之前干了什么,然后出现了错误呢?例如:
配置了nginx

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;
map $http_upgrade $connection_upgrade {
default upgrade;
    ''      close;
}
server {
listen 80;
server_name localhost;   # 请填入你设定的域名
access_log off;
error_log off;
location / {
	proxy_pass http://127.0.0.1:17860;   # 注意端口号
	proxy_redirect off;
	proxy_set_header Host $host;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header Upgrade $http_upgrade;		# Websocket配置
	proxy_set_header Connection $connection_upgrade;		#Websocket配置
	proxy_max_temp_file_size 0;
	client_max_body_size 10m;
	client_body_buffer_size 128k;
	proxy_connect_timeout 90;
	proxy_send_timeout 90;
	proxy_read_timeout 90;
	proxy_buffer_size 4k;
	proxy_buffers 4 32k;
	proxy_busy_buffers_size 64k;
	proxy_temp_file_write_size 64k;
}

}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}


# HTTPS server
#
#server {
#    listen       443 ssl;
#    server_name  localhost;

#    ssl_certificate      cert.pem;
#    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
#    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
#    ssl_prefer_server_ciphers  on;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

}

@LinLuosheng LinLuosheng added the question Further information is requested label Mar 12, 2023
@LinLuosheng
Copy link
Author

发现问题了,是设置了密码就不行了,这是为什么

@Keldos-Li Keldos-Li changed the title [window服务器部署] 简短的错误描述 [Windows服务器部署] 在公网IP上部署失败 Mar 12, 2023
@LinLuosheng
Copy link
Author

已解决

@Keldos-Li Keldos-Li added the duplicate This issue or pull request already exists label Mar 14, 2023
@Keldos-Li
Copy link
Collaborator

@Keldos-Li Keldos-Li linked a pull request Mar 14, 2023 that will close this issue
@LinLuosheng
Copy link
Author

今天突然一只报错
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\gradio\routes.py", line 393, in run_predict
output = await app.get_blocks().process_api(
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\gradio\blocks.py", line 1059, in process_api
result = await self.call_function(
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\gradio\blocks.py", line 882, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\gradio\utils.py", line 549, in async_iteration
return next(iterator)
File "D:\project\python\ChatGPT\utils.py", line 197, in predict
for chatbot, history, status_text, token_count in iter:
File "D:\project\python\ChatGPT\utils.py", line 141, in stream_predict
response = get_response(openai_api_key, system_prompt, history, temperature, top_p, True)
File "D:\project\python\ChatGPT\utils.py", line 129, in get_response
response = requests.post(API_URL, headers=headers, json=payload, stream=True, timeout=timeout)
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "C:\Users\48242\AppData\Roaming\Python\Python38\site-packages\requests\adapters.py", line 578, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=5)

@Nativu5
Copy link
Contributor

Nativu5 commented Mar 15, 2023

Read timed out. (read timeout=5) 像是请求 OpenAI 超时了。

@Keldos-Li
Copy link
Collaborator

其他与原主题无关的疑问或问题反馈请在新的issue中讨论。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants