Closed Nigel-NI closed 6 months ago
退出登录后重试呢?如果还是403的话开启DEBUG模式看一下日志,同时截一下失败截图
退出登录后问题依旧存在;尝试使用无痕模式登录后台,问题仍出现。
完整日志如下:
2024-02-15T03:18:57.425337382Z get_mempolicy: Operation not permitted
2024-02-15T03:18:59.628373790Z [I 240215 11:18:59 QD.Worker worker:324] Queue Worker start...
2024-02-15T03:18:59.631065703Z [I 240215 11:18:59 QD.Run run:87] Http Server started on 0.0.0.0:80
2024-02-15T03:19:00.397607702Z [I 240215 11:19:00 tornado.access web:2348] 200 GET / (172.21.0.1) 371.64ms
2024-02-15T03:19:00.723636800Z [I 240215 11:19:00 tornado.access web:2348] 200 GET /static/components/bootstrap/dist/css/bootstrap.min.css?v=ef14562e5768b4786d9d072b0b8e3268c511b3770c1f1829adc9afb6f7d98f0165d5b2bf19a82b55b50f6390d8ee844cb4954f1d47c7ab1d11497d4fa7618309 (172.21.0.1) 12.20ms
2024-02-15T03:19:00.725947022Z [I 240215 11:19:00 tornado.access web:2348] 200 GET /static/components/select2/dist/css/select2.min.css?v=9cc365a6e6833ebaa5125b37217fd0e7a1f7eaabc1012c1bde2a6ea373317966ec401d7cf35a31d1c46fed43d380196b8aaa329eddf92a313080651e51720f9f (172.21.0.1) 1.63ms
2024-02-15T03:19:00.896663726Z [I 240215 11:19:00 tornado.access web:2348] 200 GET /static/css/base.css?v=7a308851c611db7709f298432da16f6ad7694b7539dc8aeef03aae55adb064a9c569c32e013508236c5716caeb354da6f4c6f8c485c891358cc355b1d26de0c1 (172.21.0.1) 1.51ms
2024-02-15T03:19:00.899012208Z [I 240215 11:19:00 tornado.access web:2348] 200 GET /static/components/nprogress/nprogress.css?v=0da9dfc5605ab10b6af91b643401034dd5f843a04f08943f91ec62fd17ed70fd01700e0d2093d28bb8b7d5597e625e4e09f81991d2660aacfe6f24ce20845ba1 (172.21.0.1) 1.41ms
2024-02-15T03:19:00.907319338Z [I 240215 11:19:00 tornado.access web:2348] 200 GET /static/css/index.css?v=7e85f1709d421092a9dea1d5c2cd4a2944961673c059f6ae9ec56207e4a9a594b9f1f5f16800b106255e89f816e3d430bd6c1fe6125e7fae17a2af9c7288e0ba (172.21.0.1) 1.61ms
2024-02-15T03:19:00.935009901Z [I 240215 11:19:00 tornado.access web:2348] 200 GET /static/components/jquery.tablesorter/css/theme.bootstrap_3.css?v=4401edef542ea392d36d224ef9e3fa4754e6251625e1c0d4cdd4c65d147df2516190f95d9a1e00f575ed5c9b98df6483047bc18b3ae5b0af81c3a7a4d70b80ce (172.21.0.1) 14.29ms
2024-02-15T03:19:00.944104145Z [I 240215 11:19:00 tornado.access web:2348] 200 GET /static/components/Font-Awesome/css/all.min.css?v=89e71d2e66ac925ec2564aa45cd43f647fd72e5bd664e2728fb632eed71e9e6a43d72a404a8ce9993fc4d223ed985201e3a66676d01cf5e341bc7d07fd9a6207 (172.21.0.1) 6.93ms
2024-02-15T03:19:01.091774005Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/jquery/dist/jquery.min.js?v=de027062931edd07b01842eff24fc15fdbdcaa1af245dcd133155faba9e0c965f0a34dc6144ce3b149bc43b4597073c792cb6dabbfc6168c63095523923bcf77 (172.21.0.1) 6.75ms
2024-02-15T03:19:01.095640736Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/seajs/dist/sea.js?v=9aa0c0ac1ef4607ada5ebd1e7c3118ad06ad06f91a261296be907ec8fa057ea1e81ff754bb2841979a0e4ae5ab410e0f7be7705feb86a108e84784a2f7660ea6 (172.21.0.1) 1.93ms
2024-02-15T03:19:01.105216319Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/select2/dist/js/select2.full.min.js?v=65ab44d85b09e8f383f00c298239a1ae944b9b452dea7e450889dfa4a1aee11861b380d51ff5551b56b526f86f14f856becf1537d1afc005e0c09a3d3e2b5090 (172.21.0.1) 5.66ms
2024-02-15T03:19:01.105253868Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/bootstrap/dist/js/bootstrap.min.js?v=3f1b46e9ea0fb6be507605a2783af406c6b4f885dedaa4401bff204b0fe9056656717411021594e2512e98a4e398e3238267a7deafeba1b57e443decab0477ea (172.21.0.1) 7.92ms
2024-02-15T03:19:01.130931434Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/nprogress/nprogress.js?v=fc2cdc3cb3aa52775324a95627e3e4bc587611346d92b9f1c2650bafd2ec514f9c14b97b4c0391e60c300fc0d12efb4ce21e647bf19092796a41b5ae4fd04a74 (172.21.0.1) 2.31ms
2024-02-15T03:19:01.364718133Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/jquery.tablesorter/dist/js/jquery.tablesorter.widgets.min.js?v=763ffd2b919120466ef88826f6d0b5e973ce4f3d1174f93d146c5f6714a159feb9249354d938db1251a3b8ea37121c002513e1271c042796fefceba8f95a9975 (172.21.0.1) 3.99ms
2024-02-15T03:19:01.391436249Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/lunar-javascript/lunar.js?v=1ef4867dd8bcbc8a6505cedc361c63d47addb1f6ac368408f644637a4c04cb99f1d6e160488ddcd2e3ddf062af090d7601e7f1939c66ac4b30626fb6e8249396 (172.21.0.1) 25.77ms
2024-02-15T03:19:01.393723917Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/clipboard/dist/clipboard.min.js?v=ecee695e9734a0246bc64f1151f0d81609f49ced6dfa32ee20e41d38c469e003c1eee678bd28eca73a79cba603b43b385735124db5b304567f2ca2619f214e2b (172.21.0.1) 1.95ms
2024-02-15T03:19:01.397587426Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/jquery.tablesorter/dist/js/jquery.tablesorter.min.js?v=ab381de5c61265ca2caa9ce99fbcc5d9921df1fffc087985299f23ee65383945d335177983e64704fb20284c28ab10ad750bc4c44e4ba6bc303c082889c82e36 (172.21.0.1) 3.18ms
2024-02-15T03:19:01.399619482Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/components/blueimp-md5/js/md5.js?v=3697eb404833384c52d40c7c7e32132ab80114af3b9596c19af59d664e2cba2082e2db073eb4c2b2e960200ed9ffe09e5a10e910ffdfdfa98d5a06570cab5300 (172.21.0.1) 1.72ms
2024-02-15T03:19:01.956571396Z [I 240215 11:19:01 tornado.access web:2348] 200 GET /static/img/body.jpg (172.21.0.1) 1.49ms
2024-02-15T03:19:02.173223354Z [I 240215 11:19:02 tornado.access web:2348] 200 GET /static/img/icon.png?v=ac6331c027f3f1f1006c59f57df8b214176fd5dedbe69f681285cd2a294d4a1130e9389b236011a959764c92efd477e673fd5accb8d3dece91cf95b376eb7df4 (172.21.0.1) 1.37ms
2024-02-15T03:19:02.390133676Z [I 240215 11:19:02 tornado.access web:2348] 200 GET /static/img/32.png?v=cd78fdd4f992582a3a536636feebfc759a40dc1e4856f3e0e20efc8e3143ac0d82cde731af98cc39d7abbb4dfd6fd20c1867558ce60418fb5b52994c5ba7efbf (172.21.0.1) 1.04ms
2024-02-15T03:19:03.034657085Z [I 240215 11:19:03 tornado.access web:2348] 200 GET /login (172.21.0.1) 24.20ms
2024-02-15T03:19:03.254251423Z [I 240215 11:19:03 tornado.access web:2348] 200 GET /static/css/register.css?v=1414d8e95676a19f4274c7215aed052bd6a1b53ccaac284b9853ecf9580a2ae70f1107753580a4120056380b4491282aca68a6de71faf991f488ed70d09953c3 (172.21.0.1) 1.91ms2024-02-15T03:19:03.518925286Z [I 240215 11:19:03 tornado.access web:2348] 200 GET /static/components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff (172.21.0.1) 2.89ms
2024-02-15T03:19:08.736710939Z [I 240215 11:19:08 tornado.access web:2348] 302 POST /login (172.21.0.1) 141.22ms
2024-02-15T03:19:09.025158863Z [I 240215 11:19:09 tornado.access web:2348] 200 GET /my/ (172.21.0.1) 103.66ms
2024-02-15T03:19:09.271197735Z [I 240215 11:19:09 tornado.access web:2348] 200 GET /static/css/my.css?v=f03b49dfa00295685d9a9436d498608bce24526e0a0cdd58f0a41795346722c348da8a3a144dd2ee44ea59b27bded197e328faebf1f07bd4671212f3314a110b (172.21.0.1) 1.70ms
2024-02-15T03:19:09.281523495Z [I 240215 11:19:09 tornado.access web:2348] 200 GET /static/components/misc.js?v=c3b830413637aa4a24640c88fe4462860edc5d7fb15d0633e133a9b74d95b5b21c16e01387b52f88c593b07e41fe912761c620e4c7f04e2fed4ded871541f872 (172.21.0.1) 1.54ms
2024-02-15T03:19:09.283371997Z [I 240215 11:19:09 tornado.access web:2348] 200 GET /static/components/mutil_op.js?v=3e86750fd1d265d0c2ff3e8fe4c341fcfb3e10a5e012f49f0e4908e23a066b09ddd7fd1b0c563f5dd3cb53f2935aeb6530f54f5f562c4f1631e9e821e109e27c (172.21.0.1) 1.46ms
2024-02-15T03:19:09.461119593Z [I 240215 11:19:09 tornado.access web:2348] 200 GET /static/img/header.jpg (172.21.0.1) 1.97ms
2024-02-15T03:19:09.603356875Z [I 240215 11:19:09 tornado.access web:2348] 200 GET /static/components/Font-Awesome/webfonts/fa-solid-900.woff2 (172.21.0.1) 74.16ms
2024-02-15T03:19:10.924292028Z [I 240215 11:19:10 tornado.access web:2348] 200 GET /subscribe/1/ (172.21.0.1) 246.88ms
2024-02-15T03:19:13.652599874Z [I 240215 11:19:13 tornado.access web:2348] 302 POST /subscribe/refresh/1/?op=refresh (172.21.0.1) 9.25ms
2024-02-15T03:19:13.928921351Z [I 240215 11:19:13 tornado.access web:2348] 200 GET /subscribe/1/ (172.21.0.1) 71.76ms
2024-02-15T03:19:14.421186953Z [W 240215 11:19:14 tornado.access web:2348] 403 GET /subscribe/1/updating/ (172.21.0.1) 1.24ms
2024-02-15T03:19:24.068324351Z [W 240215 11:19:24 tornado.access web:2348] 403 GET /subscribe/1/updating/ (172.21.0.1) 2.05ms
错误如图所示:
更新到最新镜像,点击公共模板,目前也报这个错误.
尝试禁用 redis 或清空 redis 缓存后重试
我尝试将docker-compose.yml中“REDISCLOUD_URL”一项改为注释,如图。但是重新执行docker compose up -d
后问题如故,且log中仍出现403:
我不确定这个方法是否可以实现“禁用redis”,如果不能,还请麻烦指导下正确禁用redis的方法
我尝试将docker-compose.yml中“REDISCLOUD_URL”一项改为注释,如图。但是重新执行
docker compose up -d
后问题如故,且log中仍出现403:我不确定这个方法是否可以实现“禁用redis”,如果不能,还请麻烦指导下正确禁用redis的方法
同时注释掉这一段
同时注释掉这一段
已注释掉该内容,同时注释了depend_on相关内容,并手动停止了redis容器,但是问题仍然存在
如果不是 redis 的问题的话,初步怀疑是跨域问题,你的 nginx 或 WebSocket 配置是怎样的?
没有使用nginx,直接用“ip:端口”方式访问的后台
没有使用nginx,直接用“ip:端口”方式访问的后台
docker-compose 脱敏后配置发一下,直接使用ip:端口方式访问的前端模板更新页面么
直接使用ip:端口方式访问的前端模板更新页面么
是的。配置文件如下:
version: "3"
services:
qd:
image: qdtoday/qd:latest
# image: a76yyyy/qiandao:lite-latest
container_name: qd
depends_on:
- redis
ports:
- "3432:80"
volumes:
- "./config:/usr/src/app/config"
environment:
- QIANDAO_DEBUG=True
# - MULTI_PROCESS=False
# - AUTO_RELOAD=False
# - GZIP=True
# - BIND=0.0.0.0
# - PORT=80
# - QUEUE_NUM=50
# - ENABLE_HTTPS=False
# - ACCESS_LOG=True
- DOMAIN=***
# - USE_PYCURL=True
# - ALLOW_RETRY=True
# - DNS_SERVER=
# - CURL_ENCODING=True
# - CURL_CONTENT_LENGTH=True
# - NOT_RETRY_CODE=301|302|303|304|305|307|400|401|403|404|405|407|408|409|410|412|415|413|414|500|501|502|503|504|599
# - EMPTY_RETRY=True
# - COOKIE_DAY=5
# - JAWSDB_MARIA_URL=mysql://user:pass@localhost:3306/dbname?auth_plugin=
- REDISCLOUD_URL=redis://redis:6379
# - TRACEBACK_PRINT=False
# - PUSH_PIC_URL=https://fastly.jsdelivr.net/gh/qd-today/qd@master/web/static/img/push_pic.png
# - PUSH_BATCH_SW=True
# - PUSH_BATCH_DELTA=60
# - DB_TYPE=sqlite3
# - QIANDAO_SQL_LOGGING_NAME=qiandao.sql
# - QIANDAO_SQL_LOGGING_LEVEL=WARNING
# - QIANDAO_SQL_POOL_LOGGING_NAME=qiandao.sql.pool
# - QIANDAO_SQL_POOL_LOGGING_LEVEL=WARNING
# - QIANDAO_SQL_POOL_SIZE=5
# - QIANDAO_SQL_MAX_OVERFLOW=10
# - QIANDAO_SQL_POOL_PRE_PING=True
# - QIANDAO_SQL_POOL_RECYCLE=3600
# - QIANDAO_SQL_POOL_TIMEOUT=30
# - QIANDAO_SQL_POOL_USE_LIFO=True
# - REDIS_DB_INDEX=1
# - QIANDAO_EVIL=1000
# - EVIL_PASS_LAN_IP=True
- PBKDF2_ITERATIONS=400
- AES_KEY=***
- COOKIE_SECRET=***
# - CHECK_TASK_LOOP=500
# - TASK_MAX_RETRY_COUNT=8
# - DOWNLOAD_SIZE_LIMIT=5242880
# - REQUEST_TIMEOUT=30.0
# - CONNECT_TIMEOUT=30.0
# - DELAY_MAX_TIMEOUT=29.9
# - UNSAFE_EVAL_TIMEOUT=3.0
# - PROXIES=
# - PROXY_DIRECT_MODE=regexp
# - PROXY_DIRECT=(?xi)\A([a-z][a-z0-9+\-.]*://)?(0(.0){3}|127(.0){2}.1|localhost|\[::([\d]+)?\])(:[0-9]+)?
# - NEW_TASK_DELAY=1
# - EXTRA_ONNX_NAME=
# - EXTRA_CHARSETS_NAME=
# - NEW_TASK_DELAY=1
# - MAIL_SMTP=
# - MAIL_PORT=465
# - MAIL_SSL=True
# - MAIL_USER=
# - MAIL_PASSWORD=
# - MAIL_FROM=${MAIL_USER}
# - MAIL_DOMAIN=
# - MAILGUN_KEY=
# - USER0ISADMIN=True
redis:
image: redis:alpine
container_name: redis
# command: ["--loglevel warning"]
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf:rw
- ./redis/data:/data:rw
问题已定位,使用 ip:port 方式导致跨域校验失败,请等待修复或者先注释 domain 环境变量后尝试
拉取dev分支并部署后,该问题似乎仍然存在。 无论是直接使用ip:port,还是利用Nginx反代,更新公共模板时都提示undefined 错误,且log中错误类型都为403。 log日志如下,敏感信息已处理。log中ip为124开头的请求对应Nginx反代方式访问管理页面,ip为172开头则为ip:port方式。
2024-02-16T12:26:38.597859247Z get_mempolicy: Operation not permitted
2024-02-16T12:26:40.029950538Z [I 240216 20:26:40 QD.Worker worker:324] Queue Worker start...
2024-02-16T12:26:40.031750467Z [I 240216 20:26:40 QD.Run run:87] Http Server started on 0.0.0.0:80
2024-02-16T12:26:57.503864531Z [I 240216 20:26:57 tornado.access web:2348] 200 GET /my/ (124.*.*.171) 158.32ms
2024-02-16T12:26:59.127811967Z [I 240216 20:26:59 tornado.access web:2348] 200 GET /subscribe/1/ (124.*.*171) 142.23ms
2024-02-16T12:27:00.437256678Z [I 240216 20:27:00 tornado.access web:2348] 302 POST /subscribe/refresh/1/?op=refresh (124.*.*.171) 12.13ms
2024-02-16T12:27:00.713353963Z [I 240216 20:27:00 tornado.access web:2348] 200 GET /subscribe/1/ (124.*.*.171) 64.92ms
2024-02-16T12:27:01.232303531Z [W 240216 20:27:01 tornado.access web:2348] 403 GET /subscribe/1/updating/ (124.*.*.171) 1.88ms
2024-02-16T12:27:20.813866883Z [I 240216 20:27:20 tornado.access web:2348] 302 GET / (172.21.0.1) 1.86ms
2024-02-16T12:27:21.086201673Z [I 240216 20:27:21 tornado.access web:2348] 200 GET /my/ (172.21.0.1) 44.20ms
2024-02-16T12:27:26.508763445Z [I 240216 20:27:26 tornado.access web:2348] 304 GET /subscribe/1/ (172.21.0.1) 99.42ms
2024-02-16T12:27:27.019769004Z [W 240216 20:27:27 tornado.access web:2348] 403 GET /subscribe/1/updating/ (172.21.0.1) 1.70ms
将docker-compose.yml
环境变量文件中的DOMAIN一行注释掉后,Nginx反代和ip:port方式访问管理页面,都可以正常更新。
ps: 在/etc/nginx/conf.d 文件夹设置对应反代,conf配置如下(敏感信息已处理,乱码内容在vim中显示正常且nginx -t
无报错):
server {
listen 2082;
server_name h.*.net;
location / {
proxy_pass http://127.0.0.1:3432;
# WebSocket 关键配置开始
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# WebSocket 关键配置结束
# 其他可选配置开始
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 X-Forwarded-Proto $scheme;
# 其他可选配置结束
}
拉取dev分支并部署后,该问题似乎仍然存在。
重新拉取 dev 分支并部署即可,刚才没有自动构建成功
ip:port模式现在可以正常更新模板了,但是nginx反代访问时log里还是有403错误。 log日志:
2024-02-16T12:26:57.503864531Z [I 240216 20:26:57 tornado.access web:2348] 200 GET /my/ (124.*.*.171) 158.32ms
2024-02-16T12:26:59.127811967Z [I 240216 20:26:59 tornado.access web:2348] 200 GET /subscribe/1/ (124.*.*171) 142.23ms
2024-02-16T12:27:00.437256678Z [I 240216 20:27:00 tornado.access web:2348] 302 POST /subscribe/refresh/1/?op=refresh (124.*.*.171) 12.13ms
2024-02-16T12:27:00.713353963Z [I 240216 20:27:00 tornado.access web:2348] 200 GET /subscribe/1/ (124.*.*.171) 64.92ms
2024-02-16T12:27:01.232303531Z [W 240216 20:27:01 tornado.access web:2348] 403 GET /subscribe/1/updating/ (124.*.*.171) 1.88ms
conf.d配置文件如上,nginx.conf配置如下:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
ip:port模式现在可以正常更新模板了,但是nginx反代访问时log里还是有403错误。 log日志:
domain 变量值改成 domain:2082
(就是带上 nginx 中 listen 的端口)试一下
DOMAIN改成域名:端口后可以正常拉取更新了。没有问题了,感谢
1Panel 部署的,用的ip访问,我要怎样修复呢
1Panel 部署的,用的ip访问,我要怎样修复呢
开启debug模式,访问公共模板更新页面,看一下日志中check_origin和host分别是什么
开始更新... -----开始更新 default 模板仓库----- 仓库地址: https://cdn.jsdelivr.net/gh/qd-today/templates@master 更新失败, 原因: Cannot connect to host cdn.jsdelivr.net:443 ssl:False [Connect call failed ('104.16.88.20', 443)] 错误代码:4006, 错误原因:Update failed, please check failure reason.
1Panel 部署的,用的ip访问,我要怎样修复呢
开启debug模式,访问公共模板更新页面,看一下日志中check_origin和host分别是什么
开始更新... -----开始更新 default 模板仓库----- 仓库地址: https://cdn.jsdelivr.net/gh/qd-today/templates@master 更新失败, 原因: Cannot connect to host cdn.jsdelivr.net:443 ssl:False [Connect call failed ('104.16.88.20', 443)] 错误代码:4006, 错误原因:Update failed, please check failure reason.
1Panel 部署的,用的ip访问,我要怎样修复呢
开启debug模式,访问公共模板更新页面,看一下日志中check_origin和host分别是什么
参考 https://qd-today.github.io/qd/zh_CN/guide/deployment.html#%E9%85%8D%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F
配置 SUBSCRIBE_ACCELERATE_URL
Verify steps
QD Version
20240210
Bug on OS
Windows
Bug on Platform
Docker/Linux 64位
To Reproduce
将20230718版本使用
docker compose pull
指令更新后重启容器,直接使用http://ip:端口 方式(未使用Nginx反代)访问管理页面,点击“公共模板”,提示“更新公共模板失败”。Describe the Bug
无法更新公共模板,log显示拉取后http状态码为403。相同docker-compose.yml配置文件下部署的20230718版无此问题;手动指定qd版本为20230821,拉取部署后可正常拉取更新.
QD config
No response
QD log
Expected behavior
管理界面点击“公共模板”后正常从Github拉取更新。 正常拉取后日志如下:
Screenshots
No response