Description: I am encountering an error while performing a batch add of cross references in Weaviate. Here is the code snippet I am using:
client.batch
.referencesBatcher()
.withReference({
from: `weaviate://localhost/UserDetails/${UserDetailsResponse.id}/socialMedia`,
to: `weaviate://localhost/UserSocialMediaDetails/${UserSocialMediaDetailsResponse.id}`,
})
.withReference({
from: `weaviate://localhost/UserDetails/${UserDetailsResponse.id}/Location`,
to: `weaviate://localhost/UserLocationDetails/${UserLocationDetailsResponse.id}`,
})
.withReference({
from: `weaviate://localhost/UserDetails/${UserDetailsResponse.id}/Portfolio`,
to: `weaviate://localhost/UserPortfolioDetails/${UserPortfolioDetailsResponse.id}`,
})
.withConsistencyLevel("ALL")
.do();
I am receiving the following error in the Weaviate database container logs:
{"error":"runtime error: invalid memory address or nil pointer dereference","level":"error","method":"POST","msg":"runtime error: invalid memory address or nil pointer dereference","path":{"Scheme":"","Opaque":"","User":null,"Host":"","Path":"/v1/batch/references","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"consistency_level=ALL","Fragment":"","RawFragment":""},"time":"2023-06-06T17:42:41Z"}
goroutine 1246 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
/usr/local/go/src/runtime/debug/stack.go:16 +0x19
github.com/weaviate/weaviate/adapters/handlers/rest.handlePanics({0x1bcd480, 0xc002f98900}, 0xc00395d100)
+0x10e
Additionally, the Node.js container logs display the following error:
/usr/src/app/node_modules/node-fetch/lib/index.js:273
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
^
FetchError: invalid json response body at http://weaviate_db:8080/v1/batch/references?consistency_level=ALL reason: Unexpected end of JSON input
at /usr/src/app/node_modules/node-fetch/lib/index.js:273:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
type: 'invalid-json'
}
Node.js v20.2.0
[nodemon] app crashed - waiting for file changes before starting...
I have confirmed that all the values of UserPortfolioDetailsResponse, UserDetailsResponse, UserLocationDetailsResponse, and UserSocialMediaDetailsResponse exist. The objects are added successfully, but sometimes the cross references between User Details and either Location or Social Media or Portfolio are failing.
Any insights or suggestions on how to resolve this issue would be greatly appreciated