Skip to content

[Bug]: Shared db between Intel and ARM #605

Closed as not planned
Closed as not planned

Description

@subfighter3

Describe the bug

While migrating db from v3 was successful on my Taohe M4, on my 2018 Sequoia I7 I got the following error when selected the same Dropbox folder after clicking on Open Storage:

Error invoking remote method 'db:relaod': Error: dlopen(/Applications/massCode.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node, 0x0001): tried: '/Applications/massCode.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h' or 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/massCode.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node' (no such file), '/Applications/massCode.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h' or 'x86_64'))

To reproduce

  1. Go to settings
  2. Click on Open Storage
  3. Select a db folder stored in Dropbox
  4. See error

Version

4.0.4

OS

Sequoia 15.7.1

Validations

Activity

  1. antonreshetov commented on Oct 1, 2025

    @antonreshetov
    Member

    This is not a bug.

    First, an SQLite database cannot be opened for writing by multiple applications at the same time, because SQLite uses a lock file to prevent concurrent writes. Second, the error you see is not related to the database itself — SQLite database files are cross-platform and architecture-independent. The issue comes from the better-sqlite3 native module: it was compiled for ARM when you first ran the app, and it cannot be loaded when you try to run the Intel (x86) build.

  2. subfighter3 commented on Oct 1, 2025

    @subfighter3
    Author

    I reported the bug because in v3 sharing a db between different machines with different architecture was possible with no problem. I was also sharing the same db between intel and arm with other people with no problems on v3.. it should be possible since it's still possible until intel machines are around..

  3. antonreshetov commented on Oct 1, 2025

    @antonreshetov
    Member

    In version 3, the database was simply json. In v4, it is an sqlite database. It's a little different.

  4. subfighter3 commented on Oct 1, 2025

    @subfighter3
    Author

    basically it's better to stay on v3 in order to share a db between different architectures? this limitation it's a bit of a pity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions