Skip to content
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

[BUG] Manual configuration requires including zulip.conf too. #343

Open
zodiac7 opened this issue Feb 27, 2022 · 5 comments
Open

[BUG] Manual configuration requires including zulip.conf too. #343

zodiac7 opened this issue Feb 27, 2022 · 5 comments

Comments

@zodiac7
Copy link

zodiac7 commented Feb 27, 2022

Short version -
I am trying to use docker zulip with manual config as described at https://github.com/zulip/docker-zulip#manual-configuration but zulip fails to start giving one of the following errors:

  1. ModuleNotFoundError: No module named 'zproject.dev_settings'. "Zulip migration failed with exit code 1"
  2. INFO exited: zulip-django (exit status 1; not expected) INFO gave up: zulip-django entered FATAL state, too many start retries too quickly

Long version -

I am trying to use zulip in docker mode by using docker zulip with my own settings and secret files as described in
https://github.com/zulip/docker-zulip#manual-configuration
The purpose is to inject a settings.py middleware so that I can use a sso by letting zulip parse my jwt auth token
so far the experience has not been easy.

I am using the default code from above and editing the docker-compose.yml and adding the line MANUAL_CONFIGURATION: "True" and LINK_SETTINGS_TO_DATA: "True" as instructed in the docker-zulip documentation.

I have tried the below scenarios.
Zulip logs and my files for each scenario are attached here.

Scenario 1:
My Settings file and secret files are present in host at /opt/docker/zulip/zulip/settings/etc-zulip/, Root user owns them.
Zulip does not start and in the console says ModuleNotFoundError: No module named 'zproject.dev_settings'. "Zulip migration failed with exit code 1".

Scenario 2:
I run zulip without the manual config, it runs successfully, I copy the secrets.conf, settings.py and zulip.conf over from the container to
/opt/docker/zulip/zulip/settings/etc-zulip/. I then kill zulip, set manual config and link settings to true in the docker-compose.yml, delete all the files except these from /opt/docker/zulip and run zulip again.
Zulip does not start but gives a different error this time as shown below.
INFO exited: zulip-django (exit status 1; not expected) INFO gave up: zulip-django entered FATAL state, too many start retries too quickly

If i comment out MANUAL_CONFIGURATION in docker-compose.yml then everything runs file.
I am running the latest docker-zulip cloned from github on Linux mint cinnamon 20.02 , docker compose 1.25.0-1

zulip_s1.log
zulip_s2.log
zulip_bug_report_files.zip

@zodiac7 zodiac7 changed the title Manual configuration does not work [BUG] Manual configuration does not work Feb 27, 2022
@zodiac7
Copy link
Author

zodiac7 commented Mar 5, 2022

FYI anyone who is facing this issue, I was able to make some progress by COPYING all files from the container's etc directory to your host machine at /opt/docker/zulip/zulip/settings/etc-zulip. The files which I copied were nginx_sharding.conf, sharding.json, zulip.conf, settings.py, uwsgi.ini, zulip-secrets.conf

I suggest updating the documentation for docker zulip with this information so others dont face this.
Let me know if you would like me to update it and I will be happy to do it.

@kuya1284
Copy link

kuya1284 commented Sep 9, 2024

I know this is old but I just ran into this issue today and just wanted to contribute my solution. I discovered the following issues:

The README says to place the files in /opt/docker/zulip/zulip/settings/etc-zulip/; however, that seems incorrect. What I did to get this to work was to create a bind mount for settings.py, zulip-secrets.conf, and zulip.conf in /data/settings/etc-zulip/ instead.

The second issue is that the README makes no mention of including zulip.conf, which does appear to be needed, especially if copying /etc/zulip/zulip.conf from the container. By omitting this file, a default will get created without the [machine] section and will prevent the container from starting.

The third issue that I ran into is that despite setting both MANUAL_CONFIGURATION and LINK_SETTINGS_TO_DATA, the entrypoint.sh script still expects the SECRETS_postgres_password to be set. The following error appears in the logs:

/sbin/entrypoint.sh: line 338: SECRETS_postgres_password: parameter not set

So what I ended up doing was just set SECRETS_postgres_password, but left it EMPTY.

I'm honestly surprised that this hasn't been addressed since the OP created this issue 2 years ago and the solution to this issue seems relatively easy to fix. The README just needs to be updated to reference to correct path and the entry script just needs to initialize SECRETS_postgres_password in waitingForDatabase() when MANUAL_CONFIGURATION is set.

I hope this helps others.

EDIT: Added zulip.conf to the list of files that need to be included that was missing from the instructions because that needed to be included in the etc-zulip/ directory as well. Without it, a default config file would get created WITHOUT the [machine] section.

@atomicthumbs
Copy link

lost several hours of effort to this today

@timabbott timabbott changed the title [BUG] Manual configuration does not work [BUG] Manual configuration requires including zulip.conf too. Nov 19, 2024
@arttraratatr
Copy link

@kuya1284

Face the same issue. It seems I have Device or resource busy error when mount zulip.conf, etc. to /data/settings/etc-zulip/zulip.conf. Any thoughts?

Logs:
zulip-database-1 | 2024-11-25 10:16:51.209 UTC [1] LOG: database system is ready to accept connections
zulip-zulip-1 | === Begin Initial Configuration Phase ===
zulip-zulip-1 | Preparing and linking the uploads folder ...
zulip-zulip-1 | Prepared and linked the uploads directory.
zulip-zulip-1 | Executing puppet configuration ...
zulip-zulip-1 | Setting IPs for load balancer
zulip-zulip-1 | [Errno 16] Device or resource busy: '/data/settings/etc-zulip/zulip.conf.w2bhpows.tmp' -> '/data/settings/etc-zulip/zulip.conf'

@kuya1284
Copy link

@kuya1284

Face the same issue. It seems I have Device or resource busy error when mount zulip.conf, etc. to /data/settings/etc-zulip/zulip.conf. Any thoughts?

Logs: zulip-database-1 | 2024-11-25 10:16:51.209 UTC [1] LOG: database system is ready to accept connections zulip-zulip-1 | === Begin Initial Configuration Phase === zulip-zulip-1 | Preparing and linking the uploads folder ... zulip-zulip-1 | Prepared and linked the uploads directory. zulip-zulip-1 | Executing puppet configuration ... zulip-zulip-1 | Setting IPs for load balancer zulip-zulip-1 | [Errno 16] Device or resource busy: '/data/settings/etc-zulip/zulip.conf.w2bhpows.tmp' -> '/data/settings/etc-zulip/zulip.conf'

I've abandoned the use of zulip and switched to Mattermost, so I don't know how to help. Zulip is pretty fragmented and cumbersome in comparison to Mattermost. Not to mention, it doesn't handle Markdown correctly, and gave me nothing but problems. Maybe someone else will be able to answer your question. Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants