SQLITE_CANTOPEN: unable to open database file windows, tileserver-gl sometimes works

tileserver-gl --port 8080 --config G:\openfreemap\config.json

C:\Users>tileserver-gl --port 8080 --config G:\openfreemap\config.json
Starting tileserver-gl v5.3.1
Using specified config file from G:\openfreemap\config.json
Starting server
Listening at http://[::]:8080/
SQLITE_CANTOPEN: unable to open database file

Ok downloaded hungary.mbtiles and the same error yet

sqlite3 I:\openfreemap\tiles\hungary.mbtiles “SELECT name FROM sqlite_master;”

C:\Users>sqlite3 I:\openfreemap\tiles\hungary.mbtiles “SELECT name FROM sqlite_master;”
images
map
metadata
map_index
images_index
tiles
omtm

Its driving me up the wall, yesterday had the same issue and it randomly worked when I installed and reinstalled and trying different things, today the same error and cant replicate what I did yesterday. Any ideas at all?

Ok, for anyone else running windows that happens across this ,

C:\Users\me>tileserver-gl --port 8080 --config G:\openfreemap\config.json
Starting tileserver-gl v5.3.1
Using specified config file from G:\openfreemap\config.json
Starting server
Listening at http://[::]:8080/
SQLITE_CANTOPEN: unable to open database file

C:\Users\me>i:

I:>tileserver-gl --port 8080 --config G:\openfreemap\config.json
Starting tileserver-gl v5.3.1
Using specified config file from G:\openfreemap\config.json
Starting server
Listening at http://[::]:8080/
Startup complete

I’m guessing that using Windows junctions (which I’d expect to get interpreted as regular links, but might well confuse any other admins), or using WSL2 (which can present the filesystem as Unix-like) might also work?

1 Like

You guessed right

mklink /J C:\openfreemap I:\openfreemap
I:>C:
C:\Users\me>tileserver-gl --port 8080 --config G:\openfreemap\config.json
Starting tileserver-gl v5.3.1
Using specified config file from G:\openfreemap\config.json
Starting server
Listening at http://[::]:8080/
Startup complete

C:\Users\me>dir C:\ | find “< JUNCTION >”
30/05/2025 19:29 < JUNCTION > openfreemap [I:\openfreemap]

C:\Users\me>rmdir C:\openfreemap

C:\Users\me>tileserver-gl --port 8080 --config G:\openfreemap\config.json
Starting tileserver-gl v5.3.1
Using specified config file from G:\openfreemap\config.json
Starting server
Listening at http://[::]:8080/
SQLITE_CANTOPEN: unable to open database file