Open Gresliebear opened 2 years ago
is it related??? this issue is not related because if the email was already submitted this is response from graphql server that checks the database at supabase
Sep 17, 05:31:48 PM: {"level":50,"time":1663450308988,"pid":9,"hostname":"169.254.109.229","name":"graphql-server","err":{"type":"GraphQLError","message":"\nInvalid `import_db.db.emailSignUp.create()` invocation in\n/var/task/api/dist/services/emailSignUps/emailSignUps.js:45:35\n\n 42 input\n 43 }) => {\n 44 (0, import_googlesheet.insertEmail)(input.email, input.Status);\n→ 45 return import_db.db.emailSignUp.create(\n Unique constraint failed on the fields: (`email`)","stack":"Error: \nInvalid `import_db.db.emailSignUp.create()` invocation in\n/var/task/api/dist/services/emailSignUps/emailSignUps.js:45:35\n\n 42 input\n 43 }) => {\n 44 (0, import_googlesheet.insertEmail)(input.email, input.Status);\n→ 45 return import_db.db.emailSignUp.create(\n Unique constraint failed on the fields: (`email`)\n at RequestHandler.request (/var/task/node_modules/@prisma/client/runtime/index.js:49022:15)\n at async PrismaClient._request (/var/task/node_modules/@prisma/client/runtime/index.js:49919:18)\n at async /var/task/node_modules/@envelop/core/cjs/orchestrator.js:380:27\n at async processRequest (/var/task/node_modules/@graphql-yoga/common/cjs/processRequest.js:26:20)\n at async YogaServer.getResponse (/var/task/node_modules/@graphql-yoga/common/cjs/server.js:310:28)\n at async YogaServer.handleRequest (/var/task/node_modules/@graphql-yoga/common/cjs/server.js:74:30)\n at async handlerFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:295:24)\n at async execFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:334:16)","path":["createEmailSignUp"],"locations":[{"line":2,"column":3}],"extensions":{}},"msg":"\nInvalid `import_db.db.emailSignUp.create()` invocation in\n/var/task/api/dist/services/emailSignUps/emailSignUps.js:45:35\n\n 42 input\n 43 }) => {\n 44 (0, import_googlesheet.insertEmail)(input.email, input.Status);\n→ 45 return import_db.db.emailSignUp.create(\n Unique constraint failed on the fields: (`email`)"}
400 Bad Request - basically Google server will not process the request because due to something
LAMBDA RUNTIME could be because we requested too fast, https://answers.netlify.com/t/async-await-not-working-as-expected-in-lambda-function/16098/2
Sep 17, 05:32:43 PM: [ERROR] [1663450363964] LAMBDA_RUNTIME Failed to post handler success response. Http response code: 400.
Sep 17, 05:32:44 PM: 573a2f1e Duration: 103.14 ms Memory Usage: 192 MB Sep 17, 05:32:44 PM: RequestId: 573a2f1e-aa28-4e12-80e7-14c7163bac2b Error: Runtime exited with error: exit status 128
Runtime.ExitError
Sep 17, 05:39:10 PM: d052186e INFO Error: Client network socket disconnected before secure TLS connection was established
at connResetException (node:internal/errors:692:14)
at TLSSocket.onConnectEnd (node:_tls_wrap:1587:19)
at TLSSocket.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'ECONNRESET',
path: null,
host: 'sheets.googleapis.com',
port: 443,
localAddress: undefined,
config: {
url: "/values/'Sheet1'!A1:append",
method: 'post',
data: '{"values":[["hsjxpqdf222222131323213egggbiamdcexdj@nthrw.com","No"]]}',
headers: {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
Authorization: 'Bearer ya29.c.b0AXv0zTNK52C5x5Ll0FAtZBF5USuMOdMMx-kPB8r2-HNlGKkGAtUn17glCQPxQte_SnoMX97t-05voB4sp19pjCp9I2-EOQv7BkYjVJnjfwN9Bz2TnhWKODZ_sHbtCWLcj0KOhTjG3A1ACNPrxQht-NZOgltlRQan1wloQml7VTYBWrqR0M5HwHlY0Lxc1ic2t80-e2HlClLAuUbRN5CSh7tgGMcpV_Y........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................',
'User-Agent': 'axios/0.21.4',
'Content-Length': 69
},
params: {
valueInputOption: 'USER_ENTERED',
insertDataOption: 'OVERWRITE',
includeValuesInResponse: true
},
baseURL: 'https://sheets.googleapis.com/v4/spreadsheets/1MBfmJowTVqVhCyQa1hJByk57xVzaJngEJmpGX1fvAmg',
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
paramsSerializer: [Function: paramsSerializer],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus],
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
}
},
request: <ref *1> Writable {
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 0,
constructed: true,
prefinished: false,
errorEmitted: false,
emitClose: true,
autoDestroy: true,
errored: null,
closed: false,
closeEmitted: false,
[Symbol(kOnFinished)]: []
},
_events: [Object: null prototype] {
response: [Function: handleResponse],
error: [Function: handleRequestError]
},
_eventsCount: 2,
_maxListeners: undefined,
_options: {
maxRedirects: 21,
maxBodyLength: 10485760,
protocol: 'https:',
path: '/v4/spreadsheets/1MBfmJowTVqVhCyQa1hJByk57xVzaJngEJmpGX1fvAmg/values/%27Sheet1%27!A1:append?valueInputOption=USER_ENTERED&insertDataOption=OVERWRITE&includeValuesInResponse=true',
method: 'POST',
headers: [Object],
agent: undefined,
agents: [Object],
auth: undefined,
hostname: 'sheets.googleapis.com',
port: null,
nativeProtocols: [Object],
pathname: '/v4/spreadsheets/1MBfmJowTVqVhCyQa1hJByk57xVzaJngEJmpGX1fvAmg/values/%27Sheet1%27!A1:append',
search: '?valueInputOption=USER_ENTERED&insertDataOption=OVERWRITE&includeValuesInResponse=true'
},
_ended: false,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 69,
_requestBodyBuffers: [ [Object] ],
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: true,
_closed: false,
socket: [TLSSocket],
_header: 'POST /v4/spreadsheets/1MBfmJowTVqVhCyQa1hJByk57xVzaJngEJmpGX1fvAmg/values/%27Sheet1%27!A1:append?valueInputOption=USER_ENTERED&insertDataOption=OVERWRITE&includeValuesInResponse=true HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json\r\n' +
'Authorization: Bearer ya29.c.b0AXv0zTNK52C5x5Ll0FAtZBF5USuMOdMMx-kPB8r2-HNlGKkGAtUn17glCQPxQte_SnoMX97t-05voB4sp19pjCp9I2-EOQv7BkYjVJnjfwN9Bz2TnhWKODZ_sHbtCWLcj0KOhTjG3A1ACNPrxQht-NZOgltlRQan1wloQml7VTYBWrqR0M5HwHlY0Lxc1ic2t80-e2HlClLAuUbRN5CSh7tgGMcpV_Y........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................\r\n' +
'User-Agent: axios/0.21.4\r\n' +
'Content-Length: 69\r\n' +
'Host: sheets.googleapis.com\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: [Agent],
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/v4/spreadsheets/1MBfmJowTVqVhCyQa1hJByk57xVzaJngEJmpGX1fvAmg/values/%27Sheet1%27!A1:append?valueInputOption=USER_ENTERED&insertDataOption=OVERWRITE&includeValuesInResponse=true',
_ended: false,
res: null,
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'sheets.googleapis.com',
protocol: 'https:',
_redirectable: [Circular *1],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'https://sheets.googleapis.com/v4/spreadsheets/1MBfmJowTVqVhCyQa1hJByk57xVzaJngEJmpGX1fvAmg/values/%27Sheet1%27!A1:append?valueInputOption=USER_ENTERED&insertDataOption=OVERWRITE&includeValuesInResponse=true',
[Symbol(kCapture)]: false
},
response: undefined,
isAxiosError: true,
toJSON: [Function: toJSON]
}
Sep 17, 05:39:10 PM: d052186e ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"FetchError: request to https://www.googleapis.com/oauth2/v4/token failed, reason: Client network socket disconnected before secure TLS connection was established","reason":{"errorType":"FetchError","errorMessage":"request to https://www.googleapis.com/oauth2/v4/token failed, reason: Client network socket disconnected before secure TLS connection was established","code":"ECONNRESET","message":"request to https://www.googleapis.com/oauth2/v4/token failed, reason: Client network socket disconnected before secure TLS connection was established","type":"system","errno":"ECONNRESET","config":{"method":"POST","url":"https://www.googleapis.com/oauth2/v4/token","data":{"grant_type":"urn:ietf:params:oauth:grant-type:jwt-bearer","assertion":"eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzd2VlcGFib3RAcGVhay1jb21mb3J0LTM2MTYwMi5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNjb3BlIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9zcHJlYWRzaGVldHMiLCJhdWQiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9vYXV0aDIvdjQvdG9rZW4iLCJleHAiOjE2NjM0NTQwNzUsImlhdCI6MTY2MzQ1MDQ3NSwic3ViIjpudWxsfQ.Dh7MwtQ-xZTH9upzvPlZLSBFTc1WkLO9fG_Pe7vWIQKQzRgOajGhhLacpp5OfpJrc9uE3XYHkHrDboxYl2etFIrM7TbUfcwmwF2bCa7kjicXoTXplqNqIJs6Y0iawtGzpI7kreRDXNLjsLmbk2rIPXvt7oqCZRKlPh7t5kdiWEtN65KwkUwGXHJENc37UadEViIp3xCB9i6NTDjraCKV2tG6odUXseFiCt1tvlTkudnOOc5BfeDfQKCtP8GvwS3DqBNZ1Ze50Q91WCG_TLoyj3urkBOqFlXQMCTSg4V-0pMXWD2LEseF2jBXUrXHw4rgzC2gAFBRs-kIi3iqNPx4jg"},"headers":{"Content-Type":"application/x-www-form-urlencoded","Accept":"application/json"},"responseType":"json","body":"grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzd2VlcGFib3RAcGVhay1jb21mb3J0LTM2MTYwMi5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNjb3BlIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9zcHJlYWRzaGVldHMiLCJhdWQiOiJodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9vYXV0aDIvdjQvdG9rZW4iLCJleHAiOjE2NjM0NTQwNzUsImlhdCI6MTY2MzQ1MDQ3NSwic3ViIjpudWxsfQ.Dh7MwtQ-xZTH9upzvPlZLSBFTc1WkLO9fG_Pe7vWIQKQzRgOajGhhLacpp5OfpJrc9uE3XYHkHrDboxYl2etFIrM7TbUfcwmwF2bCa7kjicXoTXplqNqIJs6Y0iawtGzpI7kreRDXNLjsLmbk2rIPXvt7oqCZRKlPh7t5kdiWEtN65KwkUwGXHJENc37UadEViIp3xCB9i6NTDjraCKV2tG6odUXseFiCt1tvlTkudnOOc5BfeDfQKCtP8GvwS3DqBNZ1Ze50Q91WCG_TLoyj3urkBOqFlXQMCTSg4V-0pMXWD2LEseF2jBXUrXHw4rgzC2gAFBRs-kIi3iqNPx4jg"},"stack":["FetchError: request to https://www.googleapis.com/oauth2/v4/token failed, reason: Client network socket disconnected before secure TLS connection was established"," at ClientRequest.<anonymous> (/var/task/node_modules/node-fetch/lib/index.js:1491:11)"," at ClientRequest.emit (node:events:527:28)"," at TLSSocket.socketErrorListener (node:_http_client:454:9)"," at TLSSocket.emit (node:events:527:28)"," at emitErrorNT (node:internal/streams/destroy:157:8)"," at emitErrorCloseNT (node:internal/streams/destroy:122:3)"," at processTicksAndRejections (node:internal/process/task_queues:83:21)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: FetchError: request to https://www.googleapis.com/oauth2/v4/token failed, reason: Client network socket disconnected before secure TLS connection was established"," at process.<anonymous> (file:///var/runtime/index.mjs:1131:17)"," at process.emit (node:events:527:28)"," at emit (node:internal/process/promises:140:20)"," at processPromiseRejections (node:internal/process/promises:274:27)"," at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Sep 17, 05:39:10 PM: [ERROR] [1663450750300] LAMBDA_RUNTIME Failed to post handler success response. Http response code: 400.
Sep 17, 05:39:10 PM: 25d1eba9 Duration: 16.10 ms Memory Usage: 140 MB Sep 17, 05:39:10 PM: RequestId: 25d1eba9-5fd1-4113-a555-450367679f7a Error: Runtime exited with error: exit status 128
Runtime.ExitError
Sep 17, 05:39:25 PM: 4aa2c09b INFO were inside hsjxpqdfsss22221dj@nthrw.com
Sep 17, 05:39:25 PM: 4aa2c09b INFO were inside Yes
Sep 17, 05:39:25 PM: 4aa2c09b ERROR (node:9) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Sep 17, 05:39:26 PM: 4aa2c09b Duration: 869.10 ms Memory Usage: 129 MB
Were getting values on Googles API and cloud dashboard but no data on thje google sheet
Sep 17, 05:39:25 PM: 4aa2c09b INFO were inside hsjxpqdfsss22221dj@nthrw.com
Sep 17, 05:39:25 PM: 4aa2c09b INFO were inside Yes
Sep 17, 05:39:25 PM: 4aa2c09b ERROR (node:9) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Sep 17, 05:39:26 PM: 4aa2c09b Duration: 869.10 ms Memory Usage: 129 MB Sep 17, 05:50:30 PM: ee579fdc INFO were inside hsjxpqfsawda221dj@nthrw.com
Sep 17, 05:50:30 PM: ee579fdc INFO were inside No
Sep 17, 05:50:30 PM: ee579fdc ERROR (node:9) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Sep 17, 05:50:31 PM: ee579fdc Duration: 1069.48 ms Memory Usage: 191 MB Init Duration: 1671.60 ms Sep 17, 05:51:21 PM: ee579fdc INFO GoogleSheet Sweepa
Sep 17, 05:51:21 PM: ee579fdc INFO Sheet1
Sep 17, 05:51:21 PM: ee579fdc INFO 1000
Sep 17, 05:51:21 PM: 966eeff4 INFO were inside hsjxpqfsassssswda221dj@nthrw.com
Sep 17, 05:51:21 PM: 966eeff4 INFO were inside Yes
Sep 17, 05:51:21 PM: 966eeff4 Duration: 156.80 ms Memory Usage: 192 MB Sep 17, 05:51:24 PM: 944ca330 INFO were inside hsfasdwda221dj@nthrw.com
Sep 17, 05:51:24 PM: 944ca330 INFO were inside Yes
Sep 17, 05:51:24 PM: 944ca330 Duration: 140.22 ms Memory Usage: 192 MB Sep 17, 05:51:32 PM: 75196802 INFO were inside asd221dj@nthrw.com
Sep 17, 05:51:32 PM: 75196802 INFO were inside No
Sep 17, 05:51:32 PM: 75196802 Duration: 34.87 ms Memory Usage: 192 MB Sep 17, 05:51:37 PM: 75196802 INFO GoogleSheet Sweepa
Sep 17, 05:51:37 PM: 75196802 INFO Sheet1
Sep 17, 05:51:37 PM: 75196802 INFO 1000
Sep 17, 05:51:37 PM: 75196802 INFO GoogleSheet Sweepa
Sep 17, 05:51:37 PM: 75196802 INFO Sheet1
Sep 17, 05:51:37 PM: 75196802 INFO 1000
Sep 17, 05:51:37 PM: 4cf531db INFO were inside asd221dj@nthrw.com
Sep 17, 05:51:37 PM: 4cf531db INFO were inside No
Sep 17, 05:51:37 PM: {"level":50,"time":1663451497443,"pid":9,"hostname":"169.254.40.141","name":"graphql-server","err":{"type":"GraphQLError","message":"\nInvalid `import_db.db.emailSignUp.create()` invocation in\n/var/task/api/dist/services/emailSignUps/emailSignUps.js:45:35\n\n 42 input\n 43 }) => {\n 44 (0, import_googlesheet.insertEmail)(input.email, input.Status);\n→ 45 return import_db.db.emailSignUp.create(\n Unique constraint failed on the fields: (`email`)","stack":"Error: \nInvalid `import_db.db.emailSignUp.create()` invocation in\n/var/task/api/dist/services/emailSignUps/emailSignUps.js:45:35\n\n 42 input\n 43 }) => {\n 44 (0, import_googlesheet.insertEmail)(input.email, input.Status);\n→ 45 return import_db.db.emailSignUp.create(\n Unique constraint failed on the fields: (`email`)\n at RequestHandler.request (/var/task/node_modules/@prisma/client/runtime/index.js:49022:15)\n at async PrismaClient._request (/var/task/node_modules/@prisma/client/runtime/index.js:49919:18)\n at async /var/task/node_modules/@envelop/core/cjs/orchestrator.js:380:27\n at async processRequest (/var/task/node_modules/@graphql-yoga/common/cjs/processRequest.js:26:20)\n at async YogaServer.getResponse (/var/task/node_modules/@graphql-yoga/common/cjs/server.js:310:28)\n at async YogaServer.handleRequest (/var/task/node_modules/@graphql-yoga/common/cjs/server.js:74:30)\n at async handlerFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:295:24)\n at async execFn (/var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:334:16)","path":["createEmailSignUp"],"locations":[{"line":2,"column":3}],"extensions":{}},"msg":"\nInvalid `import_db.db.emailSignUp.create()` invocation in\n/var/task/api/dist/services/emailSignUps/emailSignUps.js:45:35\n\n 42 input\n 43 }) => {\n 44 (0, import_googlesheet.insertEmail)(input.email, input.Status);\n→ 45 return import_db.db.emailSignUp.create(\n Unique constraint failed on the fields: (`email`)"}
Sep 17, 05:51:37 PM: 4cf531db Duration: 42.77 ms Memory Usage: 192 MB
NEW EVIDENCE FOR BUG
the request to google api is sent before it receives the data worked!!! for PRODUCTION NewAccounPROD2tasd221dj@nthrw.com
Sep 17, 06:18:14 PM: b7e6c445 Duration: 960.20 ms Memory Usage: 192 MB Init Duration: 1800.24 ms Sep 17, 06:18:15 PM: b7e6c445 INFO GoogleSheet Sweepa
Sep 17, 06:18:15 PM: b7e6c445 INFO Sheet1
Sep 17, 06:18:15 PM: b7e6c445 INFO 1000
Sep 17, 06:18:15 PM: 71f2be2d INFO were inside NewAccounPROD3tasd221dj@nthrw.com
Sep 17, 06:18:15 PM: 71f2be2d INFO were inside Yes
Sep 17, 06:18:15 PM: 71f2be2d Duration: 23.23 ms Memory Usage: 192 MB Sep 17, 06:18:19 PM: 16949700 INFO were inside NewAccounPROD4tasd221dj@nthrw.com
Sep 17, 06:18:19 PM: 16949700 INFO were inside No
Sep 17, 06:18:19 PM: 16949700 Duration: 23.26 ms Memory Usage: 193 MB Sep 17, 06:18:23 PM: 4c6dc22a INFO were inside NewAccounPROD5tasd221dj@nthrw.com
Sep 17, 06:18:23 PM: 4c6dc22a INFO were inside Yes
Sep 17, 06:18:23 PM: 4c6dc22a Duration: 20.14 ms Memory Usage: 193 MB Sep 17, 06:18:29 PM: 4c6dc22a INFO GoogleSheet Sweepa
Sep 17, 06:18:29 PM: 4c6dc22a INFO Sheet1
Sep 17, 06:18:29 PM: 4c6dc22a INFO 1000
Sep 17, 06:18:29 PM: a5f18968 INFO were inside NewAccounPROD6asd221dj@nthrw.com
Sep 17, 06:18:29 PM: a5f18968 INFO were inside No
Sep 17, 06:18:29 PM: a5f18968 Duration: 32.60 ms Memory Usage: 193 MB
So when I make email input on the redwood app
Expected Behaviour: we have services function inserting data into google sheets
which serverless function is doing as expected