Closed leancode closed 1 year ago
Interesting. What distribution/version of sqlite do you happen to be running? Likely because MIAB assumes that .schema users
would return everything in one line:
debian 11 sqlite3 --version 3.34.1 2021-01-20 14:10:07 10e20c0b43500cfb9bbc0eaa061c57514f715d87238f4d835880cd846b9ealt1
I see, I can kinda reproduce the problem when running .schema users --indent
, so I am positive this could be the result of some interaction with some configuration file; What are the contents of /root/.sqliterc
?
sudo cat /root/.sqliterc
(It's possible that this is caused by a configuration setting somewhere, however MIAB should still just work around this kind of stuff)
cat: /root/.sqliterc: No such file or directory
There is nothing in /etc/ either that I can see. This machine's sole purpose is to run the mail server. It was originally a fresh install with only the setup.sh run. There is nothing else on there.
Alright, let's chalk it up to the mysteries of life (or something like that)
Yep, something like that. I have really no idea. I am just happy that I was able to debug it and get up and running again fast. Thanks for your fast responses and your great work!
Today I tried to upgrade from 56 (I think - the last one before the 60 series) and the upgrade failed with this
After chasing this around I found the problem to be in setup/mail-users.sh. The problem is that the script was trying to add the quota column to the users table when it already existed and this was not properly caught by the script. The elif line did not return correctly that the column already existed:
The quick fix was to comment the line out and re-run the install and I am back up and running, but this is a bug.
Trying to nail this down and come up with a solution, I found that:
sqlite3 /home/user-data/mail/users.sqlite ".schema users"
when run in the terminal works and gives the table structure with the quota field as follows:
But notice how this is in multiple lines! So the inverse grep only filters out the quota line and still returns truthy.
I played around with sqllite3 --line option but could not get it to work. Ultimately it worked replacing:
with
There might be more elegant versions. I am really not a bash expert, but for all it worth I've put that into a pull request here:
97