Closed wifisky-feilian closed 1 year ago
是不是没指定时区? 一定要在环境变量里指定 TZ=Asia/Shanghai ,否则容器内部时间不对
按你的完整命令创建的不会错的,TZ=Asia/Shanghai创建命令里带的 第一天签到成功了,之后的签到都是失败的 另外建议:签到也加上发送推送信息功能 用的下面命令创建的: docker run \ --restart always \ --name tiantang-auto-harvest \ -p 8080:80 \ -v /mnt/md0/public/Docker/tiantang-auto-harvest:/app/data \ -e TZ=Asia/Shanghai \ -d \ boris1993/tiantang-auto-harvest:latest
能看到日志的时间戳么?看看日志是几点打出来的
作者你好,请问一下无法获取图片验证码,提示请求发送失败
请开一个新的issue来解决这个问题。 issue中记得贴上报错时的docker日志。
请更新到最新的镜像再试试。新的镜像里日志会带上时间戳,方便排查问题。
我也是签到失败,29号运行的,到今天发现一只没成功,但是日志有签到动作。
[2023-01-04 01:00:00] info: tiantang_auto_harvest.Jobs.RefreshLoginJob[0] Token有效期大于24小时,跳过刷新 [2023-01-04 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 xxxx [2023-01-04 10:00:00] info: tiantang_auto_harvest.Jobs.HarvestJob[0] 将收取甜糖账号 xxxx [2023-01-05 01:00:00] info: tiantang_auto_harvest.Jobs.RefreshLoginJob[0] Token有效期大于24小时,跳过刷新 [2023-01-05 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 xxxx [2023-01-05 10:00:00] info: tiantang_auto_harvest.Jobs.HarvestJob[0] 将收取甜糖账号 xxxx [2023-01-06 01:00:00] info: tiantang_auto_harvest.Jobs.RefreshLoginJob[0] Token有效期大于24小时,跳过刷新 [2023-01-06 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 xxxx [2023-01-06 10:00:00] info: tiantang_auto_harvest.Jobs.HarvestJob[0] 将收取甜糖账号 xxxx
我注意到日志里面只有开始尝试签到的信息,却没有签到成功的,也没有报错。我本地尝试复现一下先。
@wifisky-feilian @a18ccms
刚更新了一下代码,加了些debug日志,你们在环境变量中加上ASPNETCORE_ENVIRONMENT=Development
然后重启容器,等再签到失败后,把完整的日志再发上来,我看看请求和响应里面有没有线索。
docker容器安装的。如何更新代码呢?我看容器的镜像好像没更新。
重新拉latest就行
是凌晨3点签到
我现在怀疑请求是被系统给cancel了,加了点错误处理和日志来看是不是这个原因,再拉latest
就有了。然后等下次签到再失败之后,再贴一下日志上来。
@boris1993 更新了。明天早上更新这个
竟然看到签到成功了。那只能继续等了?。看看啥时候失败的日志了。
.......什么玄学
可以再观察一段时间
后面要是一直没啥别的问题的话,就可以把ASPNETCORE_ENVIRONMENT=Development
这个环境变量去掉然后重启容器,省的打一堆debug日志
@boris1993 看到错误了。但是这个提示没啥帮助吧。
[2023-01-17 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 1111
[2023-01-17 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 正在构造httpRequestMessage
[2023-01-17 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] httpRequestMessage = Method: POST, RequestUri: 'http://tiptime-api.com/web/api/account/sign_in', Version: 1.1, Content: System.Net.Http.Json.JsonContent, Headers: { Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjM4MjksImV4cCI6MTY3NDg2MzkyMSwiaXNzIjoieWZDbG91ZCIsIm5iZiI6MTY3MjI3MDkyMX0.E9AM6_7ZluV5z_zZWggPLDV0ZvmMXYsbAcj5Ct3doDA Content-Type: application/json; charset=utf-8 }
[2023-01-17 03:00:00] fail: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] SendRequest方法发送请求失败:One or more errors occurred. (An error occurred while sending the request.)
[2023-01-17 10:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 正在构造httpRequestMessage
[2023-01-17 10:00:00] info: tiantang_auto_harvest.Jobs.HarvestJob[0] 将收取甜糖账号 1111
@a18ccms 抱歉,C#的异常处理玩的不是很6,刚更新了下代码,应该可以把所有抛出的异常的信息都打出来
[2023-01-23 10:00:00] info: tiantang_auto_harvest.Jobs.HarvestJob[0] 将收取甜糖账号 11111
[2023-01-23 10:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 正在构造httpRequestMessage
[2023-01-23 10:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] httpRequestMessage = Method: GET, RequestUri: 'http://tiptime-api.com/api/v1/user_props/actived', Version: 1.1, Content: System.Net.Http.Json.JsonContent, Headers: { Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjM4MjksImV4cCI6MTY3NDg2MzkyMSwiaXNzIjoieWZDbG91ZCIsIm5iZiI6MTY3MjI3MDkyMX0.E9AM6_7ZluV5z_zZWggPLDV0ZvmMXYsbAcj5Ct3doDA Content-Type: application/json; charset=utf-8 }
[2023-01-23 10:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] httpRequestMessage = Method: POST, RequestUri: 'http://tiptime-api.com/web/api/account/message/loading', Version: 1.1, Content: System.Net.Http.Json.JsonContent, Headers: { Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjM4MjksImV4cCI6MTY3NDg2MzkyMSwiaXNzIjoieWZDbG91ZCIsIm5iZiI6MTY3MjI3MDkyMX0.E9AM6_7ZluV5z_zZWggPLDV0ZvmMXYsbAcj5Ct3doDA Content-Type: application/json; charset=utf-8 }
[2023-01-23 10:00:00] fail: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] SendRequest方法发送请求失败:One or more errors occurred. (An error occurred while sending the request.)
[2023-01-23 10:00:02] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] Response = StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Server: nginx/1.20.1 Date: Mon, 23 Jan 2023 02:00:02 GMT Span_id: bc5adf62b18b179f Trace_id: abd13833775f5793c0ce1d343dac37c9 X-Cache-Lookup: Cache Miss X-Cache-Lookup: Cache Miss X-NWS-LOG-UUID: 14372418498908954618 Connection: keep-alive Content-Type: application/json; charset=utf-8 Content-Length: 32 }
[2023-01-23 10:00:02] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] ResponseBody = {"msg":"","errCode":0,"data":[]}
[2023-01-23 10:00:02] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] HTTP状态码为 OK
感觉有回应吧?好像没出错吧? 但是那个错误提示。整个日志里有好多这个出错提示SendRequest方法发送请求失败
你镜像更新了吗?看着这个日志不像是我新的镜像打出来的啊......
我又重新拉取了一下镜像。昨天的日志是这样的:
[2023-01-30 01:00:01] info: tiantang_auto_harvest.Jobs.RefreshLoginJob[0] Token有效期大于24小时,跳过刷新
[2023-01-30 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 111111
[2023-01-30 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 正在构造httpRequestMessage
[2023-01-30 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] httpRequestMessage = Method: POST, RequestUri: 'http://tiptime-api.com/web/api/account/sign_in', Version: 1.1, Content: System.Net.Http.Json.JsonContent, Headers: { Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjM4MjksImV4cCI6MTY3NzUxNzIwMiwiaXNzIjoieWZDbG91ZCIsIm5iZiI6MTY3NDkyNDIwMn0.n_DDBlpq0itQg-T4UzD9EwgsaxXKruP-moKnkO8ok44 Content-Type: application/json; charset=utf-8 }
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] Response = StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Server: nginx/1.20.1 Date: Sun, 29 Jan 2023 19:00:03 GMT Span_id: a764b62a23ae4bb9 Trace_id: 3db4b2adb0468a03d3b4d4d596607cb9 X-Cache-Lookup: Cache Miss X-Cache-Lookup: Cache Miss X-NWS-LOG-UUID: 14108865995874967999 Connection: keep-alive Content-Type: application/json; charset=utf-8 Content-Length: 31 }
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] ResponseBody = {"msg":"","errCode":0,"data":2}
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] HTTP状态码为 OK
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] errCode=0, errorMessage=
[2023-01-30 03:00:03] info: tiantang_auto_harvest.Jobs.SigninJob[0] 签到成功,获得2点星愿
是新镜像吗?
pull的时候有更新那就是新的了,但是......不报错了,就很迷...... 至少现在签到没问题,看看收取有没有报错吧
[2023-01-29 10:13:50] info: Microsoft.Hosting.Lifetime[0] Content root path: /app
[2023-01-30 01:00:01] info: tiantang_auto_harvest.Jobs.RefreshLoginJob[0] Token有效期大于24小时,跳过刷新
[2023-01-30 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 111
[2023-01-30 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 正在构造httpRequestMessage
[2023-01-30 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] httpRequestMessage = Method: POST, RequestUri: 'http://tiptime-api.com/web/api/account/sign_in', Version: 1.1, Content: System.Net.Http.Json.JsonContent, Headers: { Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjM4MjksImV4cCI6MTY3NzUxNzIwMiwiaXNzIjoieWZDbG91ZCIsIm5iZiI6MTY3NDkyNDIwMn0.n_DDBlpq0itQg-T4UzD9EwgsaxXKruP-moKnkO8ok44 Content-Type: application/json; charset=utf-8 }
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] Response = StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Server: nginx/1.20.1 Date: Sun, 29 Jan 2023 19:00:03 GMT Span_id: a764b62a23ae4bb9 Trace_id: 3db4b2adb0468a03d3b4d4d596607cb9 X-Cache-Lookup: Cache Miss X-Cache-Lookup: Cache Miss X-NWS-LOG-UUID: 14108865995874967999 Connection: keep-alive Content-Type: application/json; charset=utf-8 Content-Length: 31 }
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] ResponseBody = {"msg":"","errCode":0,"data":2}
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] HTTP状态码为 OK
[2023-01-30 03:00:03] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] errCode=0, errorMessage=
[2023-01-30 03:00:03] info: tiantang_auto_harvest.Jobs.SigninJob[0] 签到成功,获得2点星愿
[2023-01-31 01:00:00] info: tiantang_auto_harvest.Jobs.RefreshLoginJob[0] Token有效期大于24小时,跳过刷新
[2023-01-31 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 111
[2023-01-31 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 正在构造httpRequestMessage
[2023-01-31 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] httpRequestMessage = Method: POST, RequestUri: 'http://tiptime-api.com/web/api/account/sign_in', Version: 1.1, Content: System.Net.Http.Json.JsonContent, Headers: { Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjM4MjksImV4cCI6MTY3NzUxNzIwMiwiaXNzIjoieWZDbG91ZCIsIm5iZiI6MTY3NDkyNDIwMn0.n_DDBlpq0itQg-T4UzD9EwgsaxXKruP-moKnkO8ok44 Content-Type: application/json; charset=utf-8 }
[2023-01-31 03:00:02] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] Response = StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers: { Server: nginx/1.20.1 Date: Mon, 30 Jan 2023 19:00:02 GMT Span_id: b1df484af5a6329d Trace_id: 16d98cb00b94f990eaadf3fde1effb5c X-Cache-Lookup: Cache Miss X-Cache-Lookup: Cache Miss X-NWS-LOG-UUID: 10731251401172134192 Connection: keep-alive Content-Type: application/json; charset=utf-8 Content-Length: 31 }
[2023-01-31 03:00:02] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] ResponseBody = {"msg":"","errCode":0,"data":2}
[2023-01-31 03:00:02] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] HTTP状态码为 OK
[2023-01-31 03:00:02] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] errCode=0, errorMessage=
[2023-01-31 03:00:02] info: tiantang_auto_harvest.Jobs.SigninJob[0] 签到成功,获得2点星愿
[2023-02-01 01:00:00] info: tiantang_auto_harvest.Jobs.RefreshLoginJob[0] Token有效期大于24小时,跳过刷新
[2023-02-01 03:00:00] info: tiantang_auto_harvest.Jobs.SigninJob[0] 将签到甜糖账号 1111
[2023-02-01 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 正在构造httpRequestMessage
[2023-02-01 03:00:00] dbug: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] httpRequestMessage = Method: POST, RequestUri: 'http://tiptime-api.com/web/api/account/sign_in', Version: 1.1, Content: System.Net.Http.Json.JsonContent, Headers: { Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6MjM4MjksImV4cCI6MTY3NzUxNzIwMiwiaXNzIjoieWZDbG91ZCIsIm5iZiI6MTY3NDkyNDIwMn0.n_DDBlpq0itQg-T4UzD9EwgsaxXKruP-moKnkO8ok44 Content-Type: application/json; charset=utf-8 }
[2023-02-01 03:00:00] fail: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] SendRequest方法发送请求失败。错误信息:
[2023-02-01 03:00:00] fail: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] An error occurred while sending the request.
它来了,它来了,它终于迈着步伐走来了。但是还是感觉没看到啥。。。
这行报错下面没别的东西了?按说应该有别的具体信息的吧……
这就是它神奇的地方啊。。看不到有用的信息。最后那个是我手动关闭镜像的信息。你那里没有出错过?难道就我自己这样 ?汗。。。
我再改改打日志的代码试试……应该是有别的错,没打出来……
关键你不出问题。貌似别人也不出问题。那是不是我网络有啥问题。。。例如网络到3点多不稳定啥的。。。。
不排除这个可能,网络问题就是个玄学
fail: tiantang_auto_harvest.Service.TiantangRemoteCallService[0] 甜糖API返回码不为0,错误信息:请在 2 点以后进行签到 fail: tiantang_auto_harvest.Jobs.SigninJob[0] 签到失败,请参考日志