moigagoo / norm

A Nim ORM for SQLite and Postgres
https://norm.nim.town
MIT License
378 stars 34 forks source link

Crash on Linux. #195

Closed system64MC closed 9 months ago

system64MC commented 9 months ago

Hi, I try to use Norm on Linux but I have a crash that says it can't open the database :

/mnt/c/Users/USER/Documents/.../server/src/server.nim(31) server
/mnt/c/Users/USER/Documents/.../server/src/server.nim(20) main2
/mnt/c/Users/USER/Documents/.../server/src/database/db.nim(26) seedDb
/mnt/c/Users/USER/Documents/.../server/src/database/conn.nim(10) initConnectionPool
/mnt/c/Users/USER/Documents/.../server/nimbledeps/pkgs2/norm-2.8.1-2d2318da204033dfb6532590aaccd7b40d2c4e80/norm/pool.nim(41) newPool
/mnt/c/Users/USER/Documents/.../server/nimbledeps/pkgs2/norm-2.8.1-2d2318da204033dfb6532590aaccd7b40d2c4e80/norm/pool.nim(31) :anonymous
/mnt/c/Users/USER/Documents/.../server/src/database/conn.nim :anonymous
/mnt/c/Users/USER/Documents/.../server/nimbledeps/pkgs2/lowdb-0.2.1-e26a392547b826d7d3e6566dc0fd76e9f42ead06/lowdb/sqlite.nim(517) open
/mnt/c/Users/USER/Documents/.../server/nimbledeps/pkgs2/lowdb-0.2.1-e26a392547b826d7d3e6566dc0fd76e9f42ead06/lowdb/sqlite.nim(143) dbError
Error: unhandled exception: unable to open database file [DbError]

I tried with permissions 777, I tried to run as SUDO, as ROOT, nothing works.

According to the traceback, the lower level I have control on is this proc :

proc initConnectionPool*(databasePath: string, size: int) =
  {.cast(gcsafe).}:
    SQLITE_POOL = newPool[DbConn](
      size, 
      () => open(databasePath, "", "", ""), 
      pepExtend
    )

    debug fmt"Created pool with '{$size}' connections to '{databasePath}'"

Is it a problem with Norm? Or did I do something not right? SQLite 3 is also installed on my Linux system. My system is the latest Debian.

PhilippMDoerner commented 9 months ago

Note, the error that is getting raised is by the open proc norm uses from lowdb, or rather the open proc lowdb uses from the official nim sqlite3 wrapper.

Which is:

# Specific
proc open*(connection, user, password, database: string): DbConn {.
  tags: [DbEffect].} =
  ## opens a database connection. Raises `EDb` if the connection could not
  ## be established. Only the ``connection`` parameter is used for ``sqlite``.
  var db: DbConn
  if sqlite3.open(connection, db) == SQLITE_OK:
    result = db
  else:
    dbError(db)

The error itself originates from the fact that the sqlite library returns a non-zero value (SQLITE_OK is the value 0) when trying to open the file.

You could go into your mnt/c/Users/USER/Documents/.../server/nimbledeps/pkgs2/lowdb-0.2.1-e26a392547b826d7d3e6566dc0fd76e9f42ead06/lowdb/sqlite.nim file and change that proc to:

# Specific
proc open*(connection, user, password, database: string): DbConn {.
  tags: [DbEffect].} =
  ## opens a database connection. Raises `EDb` if the connection could not
  ## be established. Only the ``connection`` parameter is used for ``sqlite``.
  var db: DbConn
  let responseCode = sqlite3.open(connection, db)
  echo "Sqlite open action executed with response code: ", $responseCode
  if responseCode == SQLITE_OK:
    result = db
  else:
    dbError(db)

Then recompile and run again to trigger the "echo" call. That'd hand you the result code to look up in the sqlite wrapper (or directly in the far more detailed SQLite docs) to see what meaning that number as result code has.

Overall, the error itself stems from sqlite and how the sqlite lib itself fails to open the file for whatever reason.

It is also important info that this is likely happening on a WSL-based Linux system from what I gathered from out chats, not a direct Linux system. Thus it is not norm specific, it is not even nim specific in my eyes.

To me it makes more sense to do more research googling sqlite3 unable to open database file and working the way through the searchresults that come up. There are plenty of them because the issue can be caused by many different things.

I, at least, can't troubleshoot this without a minimal example to replicate the issue. Long-Distance Diagnosis like that is just not easy.

system64MC commented 9 months ago

Alright so I found something quite interesting

Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 0
Sqlite open action executed with response code: 14

That means it definitively can open the database, but there is one connection that fails. Checked Error 14 meaning, the documentation states this : (14) SQLITE_CANTOPEN The SQLITE_CANTOPEN result code indicates that SQLite was unable to open a file. The file in question might be a primary database file or one of several temporary disk files.

system64MC commented 9 months ago

Update : I checked how many connections can SQLite handle https://stackoverflow.com/questions/9017762/what-is-the-maximum-number-of-connections-for-a-sqlite3-database#comment86004364_29251687

And look at what I found : image

And how many lines my log have : image

So it might be the problem!

PhilippMDoerner commented 9 months ago

O.O You have over 1000 connections open? What size did you set your pool to?

Note that 100 connections tends to be plenty for most enterprises that I'm familiar with and those use libs that do concurrent writes.

system64MC commented 9 months ago

O.O You have over 1000 connections open? What size did you set your pool to?

10 000 I lowered it, and recompiled the program. No problems with connections now, but I have a segfault now but this is not related to database stuff.

PhilippMDoerner commented 9 months ago

10 000 I lowered it, and recompiled the program. No problems with connections now, but I have a segfault now but this is not related to database stuff.

I highly recommend to turning that down to like... 30 as I don't see you needing more than that and even that I think is overkill.

PhilippMDoerner commented 9 months ago

Anyway, appears to not be a norm problem, I'll close the issue accordingly.