plandex-ai/plandex · error

error checking lock file: %v

Error message

error checking lock file: %v

What it means

Returned by removeLockFile when os.Stat on the git lock file path (index.lock) fails with an error other than os.IsNotExist. A non-existence error is expected and ignored; any other Stat failure (permission denied, I/O error, invalid path) means the lock file's presence cannot be determined, so no attempt is made to wait for or remove it.

Source

Thrown at app/server/db/git.go:562

			// Combine header and message with a newline only if the message is not empty.
			fullEntry := header
			if message != "" {
				fullEntry += "\n" + message
			}

			history = append(history, [2]string{sha, fullEntry})
		}
	}

	return history
}

func removeLockFile(lockFilePath string) error {
	_, err := os.Stat(lockFilePath)
	exists := err == nil
	// log.Println("index.lock file exists:", exists)
	if err != nil && !os.IsNotExist(err) {
		return fmt.Errorf("error checking lock file: %v", err)
	}

	attempts := 0
	for exists {
		if attempts > 10 {
			return fmt.Errorf("error removing index.lock file: %v after %d attempts", err, attempts)
		}

		log.Printf("[Git] removeLockFile - removing index.lock file: %s, attempt: %d", lockFilePath, attempts)

		if err := os.Remove(lockFilePath); err != nil {
			if os.IsNotExist(err) {
				log.Printf("[Git] removeLockFile - %s file not found, skipping removal", lockFilePath)
				return nil
			}

			return fmt.Errorf("error removing lock file: %v", err)
		}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check the wrapped error (permissions, I/O) on the repo path
  2. Verify the process can stat files in the repo's .git dir
  3. Retry after filesystem access is restored
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at app/server/db/git.go:562 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/97d8b29e0fefbdb3. Report an issue: GitHub.