merenlab / anviserver

The code behind anvi'server
http://anvi-server.org
GNU Affero General Public License v3.0
5 stars 2 forks source link

"Settings already configured." error during migration #6

Closed rfox-mbl closed 2 years ago

rfox-mbl commented 2 years ago

CentOS Linux release 7.9.2009 (Core) anvio 7.1-dev Python 3.7.13 with Django components: django 3.2.13 django-bootstrap3 21.2
django-registration-redux 2.10

Using the conda environment created by following the instructions for following the active development code base for Anvio, I'm working on installing anviserver. As I'm working through the installation instructions, when I attempt to execute the migration: python manage.py migrate It seems to invariably result in briefly displaying the line: [12 May 22 13:59:08 Reading the accession to taxonomy file] ... Then it dumps the traceback:

  Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/www/vamps/projects/anvioserver/anvio-dev/lib/python3.7/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/local/www/vamps/projects/anvioserver/anvio-dev/lib/python3.7/site-packages/django/core/management/__init__.py", line 395, in execute
    django.setup()
  File "/usr/local/www/vamps/projects/anvioserver/anvio-dev/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/www/vamps/projects/anvioserver/anvio-dev/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/usr/local/www/vamps/projects/anvioserver/anvio-dev/lib/python3.7/site-packages/django/apps/config.py", line 301, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/www/vamps/projects/anvioserver/anvio-dev/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/www/vamps/projects/anvioserver/anvio-github/anviserver/main/models.py", line 8, in <module>
    from anvio import interactive
  File "/usr/local/www/vamps/projects/anvioserver/anvio-github/anvio/anvio/interactive.py", line 21, in <module>
    import anvio.summarizer as summarizer
  File "/usr/local/www/vamps/projects/anvioserver/anvio-github/anvio/anvio/summarizer.py", line 52, in <module>
    from anvio.summaryhtml import SummaryHTMLOutput, humanize_n, pretty
  File "/usr/local/www/vamps/projects/anvioserver/anvio-github/anvio/anvio/summaryhtml.py", line 52, in <module>
    settings.configure(**local_settings)
  File "/usr/local/www/vamps/projects/anvioserver/anvio-dev/lib/python3.7/site-packages/django/conf/__init__.py", line 118, in configure
    raise RuntimeError('Settings already configured.')
RuntimeError: Settings already configured.

I thought that perhaps my environment had gotten polluted so I've tried with a clean install on a different machine entirely and it still seems to trigger the error.

meren commented 2 years ago

I'm very sorry for this error, @rfox-mbl. Andy Voorhis has been working on anvi-server and he fixed these kinds of little problems with it, but despite all my requests and begging, these changes never ended up in the original anvi-server repository as they should have :(

I don't even know where is that fork, and I currently don't have anyone who can look into these bugs unfortunately.

rfox-mbl commented 2 years ago

No problem and thanks for the quick response!