dolthub / dolthub/dolt

dolt init hangs in a brand-new directory on Linux ext4, appears to stall after directory fsync

Open
#10,746 1 comment 0 reactions 0 assignees View on GitHub
bug cli customer issue
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 8h
Merged PRs (30d)
120

Description

## What happened

`dolt init` hangs indefinitely in a brand-new directory.

This is reproducible outside any higher-level tool. I originally hit it through beads / `dolt sql-server`, but the
problem reproduces with plain Dolt in a clean temp directory.

## Repro

```bash
mkdir -p /home/andy/dolt-smoke
cd /home/andy/dolt-smoke
dolt init

Expected:

- dolt init completes quickly and creates a fresh repo

Actual:

- dolt init hangs indefinitely

I also reproduced the same behavior in /tmp.

## Environment

- OS: Ubuntu 24.04.4 LTS (Noble Numbat)
- Kernel: Linux 6.8.0-106-generic
- Architecture: x86_64
- Filesystem: ext4
- Dolt version: 1.84.0

dolt version
# dolt version 1.84.0

df -T for both /home/andy and /tmp shows ext4 on the root volume.

## Additional symptom

dolt sql-server against a fresh repo also hangs after printing the startup config line, and never reaches a ready/
listening state.

## strace detail

I traced a fresh dolt init and it gets through:

- creating .dolt/
- creating .dolt/noms/
- creating .dolt/temptf/
- writing .dolt/config.json
- fsync on the file
- renaming it into place

Then it opens the .dolt directory and appears to stall around fsync on the directory FD.

Relevant trace tail:

mkdirat(AT_FDCWD, "/home/andy/dolt-smoke/.dolt", 0777) = 0
mkdirat(AT_FDCWD, "/home/andy/dolt-smoke/.dolt/noms", 0777) = 0
mkdirat(AT_FDCWD, "/home/andy/dolt-smoke/.dolt/temptf", 0777) = 0
openat(AT_FDCWD, "/home/andy/dolt-smoke/.dolt/config.json-875846173", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = 6
write(6, "{}", 2) = 2
fsync(6) = 0
renameat(AT_FDCWD, "/home/andy/dolt-smoke/.dolt/config.json-875846173", AT_FDCWD, "/home/andy/dolt-smoke/.dolt/
config.json") = 0
openat(AT_FDCWD, "/home/andy/dolt-smoke/.dolt", O_RDONLY|O_CLOEXEC) = 6
fsync(6

It does not progress past that point in practice.

## Notes

I reinstalled Dolt from the official release and the behavior did not change.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce `dolt init` in a clean directory on Linux ext4 and trace it with the provided `strace` sequence. Start by locating the initialization path and the directory-fsync operation shown after `config.json` is renamed. Done means `dolt init` completes and creates a usable fresh repository, with `dolt sql-server` reaching its ready state as applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
databases, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.