feat: add exponential backoff retries & fallback to alchemy api #921
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Example of wrong `thegraph` and wrong `alchemy` endpoints
[2023-11-30T05:54:50.917Z] info: tlc-batch-liquidate-wh: attached at endpoint: /webhooks/tlc-batch-liquidate-wh {} [2023-11-30T05:54:50.935Z] info: tlc-batch-liquidate scheduled - first run at 2023-11-30T06:00:00.000Z {} [2023-11-30T05:54:50.935Z] info: waiting to run tlc-batch-liquidate at 2023-11-30T06:00:00.000Z {} [2023-11-30T05:54:50.936Z] info: http server running on port 8111 {} [2023-11-30T05:54:51.719Z] info: http: ["POST","/webhooks/tlc-batch-liquidate-wh"] {} [2023-11-30T05:54:51.720Z] info: starting task action tlc-batch-liquidate-wh {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:51.748Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:52.109Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:52.110Z] error: subgraph retry 1 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:52.110Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"92","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:52.312Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:52.621Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:52.622Z] error: subgraph retry 2 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:52.622Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"92","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.028Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.335Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.335Z] error: subgraph retry 3 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.335Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"92","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.336Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"92","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.336Z] info: try axios post to: { "subgraphUrl": "https://subgraph.satsuma-prod.com/a912521dd162ss/templedao/temple-v2-mainnet/version/v0.1.0/api", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.645Z] error: subgraph retry 1 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.646Z] error: {"message":"Request failed with status code 403","name":"AxiosError","stack":"AxiosError: Request failed with status code 403\n at settle (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145018:12)\n at IncomingMessage.handleStreamEnd (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145865:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1359:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"92","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://subgraph.satsuma-prod.com/a912521dd162ss/templedao/temple-v2-mainnet/version/v0.1.0/api","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"ERR_BAD_REQUEST","status":403} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:53.847Z] info: try axios post to: { "subgraphUrl": "https://subgraph.satsuma-prod.com/a912521dd162ss/templedao/temple-v2-mainnet/version/v0.1.0/api", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.120Z] error: subgraph retry 2 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.121Z] error: {"message":"Request failed with status code 403","name":"AxiosError","stack":"AxiosError: Request failed with status code 403\n at settle (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145018:12)\n at IncomingMessage.handleStreamEnd (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145865:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1359:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"92","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://subgraph.satsuma-prod.com/a912521dd162ss/templedao/temple-v2-mainnet/version/v0.1.0/api","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"ERR_BAD_REQUEST","status":403} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.522Z] info: try axios post to: { "subgraphUrl": "https://subgraph.satsuma-prod.com/a912521dd162ss/templedao/temple-v2-mainnet/version/v0.1.0/api", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.795Z] error: subgraph retry 3 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.795Z] error: {"message":"Request failed with status code 403","name":"AxiosError","stack":"AxiosError: Request failed with status code 403\n at settle (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145018:12)\n at IncomingMessage.handleStreamEnd (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145865:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1359:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"92","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://subgraph.satsuma-prod.com/a912521dd162ss/templedao/temple-v2-mainnet/version/v0.1.0/api","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"ERR_BAD_REQUEST","status":403} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.797Z] error: task tlc-batch-liquidate-wh failed with exception {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.797Z] error: exception message: Request failed with status code 403 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.797Z] error: exception stack: AxiosError: Request failed with status code 403 at settle (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145018:12) at IncomingMessage.handleStreamEnd (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:145865:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T05:54:54.798Z] info: sending message to discord webhook 1106343269069230130 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"}Example of wrong `thegraph` endpoind, correct `alchemy` endpoints, but wrong query
[2023-11-30T06:04:57.978Z] info: tlc-batch-liquidate-wh: attached at endpoint: /webhooks/tlc-batch-liquidate-wh {} [2023-11-30T06:04:57.996Z] info: tlc-batch-liquidate scheduled - first run at 2023-11-30T06:10:00.000Z {} [2023-11-30T06:04:57.996Z] info: waiting to run tlc-batch-liquidate at 2023-11-30T06:10:00.000Z {} [2023-11-30T06:04:57.996Z] info: http server running on port 8111 {} [2023-11-30T06:05:00.037Z] info: http: ["POST","/webhooks/tlc-batch-liquidate-wh"] {} [2023-11-30T06:05:00.038Z] info: starting task action tlc-batch-liquidate-wh {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.066Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id_dont_exist\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.370Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.370Z] error: subgraph retry 1 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.370Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"103","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id_dont_exist\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.577Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id_dont_exist\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.886Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.886Z] error: subgraph retry 2 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:00.887Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"103","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id_dont_exist\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:01.288Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id_dont_exist\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:01.635Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:01.635Z] error: subgraph retry 3 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:01.636Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"103","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id_dont_exist\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:01.636Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"103","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id_dont_exist\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:01.636Z] info: try axios post to: { "subgraphUrl": "https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id_dont_exist\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:02.133Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:02.133Z] error: subgraph retry 1 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:02.133Z] error: {"message":"[\"Type `TlcUser` has no field `id_dont_exist`\"]","name":"AxiosError","stack":"AxiosError: [\"Type `TlcUser` has no field `id_dont_exist`\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"103","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id_dont_exist\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:02.335Z] info: try axios post to: { "subgraphUrl": "https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id_dont_exist\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:02.612Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:02.612Z] error: subgraph retry 2 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:02.612Z] error: {"message":"[\"Type `TlcUser` has no field `id_dont_exist`\"]","name":"AxiosError","stack":"AxiosError: [\"Type `TlcUser` has no field `id_dont_exist`\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"103","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id_dont_exist\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.014Z] info: try axios post to: { "subgraphUrl": "https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api", "subgraphQuery": "{\n tlcUsers(where: {debt_gt: \"0\"}) {\n id_dont_exist\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.300Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.300Z] error: subgraph retry 3 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.300Z] error: {"message":"[\"Type `TlcUser` has no field `id_dont_exist`\"]","name":"AxiosError","stack":"AxiosError: [\"Type `TlcUser` has no field `id_dont_exist`\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"103","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api","data":"{\"query\":\"{\\n tlcUsers(where: {debt_gt: \\\"0\\\"}) {\\n id_dont_exist\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.301Z] error: task tlc-batch-liquidate-wh failed with exception {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.301Z] error: exception message: ["Type `TlcUser` has no field `id_dont_exist`"] {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.301Z] error: exception stack: AxiosError: ["Type `TlcUser` has no field `id_dont_exist`"] at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:05:03.302Z] info: sending message to discord webhook 1106343269069230130 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"}Example of wrong `thegraph` endpoind, correct `alchemy` endpoints, and correct query
[2023-11-30T06:08:02.819Z] info: tlc-batch-liquidate-wh: attached at endpoint: /webhooks/tlc-batch-liquidate-wh {} [2023-11-30T06:08:02.835Z] info: tlc-batch-liquidate scheduled - first run at 2023-11-30T06:10:00.000Z {} [2023-11-30T06:08:02.835Z] info: waiting to run tlc-batch-liquidate at 2023-11-30T06:10:00.000Z {} [2023-11-30T06:08:02.835Z] info: http server running on port 8111 {} [2023-11-30T06:08:04.170Z] info: http: ["POST","/webhooks/tlc-batch-liquidate-wh"] {} [2023-11-30T06:08:04.171Z] info: starting task action tlc-batch-liquidate-wh {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:04.199Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(block: {number: 18189826} where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:04.547Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:04.547Z] error: subgraph retry 1 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:04.548Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"118","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(block: {number: 18189826} where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:04.748Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(block: {number: 18189826} where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.035Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.035Z] error: subgraph retry 2 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.035Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"118","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(block: {number: 18189826} where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.437Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss", "subgraphQuery": "{\n tlcUsers(block: {number: 18189826} where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.743Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.743Z] error: subgraph retry 3 after rate limit {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.744Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"118","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(block: {number: 18189826} where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.744Z] error: {"message":"[\"deployment `medariox/v2-mainnetss` does not exist\"]","name":"AxiosError","stack":"AxiosError: [\"deployment `medariox/v2-mainnetss` does not exist\"]\n at BackOff2.subgraphRequest2 [as request] (/Users/anon/Documents/Web3/temple/apps/automation-v2/dist/main.js:146807:13)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","Content-Type":"application/json","User-Agent":"axios/1.5.1","Content-Length":"118","Accept-Encoding":"gzip, compress, deflate, br"},"method":"post","url":"https://api.thegraph.com/subgraphs/name/medariox/v2-mainnetss","data":"{\"query\":\"{\\n tlcUsers(block: {number: 18189826} where: {debt_gt: \\\"0\\\"}) {\\n id\\n }\\n }\"}"},"code":"OK","status":200} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:05.744Z] info: try axios post to: { "subgraphUrl": "https://subgraph.satsuma-prod.com/a912521dd162/templedao/temple-v2-mainnet/version/v0.1.0/api", "subgraphQuery": "{\n tlcUsers(block: {number: 18189826} where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:06.287Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:06.287Z] info: tlcUsers to check: [{"id":"0x71e41d0dfea7ca196c7b104f01effd1102af9694"}] {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:11.658Z] info: allocated nonce 515 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:12.509Z] info: sent transaction 0x1b86f0bc94a9185a20f2c5262ab2f2ce69632a801ec18e79d6c9f560562e8a93 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 with nonce 515 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:20.594Z] info: sending message to discord webhook 1106343269069230130 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:08:21.164Z] info: task action completed {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"}Example of correct `thegraph` endpoind, correct `alchemy` endpoints, and correct query
[2023-11-30T06:11:56.639Z] info: tlc-batch-liquidate-wh: attached at endpoint: /webhooks/tlc-batch-liquidate-wh {} [2023-11-30T06:11:56.655Z] info: tlc-batch-liquidate scheduled - first run at 2023-11-30T06:20:00.000Z {} [2023-11-30T06:11:56.655Z] info: waiting to run tlc-batch-liquidate at 2023-11-30T06:20:00.000Z {} [2023-11-30T06:11:56.656Z] info: http server running on port 8111 {} [2023-11-30T06:11:57.585Z] info: http: ["POST","/webhooks/tlc-batch-liquidate-wh"] {} [2023-11-30T06:11:57.586Z] info: starting task action tlc-batch-liquidate-wh {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:11:57.613Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnet", "subgraphQuery": "{\n tlcUsers(block: {number: 18189826} where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:11:57.963Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:11:57.964Z] info: tlcUsers to check: [{"id":"0x71e41d0dfea7ca196c7b104f01effd1102af9694"}] {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:12:03.995Z] info: allocated nonce 515 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:12:04.848Z] info: sent transaction 0x1b86f0bc94a9185a20f2c5262ab2f2ce69632a801ec18e79d6c9f560562e8a93 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 with nonce 515 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:12:12.923Z] info: sending message to discord webhook 1106343269069230130 {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:12:13.405Z] info: task action completed {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"}Example of correct `thegraph` endpoind, correct `alchemy` endpoints, and correct query but no user to liquidate, silently success
[2023-11-30T06:13:36.918Z] info: tlc-batch-liquidate-wh: attached at endpoint: /webhooks/tlc-batch-liquidate-wh {} [2023-11-30T06:13:36.935Z] info: tlc-batch-liquidate scheduled - first run at 2023-11-30T06:20:00.000Z {} [2023-11-30T06:13:36.936Z] info: waiting to run tlc-batch-liquidate at 2023-11-30T06:20:00.000Z {} [2023-11-30T06:13:36.936Z] info: http server running on port 8111 {} [2023-11-30T06:13:47.676Z] info: http: ["POST","/webhooks/tlc-batch-liquidate-wh"] {} [2023-11-30T06:13:47.677Z] info: starting task action tlc-batch-liquidate-wh {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:13:47.713Z] info: try axios post to: { "subgraphUrl": "https://api.thegraph.com/subgraphs/name/medariox/v2-mainnet", "subgraphQuery": "{\n tlcUsers(block: {number: 18189826} where: {debt_gt: \"0\"}) {\n id\n }\n }"} {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:13:48.108Z] info: res status code 200 OK {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:13:48.108Z] info: tlcUsers to check: [{"id":"0x71e41d0dfea7ca196c7b104f01effd1102af9694"}] {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"} [2023-11-30T06:13:48.128Z] info: task action completed (silently) {"task_type":"tlc-batch-liquidate-wh","taskId":"T-1"}No discord notification