当试图在本地(使用docker compose)将~10k项数组(确切地说是10810项)插入到我的Weaviate实例时,我遇到了以下错误:
FetchError: request to http://localhost:8080/v1/batch/objects failed, reason: socket hang up
at ClientRequest.<anonymous> (/Users/bram/Dropbox/PARA/Projects/weaviate-kindle/node_modules/node-fetch/index.js:133:11)
at ClientRequest.emit (node:events:527:28)
at Socket.socketOnEnd (node:_http_client:478:9)
at Socket.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1344:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ECONNRESET',
code: 'ECONNRESET'
}但是,一些对象已成功上传。当我在Weaviate控制台中运行元计数查询时,我发现了1233个对象(见图)

下面是用于导入剪报的相关批处理代码:
async function importClippings() {
// Get the data from the data.json file
const data = await getJsonData();
// Prepare a batcher
let batcher = client.batch.objectsBatcher();
let counter = 0;
data.clippings.forEach((clipping) => {
// Construct an object with a class, id, properties and vector
const obj = generateClippingObject(clipping);
// add the object to the batch queue
batcher = batcher.withObject(obj);
// When the batch counter reaches 20, push the objects to Weaviate
if (counter++ == 20) {
// flush the batch queue
batcher
.do()
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});
// restart the batch queue
counter = 0;
batcher = client.batch.objectsBatcher();
}
});
// Flush the remaining objects
batcher
.do()
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});
}编辑:在Docker日志中也出现了此错误:
weaviate-kindle-t2v-transformers-1 | INFO: 172.18.0.5:53942 - "POST /vectors/ HTTP/1.1" 200 OK
weaviate-kindle-weaviate-1 | {
"description":"An I/O timeout occurs when the request takes longer than the specified server-side timeout.",
"error":"write tcp 172.18.0.5:8080-\u003e172.18.0.1:61056: i/o timeout",
"hint":"Either try increasing the server-side timeout using e.g. '--write-timeout 600s' as a command line flag when starting Weaviate, or try sending a computationally cheaper request, for example by reducing a batch size, reducing a limit, using less complex filters, etc. Note that this error is only thrown if client-side and server-side timeouts are not in sync, more precisely if the client-side timeout is longer than the server side timeout.",
"level":"error",
"method":"POST",
"msg":"i/o timeout",
"path":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/v1/batch/objects","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"","Fragment":"","RawFragment":""},"time":"2022-11-03T05:33:30Z"}
}发布于 2022-11-03 11:00:31
此问题在Docker日志中可见:)
"An I/O timeout occurs when the request takes longer than the specified server-side timeout."这意味着您发送请求,并且Weaviate完成请求所需的时间要比客户端定义的超时时间长。
这通常有两个原因:
如果你带着你自己的向量(即,你使用的是单独的,没有向量化模块),批大小太高了。如果你使用向量化模块,很可能这是第一个bottleneck.
https://stackoverflow.com/questions/74298593
复制相似问题