[pfx] Re: fatal: dict_sqlite_lookup: [...] SQL prepare failed: attempt to write a readonly database?

postfix--- via Postfix-users <[email protected]>
Newsgroups gmane.mail.postfix.user
Message-ID <[email protected]>
On 2026-08-09 07:39, lama--- via Postfix-users wrote:
> since I've upgraded from 3.10.11 to 3.10.12 (running Alpine) 

Which Alpine version?  I run two instances of Postfix on two different 
Alpine, and only one uses sqlite lookups.

# Alpine 3.24: Postfix with sqlite lookups, no errors
```
postfix-3.11.4-r0
postfix-sqlite-3.11.4-r0
sqlite-libs-3.53.2-r0
```

equivalent to your `/etc/postfix/sqlite-alias-vmaps.cf` has

```
dbpath = /var/mailserverdata/mailboxes.db
query = SELECT goto FROM alias WHERE address='%s' AND active = '1
```

I assume you are running Postfix as the user `postfix`.  Can it traverse 
and write all the way to `/etc/postfix/` ?  my `/etc/postfix` is 
`root:root` owned, and all files there are permission `600`, so tough 
luck if user `postfix` is unauthorizedly abused.

My `var/mailserverdata` has permission `770` and is `mail:mail` owned. 
`postfix` user is in group `mail`.  `postfix` user needs `+x` permission 
all the parent directories.

My `/var/mailserverdata/mailboxes.db` has permission `660` and is owned 
by `nginx:mail` (managed by web interface, nginx access restricted at 
the firewall to a few specific IP addresses)


# Alpine 3.23, which I guess is the version you have experienced the 
errors on, but I have not upgraded yet (and even if I would, that 
instance does not use sqlite lookups)
```
postfix-3.10.10-r0
postfix-sqlite-3.10.10-r0
sqlite-libs-3.51.2-r0
````

# I quickly spun up a disposable container and updated to the newest 
repository for 3.23 and I can guesstimate that this is what you upgraded to:
```
postfix-3.10.12-r0
postfix-sqlite-3.10.12-r0
sqlite-libs-3.51.2-r0
```

So no SQLite library change on your upgrade if my guesstimate is 
correct.  My humble and totally non-expert opinion is 
permissioning/ownership.

HTH
Yuv
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.