question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installer crashes since 1.10.4 with python 2

See original GitHub issue

Impacted versions

1.10.4

  • Distribution: Ubuntu
  • Codename: Xenial
  • Arch: 64 Bits
  • Database: PostgreSQL

Steps to reproduce

run installer

Full trace using --debug option or current behaviour

[after successful install of pip packages…]

['/srv/modoboa/env/bin/python2', u'manage.py', u'load_initial_data', u'--admin-username', u'admin'] failed, check your configuration
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 327, in execute
    self.check()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
    include_deployment_checks=include_deployment_checks,
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
    return checks.run_checks(**kwargs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
    return check_resolver(resolver)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
    return check_method()
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check
    for pattern in self.url_patterns:
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/srv/modoboa/instance/instance/urls.py", line 4, in <module>
    url(r'', include('modoboa.urls')),
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/urls.py", line 31, in <module>
    url("admin/", include("modoboa.admin.urls", namespace="admin")),
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/urls.py", line 10, in <module>
    from .views import (
  File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/admin/views/export.py", line 22, in <module>
    from backports import csv
ImportError: No module named backports

['/srv/modoboa/env/bin/python2', u'manage.py', u'set_default_site', 'mail.mydomain.com'] failed, check your configuration
ERROR:  relation "core_localconfig" does not exist
LINE 1: UPDATE core_localconfig SET _parameters='{"admin": {"handle_...

Expected behavior

backports.csv should be installed. I had to do modify scripts/modoboa.py and add backports.csv to the packages list variable.

I have this bug since a few days, since I saw 1.10.4 was released.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alterguicommented, May 1, 2018

unfortunately the quick fix (ff2bf9994) is not enough for me 😦 the installer spits out a few “ImportError: No module named backports” just like in the original report, and i get “502 Bad Gateway” after a fresh install, just like other people (#208, #206)

i had to resort to monkey-patching the modoboa-installer to fetch modoboa at commit f604aacb61b0

--- before: /opt/modoboa-installer/modoboa_installer/scripts/modoboa.py
+++ after: /opt/modoboa-installer/modoboa_installer/scripts/modoboa.py
@@ -69,7 +69,7 @@
         packages = ["rrdtool"]
         version = self.config.get("modoboa", "version")
         if version == "latest":
-            modoboa_package = "modoboa"
+            modoboa_package = "git+https://github.com/modoboa/modoboa.git@f604aacb61b0b1383bcb5c10943ae2a15f46f93e#egg=modoboa"
             packages += self.extensions
         else:
             matrix = compatibility_matrix.COMPATIBILITY_MATRIX[version]

stil, the compilation would fail with a fresh debian 9.3, at the point of compiling lxml from source, due to missing source dependencies (libssl1.0-dev libz-dev)

so right now, i got it working with the following steps (starting with pristine debian 9.3)

sudo apt install git
sudo apt install libssl1.0-dev libz-dev # needed to compile modoboa dependencies from source
sudo git clone https://github.com/modoboa/modoboa-installer /opt/modoboa-installer
sudo sed -i 's|modoboa_package = "modoboa"|modoboa_package = "git+https://github.com/modoboa/modoboa.git@f604aacb61b0b1383bcb5c10943ae2a15f46f93e#egg=modoboa"|'  /opt/modoboa-installer/modoboa_installer/scripts/modoboa.py
sudo /usr/bin/python /opt/modoboa-installer/run.py domain.tld

this will result in a working instance of modoboa==1.10.5.dev8+gf604aacb instead of modoboa 1.10.4 (current latest release), good enough until a proper 1.10.5 release is made 😃

0reactions
tonioocommented, Apr 11, 2018

Should work now, I’ve added a quick fix to the installer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python not found exception due to node-sass and node-gyp
so this happened to me on windows recently. I fix it by following the following steps using a PowerShell with admin privileges:.
Read more >
Issue 32044: pip3 install 3.6.3 crashes on startup; 3.5.4 works
msg306336 ‑ (view) Author: Daniel E Platt (DanPlatt) Date: 2017‑11‑16 05:01 msg306337 ‑ (view) Author: Daniel E Platt (DanPlatt) Date: 2017‑11‑16 05:08 msg306339 ‑ (view)...
Read more >
Installation — SimCADO 0.7 documentation - Read the Docs
However it won't crash SimCADO for single images. Note. A side note: Astropy will stop supporting Python 2.7 in 2019 and the official...
Read more >
Bug listing with status RESOLVED with resolution TEST ...
Bug:233 - "Emacs segfaults when merged through the sandbox." status:RESOLVED resolution:TEST-REQUEST severity:critical · Bug:3888 - "yenta_socket module not ...
Read more >
launchpadlib - PyPI
1.10.9 (2019-11-28). Explicitly install version.txt; launchpadlib requires it. ... Fix AccessToken.from_string crash on Python 3. ... 1.10.4 (2016-07-12).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found