dolthub / dolthub/dolt

Dolt SQL Server Replica Pod Fails to Start After Restart with Nil Pointer Dereference Panic

Open
#10,063 5 comments 0 reactions 0 assignees View on GitHub
bug customer issue no repro panic sql server
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

I created two pods using the image `dolthub/dolt-sql-server:1.76.2`, where `dolt-0` is the primary node and `dolt-1` is the replica node.

After running for a period of time, the `dolt-1` node restarted but consistently failed to start. The failure logs are as follows:

```
Defaulted container "insight-dolt" out of: insight-dolt, init-config (init)
Starting server with Config HP="0.0.0.0:6033"|T="28800000"|R="false"|L="info"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x242dace]

goroutine 122 [running]:
github.com/dolthub/dolt/go/libraries/doltcore/doltdb.(*DoltDB).AccessMode(0x440cbd0?)
github.com/dolthub/dolt/go/libraries/doltcore/doltdb/doltdb.go:192 +0xe
github.com/dolthub/dolt/go/libraries/doltcore/env.(*DoltEnv).IsAccessModeReadOnly(0xc001076be0?, {0x440cbd0?, 0xc00107e690?})
github.com/dolthub/dolt/go/libraries/doltcore/env/environment.go:1321 +0x56
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver.ConfigureServices.func5.1(...)
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver/server.go:194
github.com/dolthub/dolt/go/libraries/doltcore/env.(*MultiRepoEnv).Iter(...)
github.com/dolthub/dolt/go/libraries/doltcore/env/multi_repo_env.go:299
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver.ConfigureServices.func5({0x440cbd0, 0xc00107e690})
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver/server.go:193 +0x7d
github.com/dolthub/dolt/go/libraries/utils/svcs.AnonService.Init(...)
github.com/dolthub/dolt/go/libraries/utils/svcs/controller.go:48
github.com/dolthub/dolt/go/libraries/utils/svcs.(*Controller).Start(0xc000eaecc0, {0x440cbd0, 0xc00107e690})
github.com/dolthub/dolt/go/libraries/utils/svcs/controller.go:221 +0x1bf
created by github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver.Serve in goroutine 1
github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver/server.go:102 +0x145
```

Unable to determine the root cause, I cleaned up the PVC used by `dolt-1` and recreated `dolt-1`, which resolved the issue. Now, I would like to understand the cause of this problem and the proper solution.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.