-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install flow requires manual user creation #227
Comments
Can you post the exceptions from this? The way this is supposed to work is:
My guess as to what might have caused what you describe is if you destroyed the storage of the postgres container (or replaced the postgres container) sometime between step 1 and step 2, you'd have an improperly initialized database without those system users, and the code that expects them to exist will 500. This sort of failure mode is very unlikely with the traditional installer, but Docker makes it easy to do this sort of thing. I think we need to write some code to provide a better error message in the situation that Zulip's database has not been initialized properly (probably reproducible without Docker by rerunning The other thing we could do is change the startup logic for the @andersk thoughts? |
It looks like what you described is certainly what's happening, here's the exception that I got:
it is looking for the It's certainly possible that the DB container went down during steps 1 & 2 -- is there any way to check this initialization or run it manually? |
I think you can just delete Read But I think the correct fix would be to replace the check in |
I definitely can -- I'll try both and report back here -- I'll re-make the deployment from scratch as well. I personally think this functionality should be inside zulip itself -- is that a likely possibility? I can understand if this is expected to stay in the domain of zulip-related setup rather than zulip itself but it seems like this particular issue could go either way. [EDIT] - Still haven't run the test, but another note on this -- could zulip store all it's sort of startup status data in the DB? That would go a long way to making it easier to deploy Zulip to various environments and reduce the number of things to keep track of. |
That's what the change I proposed above is intended to fix -- use some existing state in the database rather than the On the front of "inside Zulip", I guess I'm not sure what you had in mind. For first-user creation, one has to think about security -- if anyone who visits the URL of an unconfigured Zulip server can create an initial administrator user, that could be problematic if an administrator sets up a server on the public Internet and then takes a while to set it up. That's why we have this "realm-creation link" flow where one generates a secure link, and then opens that in their browser to beign a secure flow. |
Ahh but I mean moving the check inside the zulip codebase @ startup time instead. I was imagining moving the logic in
I agree -- what I meant to suggest was making the pseudo random id that gets put on the realm creation link suppliable through enf -- so if I supply If even that is too much risk (IMO the risk is identical to someone guessing your realm creation slug and getting to the URL before you do, there are a few other options):
|
I don't think that makes sense, because this code is normally run by the Zulip installer script in the non-Docker setting. And we don't want to run it on Django process startup, because there are more than one of those (so we'd have to worry about races) and it'd be needlessly expensive. This belongs in the Docker setup logic, because only in the Docker case are we having a system initialize its database on boot. |
Ahhh I see -- thanks for the explanation, so it looks like moving it into zulip itself won't happen, so the fix would definitely be in this repo. Will try and get to trying the newer solution today |
Following zulip/zulip#13888, with Zulip master it should be possible to just delete the block of code in |
Closing and opening #471 to track the one remaining possible task from this thread. |
I'm not sure if this belongs better on the
zulip
repository, but I just installed2.1.1-0
and went through the installation process and found a rough patch: creating a realm did not successfully create the associated user account.A
UserProfile
does not exist error occurred (500), which has happened in the past, but unlike the past I was unable to log in afterwards. I had toexec
into the container and runmanage.py create_user
which gave the sameUserProfile
error, but I could log in after.Zulip would be a lot easier to deploy and setup if:
exec
ing in (there's a setting for this but it doesn't seem to work)The text was updated successfully, but these errors were encountered: