modoboa/modoboa-contacts

/contacts throws webpack error if accessed with DEBUG=True setting

feueraustreter opened this issue · 2 comments

Impacted versions

Modoboa: 1.13.0
Contacts: 0.7.3
Radicale management: 1.3.6
Installer used: Yes
Webserver: Nginx

Steps to reproduce

When I access https://mail.mydomain.de/contacts/ with DEBUG=True in settings.py I get an error.
Because it's only in debug mode, it's not that bad but annoying.

Webpack details

Setting Value
WEBPACK_LOADER {'CALENDAR': {'BUNDLE_DIR_NAME': 'modoboa_radicale/', 'CACHE': False, 'IGNORE': ['.+\.hot-update.js', '.+\.map'], 'STATS_FILE': '/srv/modoboa/env/lib/python2.7/site-packages/modoboa_radicale/../frontend/webpack-stats.json'}, 'CONTACTS': {'BUNDLE_DIR_NAME': 'modoboa_radicale/', 'CACHE': False, 'IGNORE': ['.+\.hot-update.js', '.+\.map'], 'STATS_FILE': '/srv/modoboa/env/lib/python2.7/site-packages/modoboa_contacts/../frontend/webpack-stats.json'}}

I anonymized the log file a bit, replacing the real domain with mail.mydomain.de

IOError at /contacts/
Error reading /srv/modoboa/env/lib/python2.7/site-packages/modoboa_contacts/../frontend/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
Request Method: GET
Request URL:  https://mail.mydomain.de/contacts/
Django Version: 1.11.18
Exception Type: IOError
Exception Value:  
Error reading /srv/modoboa/env/lib/python2.7/site-packages/modoboa_contacts/../frontend/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?
Exception Location: /srv/modoboa/env/lib/python2.7/site-packages/webpack_loader/loader.py in _load_assets, line 32
Python Executable:  /usr/sbin/uwsgi
Python Version: 2.7.5
Python Path:  
['.',
 '',
 '/srv/modoboa/env/lib64/python27.zip',
 '/srv/modoboa/env/lib64/python2.7',
 '/srv/modoboa/env/lib64/python2.7/plat-linux2',
 '/srv/modoboa/env/lib64/python2.7/lib-tk',
 '/srv/modoboa/env/lib64/python2.7/lib-old',
 '/srv/modoboa/env/lib64/python2.7/lib-dynload',
 '/usr/lib64/python2.7',
 '/usr/lib/python2.7',
 '/srv/modoboa/env/lib/python2.7/site-packages']
Server time:  Fri, 18 Jan 2019 09:03:47 +0100


Environment:

Request Method: GET
Request URL: https://mail.mydomain.de/contacts/

Django Version: 1.11.18
Python Version: 2.7.5
Installed Applications:
(u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.sessions',
 u'django.contrib.messages',
 u'django.contrib.sites',
 u'django.contrib.staticfiles',
 u'reversion',
 u'ckeditor',
 u'ckeditor_uploader',
 u'rest_framework',
 u'rest_framework.authtoken',
 u'modoboa',
 u'modoboa.core',
 u'modoboa.lib',
 u'modoboa.admin',
 u'modoboa.transport',
 u'modoboa.relaydomains',
 u'modoboa.limits',
 u'modoboa.parameters',
 u'modoboa.dnstools',
 u'modoboa_pdfcredentials',
 u'modoboa_postfix_autoreply',
 u'modoboa_sievefilters',
 u'modoboa_stats',
 u'modoboa_webmail',
 u'modoboa_contacts',
 u'modoboa_radicale',
 'webpack_loader')
Installed Middleware:
(u'x_forwarded_for.middleware.XForwardedForMiddleware',
 u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.common.CommonMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'django.middleware.locale.LocaleMiddleware',
 u'django.middleware.clickjacking.XFrameOptionsMiddleware',
 u'modoboa.core.middleware.LocalConfigMiddleware',
 u'modoboa.lib.middleware.AjaxLoginRedirect',
 u'modoboa.lib.middleware.CommonExceptionCatcher',
 u'modoboa.lib.middleware.RequestCatcherMiddleware')



Traceback:

File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
  41.             response = get_response(request)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  217.                 response = self.process_exception_by_middleware(e, request)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
  215.                 response = response.render()

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/response.py" in render
  107.             self.content = self.rendered_content

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  84.         content = template.render(context, self._request)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/backends/django.py" in render
  66.             return self.template.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render
  207.                     return self._render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  177.             return compiled_parent._render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in _render
  199.         return self.nodelist.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  72.                 result = block.nodelist.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/defaulttags.py" in render
  322.                 return nodelist.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render
  990.                 bit = node.render_annotated(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/base.py" in render_annotated
  957.             return self.render(context)

File "/srv/modoboa/env/lib/python2.7/site-packages/django/template/library.py" in render
  203.         output = self.func(*resolved_args, **resolved_kwargs)

File "/srv/modoboa/env/lib/python2.7/site-packages/webpack_loader/templatetags/webpack_loader.py" in render_bundle
  12.     tags = utils.get_as_tags(bundle_name, extension=extension, config=config, attrs=attrs)

File "/srv/modoboa/env/lib/python2.7/site-packages/webpack_loader/utils.py" in get_as_tags
  45.     bundle = _get_bundle(bundle_name, extension, config)

File "/srv/modoboa/env/lib/python2.7/site-packages/webpack_loader/utils.py" in _get_bundle
  23.     bundle = get_loader(config).get_bundle(bundle_name)

File "/srv/modoboa/env/lib/python2.7/site-packages/webpack_loader/loader.py" in get_bundle
  60.         assets = self.get_assets()

File "/srv/modoboa/env/lib/python2.7/site-packages/webpack_loader/loader.py" in get_assets
  39.         return self._load_assets()

File "/srv/modoboa/env/lib/python2.7/site-packages/webpack_loader/loader.py" in _load_assets
  32.                     self.config['STATS_FILE']))

Exception Type: IOError at /contacts/
Exception Value: Error reading /srv/modoboa/env/lib/python2.7/site-packages/modoboa_contacts/../frontend/webpack-stats.json. Are you sure webpack has generated the file and the path is correct?

Additional log files:

meta

instance.settings

I have experienced the same problem in contacts as well as in Radicale. Please let me know if you would like any specific logging/debug data but my output looks very similar to the original post.

edit: I used modoboa-installer to build the system on a fresh ubuntu server

@specialseth @feueraustreter ,I have the same problem with you, Have you solved this problem?