Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

求教大佬们,运行报错:原因: {"code":429,"message":"解析服务器: 请求过于频繁!"} #5

Closed
TaoRone opened this issue Apr 1, 2023 · 8 comments

Comments

@TaoRone
Copy link

TaoRone commented Apr 1, 2023

运行模式:
宝塔面板,先部署docker后,从宝塔面板进行反代
相关设置:
未在proxy/certs/放证书
docker-compose 更改设置:

    # 映射端口:容器端口
    ports:
      - 7096:7095

docker-compose-http 更改设置:

    # 映射端口:容器端口
    ports:
      - 7096:7095

config/config.yml 更改设置:

    # 监听端口
port: 7095

运行后无论是ip:7096还是反代的域名均可正常显示此页面:
图1
B站脚本测速正常

但是使用解锁B站番剧会报错:
图2

docker日志如下:
{"level":"info","ts":1680364906.3190937,"caller":"builder/main.go:233","msg":"Version: 2.25.1"}
{"level":"fatal","ts":1680364906.3333013,"caller":"builder/main.go:278","msg":"pq: the database system is starting up","stacktrace":"main.main\n\t/tmp/builder/main.go:278\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
{"level":"info","ts":1680364908.0177362,"caller":"builder/main.go:233","msg":"Version: 2.25.1"}
{"level":"fatal","ts":1680364908.0374112,"caller":"builder/main.go:278","msg":"pq: the database system is starting up","stacktrace":"main.main\n\t/tmp/builder/main.go:278\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
{"level":"info","ts":1680364909.6792326,"caller":"builder/main.go:233","msg":"Version: 2.25.1"}
{"level":"fatal","ts":1680364909.6885643,"caller":"builder/main.go:278","msg":"pq: the database system is starting up","stacktrace":"main.main\n\t/tmp/builder/main.go:278\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
{"level":"info","ts":1680364911.3588006,"caller":"builder/main.go:233","msg":"Version: 2.25.1"}
Applied 0 migrations!
{"level":"info","ts":1680364911.4382117,"caller":"builder/main.go:209","msg":"Listening on :7095 ..."}
2023/04/01 16:02:41 0.000 #0000000200000001 - 172.18.0.3:7095<->138.2.90.*:30094 - GET http://******我的IP:7096/favicon.ico - cannot open file "/runner/html/favicon.ico": open /runner/html/favicon.ico: no such file or directory
2023/04/01 16:03:00 0.000 #0000000400000001 - 172.18.0.3:7095<->172.18.0.1:56506 - GET http://我的域名/favicon.ico - cannot open file "/runner/html/favicon.ico": open /runner/html/favicon.ico: no such file or directory

已尝试操作:
将容器内端口还原为80
将映射文件权限给777
修改反代配置
无果

猜测:
是不是宝塔面板的反代的配置少了这其中的部分配置?

server {
    # https
    listen  443 ssl;
    listen  [::]:443 ssl;

    server_name         bili.example.com;

    # 证书
    ssl_certificate     /etc/nginx/certs/site.crt;
    ssl_certificate_key /etc/nginx/certs/site.key;

    # 限制客户端请求大小
    client_max_body_size 1M;

    # 获取 CLOUDFLARE 真实 IP
    # https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs
    # https://www.cloudflare.com/ips/
    # ipv4
    set_real_ip_from    173.245.48.0/20;
    set_real_ip_from    103.21.244.0/22;
    set_real_ip_from    103.22.200.0/22;
    set_real_ip_from    103.31.4.0/22;
    set_real_ip_from    141.101.64.0/18;
    set_real_ip_from    108.162.192.0/18;
    set_real_ip_from    190.93.240.0/20;
    set_real_ip_from    188.114.96.0/20;
    set_real_ip_from    197.234.240.0/22;
    set_real_ip_from    198.41.128.0/17;
    set_real_ip_from    162.158.0.0/15;
    set_real_ip_from    172.64.0.0/13;
    set_real_ip_from    131.0.72.0/22;
    set_real_ip_from    104.16.0.0/13;
    set_real_ip_from    104.24.0.0/14;
    # ipv6
    set_real_ip_from    2400:cb00::/32;
    set_real_ip_from    2606:4700::/32;
    set_real_ip_from    2803:f800::/32;
    set_real_ip_from    2405:b500::/32;
    set_real_ip_from    2405:8100::/32;
    set_real_ip_from    2a06:98c0::/29;
    set_real_ip_from    2c0f:f248::/32;

    # 2 选 1
    real_ip_header CF-Connecting-IP;
    # real_ip_header X-Forwarded-For;

    location / {
        proxy_pass  http://127.0.0.1:80;
    }
}

请求大佬们解答,十分感谢!

@JasonKhew96
Copy link
Owner

没看出问题,设置 limiter 调高就可以了

@TaoRone
Copy link
Author

TaoRone commented Apr 2, 2023

没看出问题,设置 limiter 调高就可以了

emmm原来的图床没设置好,重新设置了下

我又重建了一下:
调高后,出现了和之前某个issue一样的问题,网页版使用提示“解析服务器: 账号未登录”,且LS版漫游直接为“加载失败”提示,
日志和之前一样:

{"level":"info","ts":1680412063.2199976,"caller":"builder/main.go:233","msg":"Version: 2.25.1"}
{"level":"fatal","ts":1680412063.231237,"caller":"builder/main.go:278","msg":"pq: the database system is starting up","stacktrace":"main.main\n\t/tmp/builder/main.go:278\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
{"level":"info","ts":1680412064.673613,"caller":"builder/main.go:233","msg":"Version: 2.25.1"}
{"level":"fatal","ts":1680412064.683624,"caller":"builder/main.go:278","msg":"pq: the database system is starting up","stacktrace":"main.main\n\t/tmp/builder/main.go:278\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
{"level":"info","ts":1680412066.1070106,"caller":"builder/main.go:233","msg":"Version: 2.25.1"}
Applied 0 migrations!
{"level":"info","ts":1680412066.1459095,"caller":"builder/main.go:209","msg":"Listening on :7095 ..."}
2023/04/02 05:07:57 0.000 #0000000200000001 - 172.18.0.3:7095<->172.18.0.1:38654 - GET http://bili2-hh.hk.taor.fun/favicon.ico - cannot open file "/runner/html/favicon.ico": open /runner/html/favicon.ico: no such file or directory

不过奇怪的是,172.18.0.3:7095<->172.18.0.1:38654 这地址转发中,我没有172.18.0.1的docker子地址啊……
图片

宝塔反代配置:


#PROXY-START/

location /
{
    proxy_pass http://127.0.0.1:7096;
    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 REMOTE-HOST $remote_addr;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_http_version 1.1;
    # proxy_hide_header Upgrade;

    add_header X-Cache $upstream_cache_status;
    #Set Nginx Cache

    set $static_file5rms5JW6 0;
    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
    {
        set $static_file5rms5JW6 1;
        expires 1m;
    }
    if ( $static_file5rms5JW6 = 0 )
    {
        add_header Cache-Control no-cache;
    }
}
#PROXY-END/

@JasonKhew96
Copy link
Owner

JasonKhew96 commented Apr 2, 2023

网页版 授权登录 再试试
哔哩漫游 从 出差 动态里 进去 试试

( 别看宝塔了,你的页面都能正常加载

@TaoRone
Copy link
Author

TaoRone commented Apr 2, 2023

谢谢大大大中午的提醒解惑~~

客户端从出差的动态进去,同样是账号未登录提示………………
网页版使用的解除B站区域限制脚本,账号授权没问题,没有报错顺利通过,但是取消授权时会报错……
猜测一是账号授权有问题?
二是同时搭建的PHP网页版漫游解析服务器有冲突?(都用docker了,应该没啥问题啊……)
tmp59C5

@JasonKhew96
Copy link
Owner

那就不知道了,得开 调试模式, 会打印很详细的日志,记得打码

@TaoRone
Copy link
Author

TaoRone commented Apr 2, 2023

那就不知道了,得开 调试模式, 会打印很详细的日志,记得打码

谢谢大大提醒
日志内容看起来好像没啥问题……已将日志涉及的部分key去除了几个字符

已确认漫游和b站为最新版



2023-04-02T10:12:15.442Z	DEBUG	builder/httpClient.go:66	New socks proxy client: socks5://127.0.0.1:7890
2023-04-02T10:12:15.442Z	DEBUG	builder/httpClient.go:66	New socks proxy client: socks5://127.0.0.1:7891
2023-04-02T10:12:15.442Z	DEBUG	builder/httpClient.go:66	New socks proxy client: socks5://127.0.0.1:7892
2023-04-02T10:12:15.442Z	DEBUG	builder/httpClient.go:66	New socks proxy client: socks5://127.0.0.1:7893
2023-04-02T10:12:15.442Z	DEBUG	builder/httpClient.go:66	New socks proxy client: socks5://127.0.0.1:7894
Applied 0 migrations!
2023-04-02T10:12:15.488Z	INFO	builder/main.go:209	Listening on :80 ...
2023-04-02T10:12:15.491Z	DEBUG	builder/main.go:95	Cleaning database...
2023-04-02T10:12:15.497Z	DEBUG	builder/main.go:109	Cleanup 0 playURL cache
2023-04-02T10:12:15.499Z	DEBUG	builder/main.go:114	Cleanup 0 TH season cache
2023-04-02T10:12:15.500Z	DEBUG	builder/main.go:119	Cleanup 0 TH season cache
DELETE FROM "play_url_caches" WHERE ("play_url_caches"."updated_at" <= $1);
[2023-04-02 09:57:15.49186609 +0000 UTC]
DELETE FROM "th_season_caches" WHERE ("th_season_caches"."updated_at" <= $1);
[2023-04-02 09:57:15.497754406 +0000 UTC]
DELETE FROM "th_season2_caches" WHERE ("th_season2_caches"."updated_at" <= $1);
[2023-04-02 09:57:15.499374748 +0000 UTC]
DELETE FROM "th_subtitle_caches" WHERE ("th_subtitle_caches"."updated_at" <= $1);
[2023-04-02 09:57:15.501050243 +0000 UTC]
2023-04-02T10:12:15.504Z	DEBUG	builder/main.go:124	Cleanup 0 TH subtitle cache
2023-04-02T10:12:49.840Z	DEBUG	builder/utils.go:457	Request args access_key=565fe771c5b9fc585cfb1e3ba56f842&appkey=1d8b6e7d45233436&area=hk&build=7180300&cid=107774118&device=android&ep_id=743025&fnval=976&fnver=0&force_host=0&fourk=0&mobi_app=android&platform=android&qn=32&ts=1680430368&sign=3b8b809195c0f656afa0dfb59b2afb02
2023-04-02T10:12:49.841Z	DEBUG	builder/utils.go:458	Parsed request args: &{565fe771c5b9fc3585cfb1e3ba56f842 hk 1077744118 743025 0  0 0 32 0 976 1d8b6e7d45233436 1680430368 3b8b809195c0f656afa0dfb9b2afb02}
SELECT "episode_area_caches".* FROM "episode_area_caches" WHERE ("episode_area_caches"."episode_id" = $1) LIMIT 1;
[743025]
SELECT "users".* FROM "users" INNER JOIN access_keys ON access_keys.uid = users.uid WHERE ("access_keys"."key" = $1) LIMIT 1;
[565fe771c5b9fc3585cfb1e3b56f842]
2023-04-02T10:12:49.857Z	DEBUG	builder/auth.go:173	https://app.bilibili.com/x/v2/account/myinfo?access_key=565fe771c5b9fc3585cfb1e3b56f842&appkey=1d8b6e7d45233436&sign=1714243118d4b081fa1f8b6704a11953&ts=1680430369
2023-04-02T10:12:49.857Z	DEBUG	builder/httpClient.go:306	doRequest: https://app.bilibili.com/x/v2/account/myinfo?access_key=565fe771c5b9fc3585cfb1e3ba6f842&appkey=1d8b6e7d45233436&sign=1714243118d4b081fa1f8b6704a11953&ts=1680430369
2023-04-02T10:12:54.043Z	DEBUG	builder/utils.go:457	Request args access_key=565fe771c5b9fc355cfb1e3ba56f842&appkey=1d8b6e7d45233436&area=hk&build=7180300&cid=1077744305&device=android&ep_id=743026&fnval=976&fnver=0&force_host=0&fourk=0&mobi_app=android&platform=android&qn=32&ts=1680430372&sign=cd1399da7b86cf186af08d9a67ff882e
2023-04-02T10:12:54.043Z	DEBUG	builder/utils.go:458	Parsed request args: &{565fe771c5b9fc3585cfb1e3ba56f842 hk 1077744305 743026 0  0 0 32 0 976 1d8b6e7d45233436 1680430372 cd1399da7b86cf186af08d9a67ff882e}
SELECT "episode_area_caches".* FROM "episode_area_caches" WHERE ("episode_area_caches"."episode_id" = $1) LIMIT 1;
[743026]
2023-04-02T10:12:54.645Z	DEBUG	builder/utils.go:457	Request args access_key=565fe771c5b9fc3585fb1e3ba56f842&appkey=1d8b6e7d45233436&area=hk&build=7180300&cid=570482550&device=android&ep_id=476242&fnval=976&fnver=0&force_host=0&fourk=0&mobi_app=android&platform=android&qn=32&ts=1680430373&sign=0130d6ee948b7ca22ff83a90b24eceae
2023-04-02T10:12:54.646Z	DEBUG	builder/utils.go:458	Parsed request args: &{565fe771c5b9fc3585cfb1eba56f842 hk 570482550 476242 0  0 0 32 0 976 1d8b6e7d45233436 1680430373 0130d6ee948b7ca22ff83a90b24eceae}
SELECT "episode_area_caches".* FROM "episode_area_caches" WHERE ("episode_area_caches"."episode_id" = $1) LIMIT 1;
[476242]
2023-04-02T10:12:55.858Z	DEBUG	builder/utils.go:457	Request args access_key=565fe771c5b9fc358cfb1e3ba56f842&appkey=1d8b6e7d45233436&area=hk&build=7180300&cid=570482550&device=android&ep_id=476242&fnval=976&fnver=0&force_host=0&fourk=0&mobi_app=android&platform=android&qn=32&ts=1680430374&sign=c28a803e245558dc91f6bd5a7d83e6bf
2023-04-02T10:12:55.858Z	DEBUG	builder/utils.go:458	Parsed request args: &{565fe771c5b9fc3585cfb1eba56f842 hk 570482550 476242 0  0 0 32 0 976 1d8b6e7d45233436 1680430374 c28a803e245558dc91f6bd5a7d83e6bf}
SELECT "episode_area_caches".* FROM "episode_area_caches" WHERE ("episode_area_caches"."episode_id" = $1) LIMIT 1;
[476242]


@JasonKhew96
Copy link
Owner

我怀疑根本没连上代理 (socks5)

@TaoRone
Copy link
Author

TaoRone commented Apr 2, 2023

我怀疑根本没连上代理 (socks5)

卧槽!!!一语惊醒梦中人!!!
我还以为是docker里自己另起了一套sock5代理……原来还是要跑我自己的部署的代理啊……

那也就是说,如果我要用港澳台东南亚等地的解锁,就每个地区部署sock5或者http代理,给到配置,如果没有这些地方的代理,或者我直接注释即可对么!

原来如此!明白了哈哈哈哈哈,谢谢大大,打扰了您一天

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants