Skip to content

[Bug]: could not load local database #176

Closed

Description

@bytegh

Description

Could not open the local snapshots database. Version history will be disabled for this session.

dlopen(/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node, 0x0001): tried: '/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node' (no such file), '/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Steps to reproduce

when start the app, it report an issue:
Could not open the local snapshots database. Version history will be disabled for this session.

dlopen(/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node, 0x0001): tried: '/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node' (no such file), '/Applications/Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

Expected behavior

It should be opened normally.

Actual behavior

can not load the local database or create design

open-codesign version

0.1.3

Platform

macOS

OS version

No response

Model provider (if relevant)

None

Error code

No response

Diagnostics bundle

No response

Logs

Activity

  1. added
    bugSomething isn't working
    triageAwaiting maintainer review
    on Apr 23, 2026
  2. added
    triageAwaiting maintainer review
    and removed
    triageAwaiting maintainer review
    on Apr 23, 2026
  3. github-actions commented on Apr 23, 2026

    @github-actions
    Contributor

    Thanks for the detailed report and the full dlopen error.

    This error is a native-architecture mismatch in the better-sqlite3 binding (have 'arm64', need 'x86_64'). In the current code path, when snapshots DB init fails, the app intentionally falls back and disables snapshots/history-related IPC for that session (which can block normal design creation flows).

    For a quick check, please make sure the installed macOS artifact matches the runtime architecture (arm64 vs x64) listed in our install docs.

    Relevant code:

    • apps/desktop/src/main/index.ts:1069 — app initializes designs.db via safeInitSnapshotsDb(...) at startup
    • apps/desktop/src/main/index.ts:1094 — shows the exact “Could not open the local snapshots database…” error dialog
    • apps/desktop/src/main/snapshots-db.ts:54 — resolves architecture-specific native binding (better_sqlite3.node-electron-${arch}.node) with fallback behavior
    • apps/desktop/scripts/install-sqlite-bindings.cjs:11 — installer stages separate Node/Electron and per-arch binaries
    • apps/desktop/src/main/snapshots-ipc.ts:377 — when DB init fails, snapshots channels return SNAPSHOTS_UNAVAILABLE
    • README.md:123 — macOS Apple Silicon installer is *-arm64.dmg
    • README.md:124 — macOS Intel installer is *-x64.dmg

    Need more info:

    • Which exact DMG filename did you install (full name)?
    • Is this Mac Intel or Apple Silicon?
    • Is the app currently running under Rosetta (App "Get Info" -> "Open using Rosetta")?

    Also, this project is still pre-alpha, so some roadmap features are still in progress while we stabilize core desktop/runtime behavior.


    open-codesign Bot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting maintainer review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions