maddy icon indicating copy to clipboard operation
maddy copied to clipboard

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

Open DmitriiMukhin opened this issue 1 year ago • 4 comments

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

  • maddy version: 0.7.1+f3a6f32

DmitriiMukhin avatar Aug 30 '24 12:08 DmitriiMukhin

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?

DmitriiMukhin avatar Aug 30 '24 18:08 DmitriiMukhin

Pushed cbeadf1 that should fix the issue.

foxcpp avatar Aug 31 '24 12:08 foxcpp

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

DmitriiMukhin avatar Aug 31 '24 14:08 DmitriiMukhin

@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?

arisudesu avatar Sep 25 '24 09:09 arisudesu

Typo fixed in https://github.com/foxcpp/go-imap-sql/commit/8da5567429d5050a302362112770c4a135110f6a (maddy commit a8d639d).

foxcpp avatar Jan 24 '25 14:01 foxcpp