微信报错: [40001,"invalid credential, access_token is invalid or not latest hint: [BzKHIa0609vr29!]"]
2018-01-12 14:24
453 查看
微信报错
[40001,”invalid credential, access_token is invalid or not latest hint: [BzKHIa0609vr29!]”]最近在搞微信公众号的开发,遇到此问题,找了很多办法,现在说说我的解决思路:
1、肯定是百度了,从网上99%的资料都可以知道是微信的基础Access_Token
过期了,即此时我们需要去查看我们的access_token是否是真的过期,看看存储方式,此参数官方的是2个过期,所以必须确定清楚是否是此参数过期了,如果是此参数过期了,那么问题解决,让Access_Token
刷新即可。但是我已经确定得非常清楚,此参数没有过期,继续下一步。
2、分析了一下我的服务器日志,我的需求是进行微信推送模板消息。在服务器上进行推送。每次推送完我都会记录推送的结果,推送的时间等等。我详细的看了我的日志,发现了一个问题,服务器每秒会进行5到6条数据进行推送微信消息,总是有个2到3条是失败的,而且这种情况非常多。提出猜想:是不是腾讯的接口一秒钟不能接受多条消息推送。从此猜想出发进行调整功能,两秒钟推送一条消息。结果:所有的消息全部推送成功,没有再出现 40001的情况。
3、其他原因待补充。
结论:腾讯的接口肯定是支持大并发的。但是对于单个公众号,应该是有接口的频率限制的,这地方是每秒的请求限制。但是官方有没有说明此情况。而且给的报错是40001,误导我一直在找自己的问题。此时应该从大局去分析,不仅需要分析功能代码,还需要分析并发等情况。针对此情况,希望大家在以后类似的功能架构时,需要注意到,如果我们的接口支持大并发,还得考虑考虑我们在此接口内部引用其他的接口是否支持大并发,综合进行考虑。
相关文章推荐
- bug: {"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: xxx
- 微信公众平台40001错误 invalid credential, access_token is invalid or not latest hint
- [微信开发]invalid credential, access_token is invalid or not latest hint
- 微信接口开发报错invalid credential, access_token is invalid or not latest hint
- 微信图片上传 invalid credential, access_token is invalid or not latest
- 微信接口开发报错invalid credential, access_token is invalid or not latest hint
- 安装Visual Studio 2010时提示"The location specified for the help content store is invalid or you do not have access to it".
- The URL "filename" is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web
- 404 error on preview ... "buffer_id(29) is not valid (closed or unsupported file format)"
- Solution to "Could not load file or assembly or one of its dependencies. Access is denied"
- Sharepoint Error : The URL "filename" is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web
- "Missing or invalid signature. The bundle '' at bundle path '' is not signed using an Apple submiss
- "errmsg" : "Our replica set config is invalid or we are not a member of it"
- 404 error on preview ... "buffer_id(29) is not valid (closed or unsupported file format)"
- 404 error on preview ... "buffer_id(29) is not valid (closed or unsupported file format)"
- 使用spring注入时出现is not writable or has an invalid setter method
- Cannot connect to WMI provider.You do not have permission or the server is unreachable.Note that you can only manager SQL Server 2005 and later version with SQL Server Configuration Manager.Invalid namespace [0x8004100e]
- does not have element "configuration/configSections/sectionGroup[@name='SharePoint']" or it is invalid
- "Invalid username/password or database/scan listener not up"