SQLITE_CANTOPEN_SYMLINK
SQLiteERRORNotableFile Accessofficial confidence

Cannot open — symlinks not allowed

Production Risk

Low — intentional security restriction.

What this means

SQLITE_CANTOPEN_SYMLINK (2062) is returned when SQLITE_OPEN_NOFOLLOW is set and the database path is a symbolic link. This prevents following symlinks for security-sensitive applications.

Why it happens
  1. 1Opening a symlinked database file with the SQLITE_OPEN_NOFOLLOW flag.
  2. 2Security policy forbids following symlinks to database files.
How to reproduce

sqlite3_open_v2() with SQLITE_OPEN_NOFOLLOW flag on a symlinked database.

trigger — this will error
trigger — this will error
# In C:
# sqlite3_open_v2("mylink.db", &db, SQLITE_OPEN_READONLY | SQLITE_OPEN_NOFOLLOW, NULL);
# → SQLITE_CANTOPEN_SYMLINK if mylink.db is a symlink

expected output

SQLITE_CANTOPEN_SYMLINK (2062)

Fix 1

Fix 2

Version notes

Sources
Official documentation ↗

sqlite3.h — SQLITE_CANTOPEN_SYMLINK = 2062

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All SQLite errors