简体   繁体   English

FetchError:对 https://db.fauna.com/ 的请求失败,原因:写入 EPIPE

[英]FetchError: request to https://db.fauna.com/ failed, reason: write EPIPE

I'm trying to launch my new web app using Netlify Functions accessing FaunaDB and while it seems to work locally great (via netlify dev), when it's online it feels like every 3rd call to the database fails with the following error:我正在尝试使用访问 FaunaDB 的 Netlify 函数启动我的新 Web 应用程序,虽然它似乎在本地运行良好(通过 netlify dev),但当它在线时,感觉对数据库的每第三次调用都失败并出现以下错误:

FetchError: request to https://db.fauna.com/ failed, reason: write EPIPE
at ClientRequest.<anonymous> (/var/task/src/node_modules/faunadb/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  type: 'system',
  errno: 'EPIPE',
  code: 'EPIPE'
}

I have no clue what this means or what I'm maybe doing wrong or how to fix it.我不知道这意味着什么,或者我可能做错了什么或如何解决它。 It seems like it's on Fauna's side.似乎是站在 Fauna 一边。

All of the "server side code" executing calls to Fauna are in various Netlify functions (which I guess are just wrapped up AWS Lambdas).执行对 Fauna 调用的所有“服务器端代码”都在各种 Netlify 函数中(我猜这些函数只是封装了 AWS Lambdas)。 Various different function calls hitting different Netlify functions are generating this error, not just one in particular.各种不同的函数调用命中不同的 Netlify 函数都会产生这个错误,而不仅仅是一个特定的错误。

The error that you are receiving may be caused by an issue similar to querying FaunaDB from AWS Lambda functions: https://docs.fauna.com/fauna/current/drivers/known_issues您收到的错误可能是由类似于从 AWS Lambda 函数查询 FaunaDB 的问题引起的: https ://docs.fauna.com/fauna/current/drivers/known_issues

Essentially, the Netlify function context that support your function might not always be running.本质上,支持您的函数的 Netlify 函数上下文可能并不总是在运行。 If that's the case, the connection state stored within the FaunaDB driver's client object might be stale when the execution context is restored and your next query is attempted.如果是这种情况,则在恢复执行上下文并尝试下一个查询时,存储在 FaunaDB 驱动程序的客户端对象中的连接状态可能已过时。

The typical solution is to create the client object, and perform your queries, in the main handler logic, rather than in the initialization logic.典型的解决方案是在主处理程序逻辑中创建客户端对象并执行查询,而不是在初始化逻辑中。

I don't know whether this answer is helpful for your situation.不知道这个回答对你的情况有没有帮助。 If it is, let me know and we can update the guidance in Fauna documentation.如果是,请告诉我,我们可以更新 Fauna 文档中的指南。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 FetchError:请求 http://localhost:1337/api/products 失败,原因:连接 ECONNREFUSED 127.0.0.1:1337 - FetchError: request to http://localhost:1337/api/products failed, reason: connect ECONNREFUSED 127.0.0.1:1337 npm ERR: FetchError: request to http.//registry.npmjs,org/webpack-dev-server failed: 原因。 连接 ECONNREFUSED 127.0.0:1:8000 - npm ERR! FetchError: request to http://registry.npmjs.org/webpack-dev-server failed, reason: connect ECONNREFUSED 127.0.0.1:8000 FetchError:请求http:// localhost:3000 / api / projects失败,原因:connect ECONNREFUSED 127.0.0.1:3000(Express / Next.Js) - FetchError: request to http://localhost:3000/api/projects failed, reason: connect ECONNREFUSED 127.0.0.1:3000 (Express/Next.Js) EINVRES请求https://bower.herokuapp.com/packages/失败,502 - EINVRES Request to https://bower.herokuapp.com/packages/ failed with 502 Express.js FetchError: https://api.twitter.Z4D236D9A250D102C5ZFEEC6AD1 处的无效 json 响应正文 - Express.js FetchError: invalid json response body at https://api.twitter.com 删除 Fauna DB 中的子对象 - Remove a child object in Fauna DB 来自 Fauna DB 的反向数据 - Reverse data from Fauna DB NPM:请求 https://registry.npmjs.org/corepack 失败,原因:连接 EHOSTUNREACH - NPM: request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH 错误:在sendFile()上写入EPIPE吗? - Error: write EPIPE on sendFile()? 错误:写入 EPIPE - Error: write EPIPE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM