foxcpp / maddy

✉️ Composable all-in-one mail server.
https://maddy.email
GNU General Public License v3.0
5.13k stars 249 forks source link

imapsql: NewBackend (initSchema): create table users: SQL logic error: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY (1) #723

Open DmitriiMukhin opened 2 months ago

DmitriiMukhin commented 2 months ago

Describe the bug

Something bad with my build. imapsql: using transpiled SQLite (modernc.org/sqlite), this is experimental imapsql: NewBackend (initSchema): create table users: SQL logic error: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY (1) build from master

Steps to reproduce

1) Build with GOOS=linux GOARCH=arm64 ./build.sh --static` 2) Deploy as systemd service on Debian 12 arm64 3) Edit /ettc/maddy/maddy.conf 4) Try to start

Log files

go env GOOS=linux GOARCH=arm64 ./build.sh maddy.log

Configuration file

/etc/maddy/maddy.conf

Environment information

DmitriiMukhin commented 2 months ago

I figured out that this db-hack doesn't work on my deployment. I didn't find how to force maddy to run that hack on init db. Also I didn't find how to force maddy to use sqlite3 driver. I think that modernc.org/sqlite also requires dbhack run?

foxcpp commented 2 months ago

Pushed cbeadf1 that should fix the issue.

DmitriiMukhin commented 2 months ago

Ok. Thank you. Previous error has gone. I suppose your commit fixed that issue.

arisudesu commented 1 month ago

@foxcpp not related directly to the issue, but I noticed in linked code that you have strings.HasPrefix(res, "ALERT TABLE"). I don't know of the ALERT statement in any DBMSes, maybe you mistaken for ALTER?