Errors after installation

Hello!

I followed the Debian/nginx setup instructions as closely as possible. Additionally, I activated LDAP authorization and authentication.

But now, I can neither create events nor categories. I checked the browser’s developer console for errors and there are several "Uncaught TypeError"s and "Uncaught ReferenceError"s. Maybe it’s connected to the HTTP 404 errors on three script files (Domain name removed):

  • /assets/i18n/en_GB.js
  • /assets/i18n/en_GB-react.js
  • /assets/js-vars/global.js

I cannot find anything regarding an assets path for Indico in the installation guide. Is this path a relic from earlier versions? And how can I get Indico to allow me creation of events and categories?

Bests,
Masin

Which version did you install and which guide did you follow (link)? This sounds like a problem with your webserver config.

I followed this guide.

My nginx site config:

# MANAGED BY PUPPET
server {
  listen *:80;

  server_name           <removed>;


  access_log            /opt/indico/log/nginx/access.log combined;
  error_log             /opt/indico/log/nginx/error.log;

  location ~ ^/(images|fonts)(.*)/(.+?)(__v[0-9a-f]+)?\.([^.]+)$ {
    alias /opt/indico/web/static/$1$2/$3.$5;
    access_log off;
  }

  location ~ ^/(css|dist|images|fonts)/(.*)$ {
    alias /opt/indico/web/static/$1/$2;
    access_log off;
  }

  location /.xsf/indico/ {
    internal;
    alias /opt/indico;
  }

  location / {
    root      /var/empty/nginx;
    include /etc/nginx/uwsgi_params;
    uwsgi_buffers 32 32k;
    uwsgi_busy_buffers_size 128k;
    uwsgi_hide_header X-Sendfile;
    uwsgi_param UWSGI_SCHEME $scheme;
    uwsgi_pass unix:/opt/indico/web/uwsgi.sock;
    uwsgi_read_timeout 15m;
  }

  location /robots.txt {
    alias /opt/indico/web/static/robots.txt;
    access_log off;
  }
}

As you can see, there’s only an http config. https is done by our reverse proxy running on the same machine in a different LXC container.

Well it’s hard to debug remotely but check if USE_PROXY is set in your config. If the http host (as seen by the webapp, i.e. from X-Forwarded-Host when USE_PROXY is enabled) doesn’t match your BASE_URL, then you may get those 404s for any URL besides /.

I set USE_PROXY = True and restarted indico-celery.service and uwsgi.service. I guess, these are the relevant services when changing this config.

Nothing changed. Would it help if you could take a look at the site?

This is my config:

# General settings
SQLALCHEMY_DATABASE_URI = 'postgresql:///indico'
SECRET_KEY = xxxxxxxxxxxxxxxxxxxx
BASE_URL = 'https://indico.wikimedia.de'
CELERY_BROKER = 'redis://127.0.0.1:6379/0'
REDIS_CACHE_URL = 'redis://127.0.0.1:6379/1'
CACHE_BACKEND = 'redis'
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'
STORAGE_BACKENDS = {'default': 'fs:/opt/indico/archive'}
ATTACHMENT_STORAGE = 'default'
USE_PROXY = True

# Email settings
SMTP_SERVER = ('10.0.6.25', 25)
SMTP_USE_TLS = False
SMTP_LOGIN = ''
SMTP_PASSWORD = ''
SUPPORT_EMAIL = 'xxxxxx'
PUBLIC_SUPPORT_EMAIL = 'xxxxxx'
NO_REPLY_EMAIL = 'xxxxxx'

_ldap_config = {
	'uri': 'ldap://10.0.6.2',
	'bind_dn': 'CN=admin,DC=wikimedia,DC=de',
	'bind_password': 'xxxxxxxxxxx',
	'starttls': False,
	'timeout': 30,
	'verify_cert': False,
	'page_size': 1500,

	'uid': 'uid',
	'user_base': 'DC=wikimedia,DC=de',
	'user_filter': '(objectClass=univentionPerson)',

	'gid': 'cn',
	'group_base': 'CN=groups, DC=wikimedia, DC=de',
	'group_filter': '(objectClass=univentionGroup)',
	'member_of_attr': 'memberOf',
	'ad_group_style': True
}
AUTH_PROVIDERS = {
	'ldap': {
		'type': 'ldap',
		'title': 'WMDE',
		'ldap': _ldap_config,
		'default': True
	}
}

IDENTITY_PROVIDERS = {
	'ldap': {
		'type': 'ldap',
		'title': 'WMDE',
		'ldap': _ldap_config,
		'mapping': {
			'first_name': 'givenName',
			'last_name': 'sn',
			'email': 'mail',
			#'affiliation': 'company',
			#'phone': 'telephoneNumber'
		},
		'trusted_email': True,
		'default_group_provider': True,
		'synced_fields': {'first_name', 'last_name' }
		#'synced_fields': {'first_name', 'last_name', 'affiliation', 'phone', 'address'}
	}
}
STATIC_FILE_METHOD = ('xaccelredirect', {'/opt/indico': '/.xsf/indico'})

And this is the reverse proxy config:

# MANAGED BY PUPPET
server {
  listen *:80;

  server_name           indico.wikimedia.de;

  return 301 https://$host$request_uri;
  access_log            off;
  error_log             off;
}
# MANAGED BY PUPPET
server {
  listen       *:443 ssl;

  server_name  indico.wikimedia.de;

  ssl on;
  ssl_certificate           /etc/ssl/certs/wikimedia.de.chained.pem;
  ssl_certificate_key       /etc/ssl/private/wikimedia.de.key;
  ssl_session_cache         shared:SSL:10m;
  ssl_session_timeout       5m;
  ssl_protocols             TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers               ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
  ssl_prefer_server_ciphers on;

  index  index.html index.htm index.php;

  access_log            off;
  error_log             off;

  location / {
    proxy_pass            http://10.0.6.228:80/;
    proxy_read_timeout    90s;
    proxy_connect_timeout 90s;
    proxy_send_timeout    90s;
    proxy_set_header      Host $host;
    proxy_set_header      X-Real-IP $remote_addr;
    proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header      Proxy "";
    client_max_body_size 16g;
    proxy_pass_header     Set-Cookie;
    proxy_set_header	X-Forwarded-Host $host;
    proxy_set_header	X-Forwarded-Server $host;
    proxy_set_header	X-Forwarded-Proto $scheme;
  }
}

OK, not an URL issue since only those 3 files fail and everything else works fine.

If those files can’t be sent it’s most likely because there’s something wrong with x-accel-redir serving the cached versions (from /opt/indico/cache/*.js) - check your nginx logfile (on the worker, not the reverse proxy) for related errors. AFAIK most x-accel-redir errors result in a 404 being sent to the client…

1 Like

I can’t believe it!

The culprit (besides me) was a missing / at the end of the xsf alias resulting in requests fo /opt/indicocache/assets_global_2.2.5_2504823123.js and similar.

Thanks a lot!