# Fatal error: Panic: runtime error: invalid memory address or nil pointer dereference

**URL:** <https://forum.weaviate.io/t/fatal-error-panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference/1713>\
**Category:** Support\
**Created:** [March 14, 2024, 10:30am UTC](https://forum.weaviate.io/t/fatal-error-panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference/1713 "2024-03-14T10:30:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllisonChen](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/allisonchen/32/752_2.png) [@AllisonChen](https://forum.weaviate.io/u/AllisonChen)\
**Post date:** [March 14, 2024, 10:30am UTC](https://forum.weaviate.io/t/fatal-error-panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference/1713/1 "2024-03-14T10:30:46Z")

</div>

### Description

Hello Team,

We are now having a fatal error which makes our Weaviate down and restart. The log level is error but it actually led Weaviate unhealthy.

```auto
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate error panic: runtime error: invalid memory address or nil pointer dereference
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xa75c83]
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate goroutine 5396921 [running]:
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate github.com/weaviate/weaviate/entities/schema.GetClassByName(0x7f5ba17d11c8?, {0xc5714a4380, 0x1a})
	/go/src/github.com/weaviate/weaviate/entities/schema/backward_compat.go:30 +0xa3
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate github.com/weaviate/weaviate/entities/schema.(*Schema).FindClassByName(...)
	/go/src/github.com/weaviate/weaviate/entities/schema/accessors.go:29
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate github.com/weaviate/weaviate/usecases/schema.(*Manager).getClassByName(0x4d4c37?, {0xc5714a4380?, 0xbd8b1d?})
	/go/src/github.com/weaviate/weaviate/usecases/schema/get.go:77 +0x25
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate github.com/weaviate/weaviate/usecases/schema.(*Manager).GetClass(0xc000501800, {0xc2fe8fbef0?, 0x184322d?}, 0x12?, {0xc5714a4380, 0x1a})
	/go/src/github.com/weaviate/weaviate/usecases/schema/get.go:69 +0x7f
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate github.com/weaviate/weaviate/usecases/objects.(*BatchManager).validateObject(0xc003cd8280, {0x1c0b288, 0xc2fe8fb950}, 0x6?, 0xc21be84a80, 0x15, 0xc4e37b08b0, 0xb6d106?, 0x0)
	/go/src/github.com/weaviate/weaviate/usecases/objects/batch_add.go:162 +0x61d
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate github.com/weaviate/weaviate/usecases/objects.(*BatchManager).validateObjectsConcurrently.func1()
	/go/src/github.com/weaviate/weaviate/usecases/objects/batch_add.go:105 +0x3d
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate golang.org/x/sync/errgroup.(*Group).Go.func1()
	/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:75 +0x64
Mar 14 16:39:48 weaviate-rerank-second-0 weaviate created by golang.org/x/sync/errgroup.(*Group).Go
	/go/pkg/mod/golang.org/x/sync@v0.1.0/errgroup/errgroup.go:72 +0xa5
Mar 14 16:39:52 weaviate-rerank-second-0 weaviate info {"action":"config_load","config_file_path":"/weaviate-config/conf.yaml","level":"info","msg":"Usage of the weaviate.conf.json file is deprecated and will be removed in the future. Please use environment variables.","time":"2024-03-14T08:39:52Z"}
Mar 14 16:39:52 weaviate-rerank-second-0 weaviate warning {"deprecation":{"apiType":"Configuration","id":"config-files","locations":["--config-file=\"\""],"mitigation":"Configure Weaviate using environment variables.","msg":"use of deprecated command line argument --config-file","sinceTime":"2020-09-08T09:46:00.000Z","sinceVersion":"0.22.16","status":"deprecated"},"level":"warning","msg":"use of deprecated command line argument --config-file","time":"2024-03-14T08:39:52Z"}
Mar 14 16:39:52 weaviate-rerank-second-0 weaviate info {"action":"startup","default_vectorizer_module":"text2vec-huggingface","level":"info","msg":"the default vectorizer modules is set to \"text2vec-huggingface\", as a result all new schema classes without an explicit vectorizer setting, will use this vectorizer","time":"2024-03-14T08:39:52Z"}
Mar 14 16:39:52 weaviate-rerank-second-0 weaviate info {"action":"startup","auto_schema_enabled":true,"level":"info","msg":"auto schema enabled setting is set to \"true\"","time":"2024-03-14T08:39:52Z"}

```

We cannot actually reproduce it, but we observe the same behavior patterns have led to this fatal error:

Our service on pod1 is batch ingesting data objects for class A, while pod2 is batch deleting data objects for class B. Right after the deletion, Weaviate encounters an error and restarts, causing both the ingestion and deletion processes to fail.

### Server Setup Information

- Weaviate Server Version: 1.20
- Deployment Method: k8s
- Standalone
- Client Language and Version: Python 3.11

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [March 14, 2024, 1:02pm UTC](https://forum.weaviate.io/t/fatal-error-panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference/1713/2 "2024-03-14T13:02:05Z")

</div>

Hi!

This may be related to this issue:

> <https://github.com/weaviate/weaviate/issues/3229>
>
> 1. git clone ... && git checkout ada4285d1b9fae59cb62db9dab6818bcb39d483c
> 2. ad…d the following section in \`tools/dev/run\_dev\_server.sh\`:
> 
> \`\`\`
> local-openai-cohere)
> AUTHENTICATION\_ANONYMOUS\_ACCESS\_ENABLED=true \\
> DEFAULT\_VECTORIZER\_MODULE=text2vec-openai \\
> CLUSTER\_HOSTNAME="node1" \\
> ENABLE\_MODULES="text2vec-openai,text2vec-cohere,reranker-cohere" \\
> go\_run ./cmd/weaviate-server \\
> --scheme http \\
> --host "127.0.0.1" \\
> --port 8080 \\
> --read-timeout=600s \\
> --write-timeout=600s
> ;;
> \`\`\`
> 
> 3. Grab a Cohere API key and launch the dev server locally:
> 
> \`\`\`bash
> COHERE\_APIKEY=... tools/dev/run\_dev\_server.sh local-all-openai-cohere-palm
> \`\`\`
> 
> 4. Upload the \[JeopardyQuestions10k() dataset\](https://pypi.org/project/weaviate-demo-datasets/)
> 5. Connect to localhost:8080 using WCS
> 6. Paste the following GraphQL query:
> 
> \`\`\`graphql
> query all {
> Get {
> JeopardyQuestion {
> question
> answer
> }
> }
> }
> 
> 
> query nearTextRerank {
> Get {
> JeopardyQuestion(
> bm25: {
> query: "flying"
> }
> limit: 10
> ) {
> answer
> question
> \_additional {
> score
> rerank(
> property: "answer"
> query: "animals"
> ) {
> score
> }
> }
> }
> }
> }
> \`\`\`
> 
> 7. Execute the \`all\` query and verify that it returns results.
> 8. Execute the \`nearTextRerank\` query and check for the error.
> 
> \<img width="1382" alt="image" src="https://github.com/weaviate/weaviate/assets/33569/65b2cb47-f803-4766-b9ca-ab42a4df152c"\>
> 
> 9. The bug could be reproduced intermittently with just this query:
> 
> \`\`\`
> {
> Get {
> JeopardyQuestion(
> bm25: {
> query: "flying"
> }
> limit: 10
> ) {
> answer
> question
> \_additional {
> score
> rerank(
> property: "question"
> query: "birds"
> ) {
> score
> }
> }
> }
> }
> }
> \`\`\`
> 
> \# Notes
> 
> \* Apple M1 Max, 32GB RAM, Ventura 13.4.1 (22F82)
> \* the bug wasn't reproduced if \`text2vec-cohere\` is missing from \`ENABLE\_MODULES\`
> \* renaming the \`nearTextRerank\` query to \`bm25Rerank\` or some other name resulted intermittently in the query executing correctly
> \* plenty of free memory: 
> \<img width="694" alt="image" src="https://github.com/weaviate/weaviate/assets/33569/b85aa37f-75e2-43f4-8bd8-fcd586fc4971"\>

So my first advice would be ingesting your dataset on a Weaviate latest version (1.24.2), and make sure that this still happens.

1.20 is a fairly old version already. A lot was fixed since.

Let me know if this helps!

---

<div class="post-metadata">

**Author:** ![AllisonChen](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/allisonchen/32/752_2.png) [@AllisonChen](https://forum.weaviate.io/u/AllisonChen)\
**Post date:** [March 20, 2024, 2:46am UTC](https://forum.weaviate.io/t/fatal-error-panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference/1713/3 "2024-03-20T02:46:07Z")

</div>

Thank you @DudaNogueira , we will first upgrade to 1.24 and see if it is still there.
