我最近在我的开发 API 服务器上安装了 stackify,我在 stackify 错误仪表板上出现了这个错误,但我无法重现该错误。我相信几乎每个对 API 的请求都会记录一个错误,尽管所有请求都正常(200)并且没有一个响应 ServerError(5XX)。
这是错误消息:
System.Security.Cryptography.CryptographicException:System.Security.Cryptography.CryptographicException:加密操作期间发生错误。在 System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func,字节 [] 输入)
错误文档:
{
"id": "1266b838-a261-4bde-9220-ff7993d72c0e",
"env": "dev",
"host": "raidsrv3",
"appname": "environment.appname.com",
"version": null,
"apploc": "D:\\StageApplications\\environment.appname.com",
"message": "System.NullReferenceException: Object reference not set to an instance of an object.\r\nSystem.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object.\r\n at lambda_method(Closure , LoginViewModel )\r\n",
"json": null,
"jsonPreview": null,
"thread": "40",
"threadOs": null,
"transid": "7af3de61-9bf1-43d8-b60c-ff9850a35490",
"timestamp": "2021-01-20T14:21:41.247Z",
"inserted": "2021-01-20T14:22:11.8261135Z",
"level": "ERROR",
"logType": "app-dotnet",
"logger": null,
"urlRoute": "Home.Login",
"urlFull": null,
"sourcemethod": "lambda_method(Closure , LoginViewModel )",
"sourceline": null,
"stackify": {
"CdWebAppId": null,
"CdId": 1,
"CdAppId": 215,
"Error": 1,
"WebLogUrlId": null,
"Queued": "2021-01-20T14:21:47.0806791Z",
"Tooksecs": 24.745,
"QueuedPartition": "Jan201400p1",
"Trace": null,
"FromApm": null,
"Order": 1,
"InvalidEpochStr": null,
"IsWebLog": false,
"AppNameId": "23f72352-2d5a-eb11-a607-0003ffcfb91b",
"AppEnvId": "43f72352-2d5a-eb11-a607-0003ffcfb91b",
"EnvId": 2,
"Timestamp1M": "2021-01-20T14:21:00Z",
"Timestamp5M": "2021-01-20T14:20:00Z",
"Timestamp1H": "2021-01-20T14:00:00Z",
"Timestamp1D": "2021-01-20T00:00:00Z",
"IsProd": true,
"Expiration1D": "2021-02-05T00:00:00Z",
"DeploymentId": null
},
"error": {
"StackifyErrorID": "1266b838-a261-4bde-9220-ff7993d72c0e",
"OccurredEpochMillis": 1611152501247,
"Error": {
"InnerError": null,
"StackTrace": [
{
"LineNum": null,
"Method": "lambda_method(Closure , LoginViewModel )",
"CodeFileName": null
}
],
"Message": "System.NullReferenceException: Object reference not set to an instance of an object.",
"ErrorType": "System.NullReferenceException",
"ErrorTypeCode": "-2147467261",
"Data": null,
"SourceMethod": "lambda_method(Closure , LoginViewModel )"
},
"data": {},
"EnvironmentDetail": {
"DeviceName": "RAIDSRV3",
"AppLocation": "D:\\StageApplications\\environment.appname.com",
"AppName": "environment.appname.com",
"WebAppID": null,
"ConfiguredAppName": null,
"ConfiguredEnvironmentName": null,
"ConfiguredLocationName": null,
"IsAzureWorkerRole": false
},
"WebRequestDetail": {
"UserIPAddress": null,
"HttpMethod": "GET",
"RequestProtocol": null,
"WebLogUrl": "Home.Login",
"RequestDomain": "environment.appname.com",
"ReportingUrl": "Home.Login",
"UrlKey": "get-home.login",
"RequestUrl": "https://environment.appname.com/",
"RequestUrlRoot": null,
"RequestRoute": null,
"ReferralUrl": null,
"UserAgent": null,
"Headers": {},
"Cookies": {},
"QueryString": {},
"PostData": {},
"SessionData": {},
"PostDataRaw": null,
"MvcAction": null,
"MvcController": null,
"MvcArea": null
},
"ApiClient": {
"Name": null,
"Platform": ".net"
},
"ServerVariables": {},
"CustomerName": null,
"UserName": null,
"errorGroupId": "b772fbd6-db5a-eb11-a607-0003ffcfb91b",
"errorGroupInstanceId": "bf72fbd6-db5a-eb11-a607-0003ffcfb91b",
"displayMethodId": "d65c87ef-ca5a-eb11-a607-0003ffcfb91b",
"errorSourceMethodId": "d65c87ef-ca5a-eb11-a607-0003ffcfb91b",
"errorTypeMessageId": "2-df28da1c-715a-eb11-a607-0003ffcfb91b-0e8ec107143a2e3d04bfee99e49c20a5",
"errorUniqueId": "d75c87ef-ca5a-eb11-a607-0003ffcfb91b",
"errorPlatformTypeId": 2,
"errorStateId": 0,
"errorTypeId": "df28da1c-715a-eb11-a607-0003ffcfb91b",
"message": "System.NullReferenceException: Object reference not set to an instance of an object.",
"errorType": "System.NullReferenceException",
"errorTypeClass": "NullReferenceException",
"errorTypeCode": "-2147467261",
"sourceMethodName": "lambda_method(Closure , LoginViewModel )",
"sourceMethodShort": "lambda_method(Closure , LoginViewModel )",
"errorGroupCreatedUtc": "2021-01-20T04:55:18.767",
"displayMethodName": "lambda_method(Closure , LoginViewModel )",
"displayMethodShort": "lambda_method(Closure , LoginViewModel )",
"stackTraceHash": "858F2DB7DA4C81444B39BA60C9CC5B65",
"stackTrace": "System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object.\n\tat lambda_method(Closure , LoginViewModel )\n",
"appended": "2021-01-20T14:22:22.5880117Z"
},
"winevent": null,
"weblog": null,
"tag": [
"fromapm"
],
"container": null,
"kubernetes": null
}
我已经搜索了所有内容,但找不到此错误的解释。
以下是有关我的开发环境的一些背景信息:
- API 是 .net Framework 4.7.2
- 我将所有 nuget 包和库更新到最新支持的版本
- 机器密钥已配置,并且我已验证两个 API 服务器 web.config 文件中存在相同的密钥。例如:
<machineKey validationKey="***" decryptionKey="***" />
- API 部署在 2 台服务器上,客户端和服务器之间使用 nginx。
- Ocotopus Deploy 用于部署 API
- DFS 用于将应用程序文件从主服务器同步到姊妹服务器
任何帮助将不胜感激!