mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-04-25 05:36:14 +03:00
[GH-ISSUE #3757] Trying to write in a read only connection #1317
Labels
No labels
AS
can't reproduce
can't reproduce
deployment
development
documentation
duplicate
duplicate
ee
enhancement
external
new driver
performance
pull-request
third party issue
wait for response
wait for review
wontfix
x:Oracle
x:cassandra
x:clickhouse
x:db2
x:duckdb
x:greenplum
x:h2
x:h2gis
x:hana
x:hive
x:intersystems
x:kyuubi
x:maria
x:mongo
x:mysql
x:postgresql
x:presto
x:sql server
x:sqlite
x:teradata
x:trino
xf:accessibility
xf:administration
xf:ai
xf:authentication
xf:aws
xf:commit-mode
xf:connection
xf:dark theme
xf:data editor
xf:datatransfer
xf:dba
xf:driver management
xf:erd
xf:filters
xf:i18n
xf:i18n
xf:installer
xf:json
xf:kerberos
xf:ldap
xf:local config
xf:log viewer
xf:metadata
xf:metadata editor
xf:navigator
xf:okta
xf:query manager
xf:resource manager
xf:scripts
xf:sql editor
xf:tasks
xf:ui/uix
xo: Firefox
xo:eclipse
xo:internet explorer
xo:macos
xp:major
xrn:internal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cloudbeaver#1317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @webysther on GitHub (Sep 18, 2025).
Original GitHub issue: https://github.com/dbeaver/cloudbeaver/issues/3757
Originally assigned to: @HocKu7 on GitHub.
Description
For a
read-onlyconnection the sqlite driver try to write the journal in same directory raising this error:Steps to reproduce
Expected/Desired Behavior
Read the database normally without trying write in disk
CloudBeaver Version
25
Additional context
No response
@dariamarutkina commented on GitHub (Sep 19, 2025):
Hello, @webysther ! Thanks for the report🦫
Quick question to align expectations: do you know of any setup where a SQLite DB in WAL mode works from a directory mounted read-only with a read-only connection? Or is this a desired behavior you’d like us to support? Our understanding is that WAL requires write access to create/update the *.db-wal and *.db-shm files next to the database file.
Could you share a minimal repro and environment details?
Possible workarounds meanwhile:
Thank you! 🦫
@webysther commented on GitHub (Sep 19, 2025):
If the option need to be added like
?mode=ro&immutable=1why not add this option in the path when open the connection when I mark asread-onlyin the options?BTW (don't work):
The default works to test but get the first error of the issue:
@webysther commented on GitHub (Sep 19, 2025):
Even with the internal user o cloudbeaver of
8978and also this driver options:jdbc.explicit_readonly=1open_mode=1In additional step I have tested with journal OFF:
Set but in path or in the driver properties in diferent mixed ways, don't work.
@dariamarutkina commented on GitHub (Sep 19, 2025):
Thanks for the detailed answer!
And if you change the parameter journal_mode=DELETE ?
@webysther commented on GitHub (Sep 19, 2025):
@dariamarutkina commented on GitHub (Sep 19, 2025):
Thanks for the answer! 🦫
The stack trace shows
SQLiteConfig.apply(...), which means a PRAGMA from Driver properties is being executed at connect time. AnyPRAGMA journal_mode=...(OFF/DELETE/WAL) requires write access to change the DB header / create/remove journal files. On a read-only mount this inevitably fails withSQLITE_READONLY_DIRECTORY.To read on a RO mount, please:
Remove all PRAGMA-like driver properties that change the DB (e.g. journal_mode, journal_size_limit, etc.).
Use URL configuration and pass only read-only flags (Switch to the URL tab)
jdbc:sqlite:file:/mnt/jellyfin/jellyfin.db?mode=ro&immutable=1plus open_mode=65 (READONLY|URI). Do not set journal_mode in properties.
docker exec -u 8978:8978 <cb> sh -lc 'head -c 0 /mnt/jellyfin/jellyfin.db && echo OK'With the above, WAL + RO mount works via immutable=1 and no writes are attempted.
@webysther commented on GitHub (Sep 19, 2025):
No driver properties:
Even switching
open_modeto be inside driver properties don't work either. I few months ago worked without problem, I think its some kind regression, I use only few hours every some months of without usage.@dariamarutkina commented on GitHub (Sep 19, 2025):
Thank you very much for the detailed answer! 💙
Could you please try switching the configuration from Manual to URL and set the connection string to:
jdbc:sqlite:file:/mnt/jellyfin/jellyfin.db?mode=ro&immutable=1In the driver properties, keep only:
open_mode = 65@webysther commented on GitHub (Sep 19, 2025):
I make the install of
sqlite3in the cli of server and the connection string works for the same file.PS: works out-of-box without need of any option, I think its a regression in the cloudbeaver.
But not in the cloudbeaver:
I recommend to build a test and test in your end to track as a test.
@Wroud commented on GitHub (Sep 23, 2025):
It seems like you're trying to place
*.db,*.wal, and*.shmin a read-only directory. This will block the SQLite driver from opening a connection.There 3 two options:
Use the database without WAL enabled
Pre-generate the WAL file
If you want a completely read-only snapshot, you can checkpoint all transactions (PRAGMA wal_checkpoint(FULL)) and then distribute only the main *.db file without the WAL.
That way, the database is fully consistent and can be opened in strict read-only environments (e.g., mounted read-only, no WAL file at all).
Place the database and
*.wal, and*.shmin a writable directory@webysther commented on GitHub (Sep 23, 2025):
No, this is a cloudbeaver problem, I was able to use like I want in another server using just sqlite3 cli.
Will be nice the team just put effort to fix the problem. Just test what I'm saying, this is a error.
Security: need to mount using :rw over :ro is a security risk by design, this by default can be considered a security incident.
@Wroud commented on GitHub (Sep 23, 2025):
@webysther, sorry, I misunderstood how the WAL file works in read-only systems; indeed, it would be able to read the database if the WAL file already exists.
We will fix this issue in future releases
@HocKu7 commented on GitHub (Nov 20, 2025):
@webysther Please update the JDBC URL to use SQLite URI form:
jdbc:sqlite:file:/mnt/jellyfin/jellyfin.db?mode=ro&immutable=1and make sure the user running the CloudBeaver server has rx on /mnt and /mnt/jellyfin and r on jellyfin.db.
Please try again and let us know if the error persists.
@webysther commented on GitHub (Dec 13, 2025):
Hi, for sqlite I have switched to another better tool (https://docs.linuxserver.io/images/docker-sqlitebrowser) and I will not be able to test anymore, sorry.