TiDB Startup Failure

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TIDB启动失败

| username: 奋斗的大象

[ERROR] [tempDir.go:76] [“The current temporary storage dir has been occupied by another instance, check tmp-storage-path config and make sure they are different.”] [TempStoragePath=“/data13/tidb/tmpStorage/1022_tidb/MC4wLjAuMDo0MDAwLzAuMC4wLjA6MTAwODA=/tmp-storage”] [error=“fslock: lock is held”] [stack=“github.com/pingcap/tidb/util/disk.InitializeTempDir\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/util/disk/tempDir.go:76\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:180\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250”]

| username: 奋斗的大象 | Original post link

[2024/05/22 15:51:27.173 +08:00] [FATAL] [terror.go:292] [“unexpected error”] [error=“fslock: lock is held”] [stack=“github.com/pingcap/tidb/parser/terror.MustNil\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:292\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:181\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250”] [stack=“github.com/pingcap/tidb/parser/terror.MustNil\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/parser/terror/terror.go:292\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/tidb-server/main.go:181\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250”]
[tidb@cnhuam0dp06 scripts]$
Message from syslogd@localhost.localdomain at May 22 15:52:10 …

| username: forever | Original post link

Has it already been installed on the current machine?

| username: TI表弟 | Original post link

It sounds like the directory is being occupied. Was there a previous installation that wasn’t cleaned up properly?

| username: Kongdom | Original post link

Sure, please provide the text you need translated.

| username: yytest | Original post link

This error message indicates that the TiDB server attempted to initialize the temporary storage directory but found that the directory was already occupied by another instance. The error message [error="fslock: lock is held"] points out that a file lock is being held, preventing the new instance from accessing the directory.

| username: TiDBer_QYr0vohO | Original post link

The directory is occupied, the previous cluster was not cleaned up properly.