-
Notifications
You must be signed in to change notification settings - Fork 27
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
Current server name '' doesn't match configured server name. How to set it? #52
Comments
Hmm seems like there's a few things which are not right. First, the compose file should probably look like this: indico-web: &indico-web
- image: getindico/indico:latest
+ build: worker This ensures that you install the latest version of Indico, not the latest one on Dockerhub which is a bit outdated now.
I'll try to dig into that tomorrow |
Ah, so I need to use my own build. I see. I am using Docker Swarm so I also need to propagate that image to all the nodes. |
Just for the record, here is my Docker Swarm stack file: version: "3.4"
services:
indico-web: &indico-web
image: getindico/indico:latest
command: /opt/indico/run_indico.sh
environment:
- SERVICE_HOSTNAME=indico.whatever.com
- SERVICE_PORT=80
- SERVICE_PROTOCOL=http
- PGHOST=indico-postgres
- PGUSER=...
- PGPASSWORD=...
- PGDATABASE=...
- PGPORT=5432
- INDICO_DEFAULT_TIMEZONE=Europe/Berlin
- INDICO_DEFAULT_LOCALE=en_GB
- USE_EXTERNAL_DB=y
- C_FORCE_ROOT=true
- INDICO_AUTH_PROVIDERS={}
- INDICO_IDENTITY_PROVIDERS={}
- INDICO_LOCAL_IDENTITIES=yes
volumes:
- 'indicocustom-vol2:/opt/indico/custom'
- 'indicostatic-vol2:/opt/indico/static'
- 'indicolog-vol2:/opt/indico/log'
networks:
- backend
configs:
- source: ecap-indico-conf
target: /opt/indico/etc/indico.conf
tmpfs:
- /opt/indico/tmp
indico-celery:
<<: *indico-web
command: /opt/indico/run_celery.sh
ports: []
volumes: []
networks:
- backend
indico-redis:
image: redis
networks:
- backend
indico-postgres:
image: postgres:15-bookworm
environment:
- POSTGRES_USER=...
- POSTGRES_PASSWORD=...
- POSTGRES_DATABASE=...
volumes:
- '/raid/ecap-indico/db:/var/lib/postgresql/data'
networks:
- backend
deploy:
replicas: 1
placement:
constraints: [node.labels.db == true]
indico-nginx:
image: nginx:latest
networks:
- backend
- ecap-indico
environment:
- SERVICE_HOSTNAME=indico.whatever.com
- SERVICE_PROTOCOL=http
configs:
- source: ecap-indico-nginx-conf
target: /etc/nginx/conf.d/default.conf
volumes:
- 'indicocustom-vol2:/opt/indico/custom'
- 'indicostatic-vol2:/opt/indico/static'
volumes:
indicocustom-vol2:
driver: local
driver_opts:
type: "nfs4"
o: addr=...
indicoarchive-vol2:
driver: local
driver_opts:
type: "nfs4"
o: addr=...
indicolog-vol2:
driver: local
driver_opts:
type: "nfs4"
o: addr=...
indicostatic-vol2:
driver: local
driver_opts:
type: "nfs4"
o: addr=...
configs:
ecap-indico-conf:
external: true
ecap-indico-nginx-conf:
external: true
ecap-indico-db-conf:
external: true
networks:
ecap-indico:
external: true
backend: and the # Database
import os
SQLALCHEMY_DATABASE_URI = f'postgresql://{os.environ["PGUSER"]}:{os.environ["PGPASSWORD"]}@{os.environ["PGHOST"]}:5432/{os.environ["PGDATABASE"]}'
del os
SECRET_KEY = '\xfoo\xbar\xbaz'
BASE_URL = 'https://indico.whatever.com
USE_PROXY = True
REDIS_CACHE_URL='redis://indico-redis:6379/1'
CELERY_BROKER='redis://indico-redis:6379/0'
DEFAULT_TIMEZONE = 'Europe/Berlin'
DEFAULT_LOCALE = 'en_GB'
ENABLE_ROOMBOOKING = True
CACHE_DIR = '/opt/indico/cache'
TEMP_DIR = '/opt/indico/tmp'
LOG_DIR = '/opt/indico/log'
#ASSETS_DIR = '/opt/indico/assets'
#XELATEX_PATH = '/opt/texlive/bin/x86_64-linux/xelatex'
STORAGE_BACKENDS = {'default': 'fs:/opt/indico/archive'}
ATTACHMENT_STORAGE = 'default' |
OK I built and distributed a worker from your current I am not sure if this is related to the
At this moment, I don't see any other errors from the worker. Here is the full log of the Docker container:
While I am still a bit confused about the nginx Reverse Proxy configuration, when I launch
|
I pushed some fixes to the PR, namely I swapped the After setting a non-empty cd indico-prod
docker compose up Could you check if it works for you as well now? |
OK I will try, thanks so far! I can see that the only relevant change to my setup is in a0fdb9f Just to make sure we are on the same page: I am not using the |
Could you share your |
I am using the same as in the PR:
with the following service:
I am currently trying to get more logs out of this... |
So the only thing I can get out of Indico is this (via telnet from my load balancer):
So in this case I directly telnet, which means that the URL is not set anyways. I am using HAProxy and the configuration of the backend (with global settings for X-Forward options) is similar to all other service I have (which work fine, including X-Forward with the correct IP):
|
Alright, I have some news. I sorted out the issues with HAProxy (actually forgot to add the Anyways, now I get a
and this is what Indico reports. Essentially a missing
here are the logs:
|
Btw. the
|
Some nginx logs would probaly be useful. What URL do you use to access Indico? It should be the same that you configured as
That is pretty strange, the latest wheel which gets installed with the Dockerfile contains it.. Maybe try rebuilding the image? From what you posted, nothing stands out as clearly wrong, but your setup is different to what we have here. I'd suggest testing it locally first. If you can come up with a compose file I can run that reproduces the issue I'd be happy to take a look, but like this it's difficult to help :/ |
I sorted out all the nginx problems I guess, so currently it's really all about the missing |
Sorry for the spam, but I cleared all the volumes and now I managed to create the adminstration account:
The CSS is messed up however ;) |
So now the difference boils down to the mapped volumes:
The problem is that during the build of the worker, files are written to This means that the The question is: is that folder manipulated during the livetime of Indico, so that it has to be persistent? If yes, we need to manually copy files to the persistent volume after building the image. |
You could try manually running |
For the DB error you need to run |
Alright thanks! I currently manually copied the So far I think that Indico is running nicely. The only problem I have is that the Celery is killed constantly. I should probably open a new issue about that ;) |
Anything in the docker logs on how/why celery is getting killed? |
That's all I have now 😕 |
Ah, I forgot the
|
I now have
but Indico complains that
I don't see any reporting about the |
The
I have this in my Docker Swarm config:
But wondering if the hostname (service name) is picked up correctly since in the
|
You need to have both celery itself and celery beat running. The latter just triggers the scheduled tasks. |
Yep, I do, I just somehow forgot(deleted) the |
This is what I see in an endless loop, every few minutes in the indico celery (the celery beat service is running, like posted above):
|
that looks good. the fontconfig error is safe to ignore for now and just noise and should not be related to the container getting killed |
I still did not manage to get Indico reach the Celery task scheduler. How is this supposed to be debugged? I can resolve
and below are the logs of Redis. I assume there should be some logging that Indico or Celery are connected etc. but not sure (I am not a Redis expert at all). Any help is appreciated, I think this is the last step to have a Docker Swarm deployable Indico.
|
Do you have the celery beat running? indico-containers/indico-prod/docker-compose.yml Lines 47 to 49 in b94253d
|
Yes, the celery-beat is running, but it complained at the start about I attached to the running container and checked if I can resolve
Here are the logs of the
|
I am confused but I assume that after the So may I assume that the beat is working correctly? Btw. I just saw a random
To me it's unclear why Indico cannot talk to Here are more logs which indicate communication issues:
|
I connected to the
Update: I also tried the Python virtual environment inside the indico@2a004f1e324a:~$ . /opt/indico/.venv/bin/activate
(.venv) indico@2a004f1e324a:~$ python
Python 3.12.6 (main, Sep 9 2024, 18:06:01) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> r = redis.Redis(host='indico-redis', port=6379, decode_responses=True)
>>> r.get('foo')
'bar'
>>> r.keys()
['foo', 'celery', '_kombu.binding.celery']
>>> r.get("foo")
'bar'
>>> len(r.lrange("celery", 0, -1))
1682 As can be seen in the last command, the celery cache has entries. |
Yeah that looks correct, it prints
|
I also found that but that should not be the problem. I am already running in I really would like to know why the Celery is killed every few minutes:
but I don't see anything in the logs. I also don't know where to get anything out of Indico about the Celery connection issue. All I have is
I will now dig into the source code of Indico to see when this message gets printed and try to trace it back. |
I think I got it... I had 8GB reserved for the Celery service and just realised that it's running with 100% CPU and also 100% memory. I increased it to 16GB and now the CPU has dropped to around 5%, but memory is still full:
Ouf.... ok now I understand the "killed" message 🙈 It's still a bit weird that the memory usage is 100%, I guess it's allocating the full available memory? Let me close this super long issue, I think we are good to go now ;) Also let me know if you want to document the Docker Swarm setup. ...and of course many thanks for all the help! |
Interesting... the only case where I've seen this so far (at least for the CPU) was when running celery worker and celery beat in the same docker container ( |
Ah OK, but that might be related to this dominating memory consumption behaviour? I mean, the 100% CPU and kill after 2min is very likely that 8GB was not enough to set "whatever up" 😉 I am just guessing, but I can imagine that such a process does not like other processes in the same container. |
If you want to write something up, I think that'd be great! What do you think @ThiefMaster ? |
Is DS widely used nowadays? I think it's nice to have something, but I wonder where to put it. I don't think it should be us maintaining this type of documentation. What do you think about creating a forum post where you explain this? That way it's something that can be easily linked to, while at the same time it's not docs we have to maintain / keep up to date. |
Alright, I'll ping you guys when I put something up and you can link to if you like :) I don't know about the usage of Docker Swarm nowadays, it's working for me really well and I deploy and maintain a lot of services for different big physics experiments at our institute. Including GitLab (+runners), XWiki, RocketChat, (now also) Indico 😉 Easy to maintain and very transparent setup. Anyways, you'll here from me when I documented it! |
I managed to get the
latest
() Indico version up and running and also fixed issues like the missingBASE_URL
etc.The web-service is running but does not accept any requests from the load balancer. Flask is giving warnings that the
Current server name '' doesn't match configured server name 'indico.whatever.com'
:also logs like
How do I set that? I checked #28 but could not find any hint.
I also found https://talk.getindico.io/t/how-to-containerzie-my-application-using-docker/2989/2 which reports the same error message and points to #28 but I don't understand what's missing. The
BASE_URL
is set correctly.The text was updated successfully, but these errors were encountered: