Issue with DAML Sandbox on macOS (aarch64) - SQLite Connection Error

Hi everyone,

I’m experiencing a persistent issue with running the DAML sandbox on my MacBook Air (M2, aarch64 architecture) while working on a blockchain lab project. Despite reinstalling the DAML SDK and JDK multiple times, the error persists. Here are the details:
Problem Description:

  • When I run daml start, I get the following error:
(base) natsudauppapong@Natsudas-MacBook-Air space_listing % daml start
SDK 2.9.5 has been released!
See https://github.com/digital-asset/daml/releases/tag/v2.9.5 for details.

SDK 2.9.5 has been released!
See https://github.com/digital-asset/daml/releases/tag/v2.9.5 for details.

Compiling test to a DAR.
Created .daml/dist/test-1.0.0.dar
Waiting for sandbox to start: 
04:45:18.672 [sandbox-akka.actor.default-dispatcher-4] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
04:45:19.919 [program-resource-pool-2] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initialization.
java.sql.SQLException: Error opening connection
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:239)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:21)
        at org.sqlite.JDBC.createConnection(JDBC.java:115)
        at org.sqlite.JDBC.connect(JDBC.java:90)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:119)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
        at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56)
        at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
        at org.flywaydb.core.Flyway.execute(Flyway.java:453)
        at org.flywaydb.core.Flyway.migrate(Flyway.java:158)
        at com.daml.ledger.on.sql.Database$UninitializedDatabase.migrate(Database.scala:226)
        at com.daml.ledger.on.sql.SqlLedgerReaderWriter$Owner.$anonfun$acquire$1(SqlLedgerReaderWriter.scala:109)
        at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:335)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:64)
        at org.sqlite.core.NativeDB.load(NativeDB.java:63)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:235)
        ... 22 common frames omitted
04:45:19.964 [scala-execution-context-global-47] ERROR com.daml.resources.ProgramResource - Shutting down because of an initialization error.
org.flywaydb.core.internal.exception.FlywaySqlException: 
Unable to obtain connection from database: Error opening connection
-------------------------------------------------------------------
SQL State  : null
Error Code : 0
Message    : Error opening connection

        at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:65)
        at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
        at org.flywaydb.core.Flyway.execute(Flyway.java:453)
        at org.flywaydb.core.Flyway.migrate(Flyway.java:158)
        at com.daml.ledger.on.sql.Database$UninitializedDatabase.migrate(Database.scala:226)
        at com.daml.ledger.on.sql.SqlLedgerReaderWriter$Owner.$anonfun$acquire$1(SqlLedgerReaderWriter.scala:109)
        at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.sql.SQLException: Error opening connection
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:239)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:21)
        at org.sqlite.JDBC.createConnection(JDBC.java:115)
        at org.sqlite.JDBC.connect(JDBC.java:90)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:119)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
        at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:56)
        ... 9 common frames omitted
Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:335)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:64)
        at org.sqlite.core.NativeDB.load(NativeDB.java:63)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:235)
        ... 22 common frames omitted
  • The error message suggests that the SQLite native library is not found for my macOS architecture, which seems to prevent the sandbox from starting.

Steps I’ve Tried:

  1. Reinstalled DAML SDK and switched versions (currently using SDK 2.9.5 and tried SDK 1.15.0 as well).
  2. Uninstalled and reinstalled JDK (using Eclipse Adoptium JDK 11 and tried JDK 21).
  3. Configured JAVA_HOME and verified the JDK installation.
  4. Tried to use PostgreSQL as an alternative, but the issue still persists with the sandbox initialization.

My Setup:

  • MacBook Air M2 (macOS, aarch64 architecture)
  • DAML SDK Versions Tried: 2.9.5 (latest) and 1.15.0
  • JDK: Eclipse Adoptium JDK 11 and JDK 21
  • Database: Default SQLite and attempted PostgreSQL

Any guidance or suggestions on how to resolve this issue would be greatly appreciated!

Thank you in advance for your help.

One thing that might help is to double-check that you are actually using Daml 2.9.5. I ask because your error block has the following…

SDK 2.9.5 has been released!
See https://github.com/digital-asset/daml/releases/tag/v2.9.5 for details.

…which generally only happens if you are not using the latest. Keep in mind that you can have multiple versions of the Daml SDK installed. The version that is used depends on several factors (e.g., what is stated in the daml.yaml file)

Try this…

  1. In your space_limit folder run daml version --assistant=yes to confirm that you are using the expected version.
  2. Uninstall the Daml SDK 1.15.0. That’s really old. See Uninstall all but one Daml SDK? - #2 by WallaceKelly.

Does this still happen with only Daml SDK 2.9.5 installed?

1 Like