Skip to content

Conversation

@leosvelperez
Copy link
Member

Current Behavior

When database initialization fails due to filesystem issues, permission problems, or environment incompatibilities (like WAL mode not being supported), Nx shows generic error messages that don't provide actionable guidance to users. For example:

  • "Unable to create db lock file: PermissionDenied"
  • "Unable to set journal_mode: "

This makes it difficult for users to diagnose and resolve issues, especially in restricted environments like Docker containers, network filesystems, or WSL1.

Expected Behavior

With this PR, database initialization errors now provide:

  1. Context-specific error messages - Different guidance based on the error type:

    • Permission denied: Instructions about file ownership, Docker volume permissions, and read-only filesystems
    • Storage full: Suggestions to free disk space
    • Already exists: Guidance about stale files from crashed processes
  2. Automatic WAL mode fallback - When WAL journal mode is not supported by the filesystem, Nx now automatically falls back to DELETE journal mode instead of failing. This improves compatibility with:

    • Network filesystems (NFS, CIFS)
    • Some Docker volume configurations
    • Other environments with limited locking support
  3. WSL1 detection - Proactively detects WSL1 environments (which have known WAL incompatibilities) and uses DELETE mode from the start, avoiding failed attempts and retries.

  4. Better cleanup on retry - When database initialization fails and needs to retry, all auxiliary files (WAL and SHM files) are also cleaned up, not just the main database file.

  5. Actionable reporting instructions - All error messages now include:

    • How to capture detailed logs (NX_NATIVE_FILE_LOGGING=nx::native::db=trace)
    • Link to create an issue
    • Suggestion to run nx reset

@leosvelperez leosvelperez self-assigned this Dec 11, 2025
@leosvelperez leosvelperez requested review from a team as code owners December 11, 2025 08:12
@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Dec 11, 2025 11:40am

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 3288c78
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/693aac04fed3700008042ac4
😎 Deploy Preview https://deploy-preview-33820--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Dec 11, 2025

View your CI Pipeline Execution ↗ for commit 3288c78

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 40m 54s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 18s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-11 12:19:24 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants