My db has id auto increment set to 2 instead of 1 (default). This leads to Wiki.js creating admin group with id=1 and guest group with id=3.
Setup does not like that:
Incorrect groups auto-increment configuration! Should start at 0 and increment by 1. Contact your database administrator.
https://github.com/Requarks/wiki/blob/383dfd3010b3b35d17db0806360b31aa82885c6f/server/setup.js#L252
Why do you rely on specific table id values?
Update:
There is also a check for admin and guest user ids.
https://github.com/Requarks/wiki/blob/383dfd3010b3b35d17db0806360b31aa82885c6f/server/setup.js#L317
hmm why your auto increment set to 2 btw? 馃
Our reasons for non default AUTO_INCREMENT are offtopic for this issue. (Multinode replication scenario as well)
I can work around this Wiki.js behavior but it seems weird to me Wiki.js code checks for specific row ID values in the database table. There might be good reason for it. I wonder why.
Same for me. I'm using a central DB cluster (mariadb) which has several nodes. With this Wiki.js is unfortunately not usable :(
These IDs are hardcoded for performance reasons when it comes to checking whether the user is a guest or not, without having to do roundtrips to the DB.
Would caching not be a solution?
Ok. So Wiki.js fetches admin and guest records in constant time from the database.
What about alternative solution like this:
name has an index -> lookup by name in O(log(n)) timeadmin and guestWould it be feasible?
I believe this can be mitigated at database migration?
So instead of inserting using AUTO_INCREMENT, how about insert the admin and guest user by a fixed number?
Guest user is inserted with Id 2 here, I suppose it would not hurt if the setup did the same.
Would only have to bump the current auto_increment for that table