openlibhums / janeway

A web-based platform for publishing journals, preprints, conference proceedings, and books
https://janeway.systems/
GNU Affero General Public License v3.0
172 stars 65 forks source link

Exception KeyError: Plugin has no field named 'homepage_element' #2519

Closed jscottbranson closed 3 years ago

jscottbranson commented 3 years ago

Describe the bug I'm following the instructions for a native install on Debian 10. I've successfully installed the dependencies from requirements.txt. However, in order to install the libraries in requirements.txt, I had to change 'jsmin==3.0.0' so it would work with Python 3.7.3, and I also had to install default-libmysqlclient-dev using apt. Other than those modifications, I've done everything by the docs.

When I run python3 manage.py install_janeway, and the install raises KeyError: 'homepage_element.

Janeway version Master/HEAD: 6360362082c251c5c7bf5ea38352f8c1af62890e

This issue does not impact the v1.4-RC-4 release.

To Reproduce Steps to reproduce the behavior:

  1. Basic Debian 10 server install
  2. sudo apt-get install libxml2-dev libxslt1-dev python3-dev zlib1g-dev lib32z1-dev libffi-dev libssl-dev libjpeg-dev default-libmysqlclient-dev
  3. Clone janeway Git
  4. Edit requirements.txt so 'jsmin==3.0.0'
  5. pip3 install -r requirements.txt
  6. Update src/core/settings.py with DB & ORCID settings
  7. run workon janeway from inside src
  8. python3 manage.py install_janeway raises KeyError

Traceback

Running migrations:
  Applying core.0059_auto_20211013_1657...Traceback (most recent call last):
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/models/options.py", line 617, in get_field
    return self.fields_map[field_name]
KeyError: 'homepage_element'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 16, in <module>
    execute_from_command_line(sys.argv)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/jsb/janeway/src/utils/management/commands/install_janeway.py", line 58, in handle
    call_command('migrate')
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
    fake_initial=fake_initial,
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/migrations/executor.py", line 115, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/migrations/migration.py", line 126, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "/home/jsb/janeway/src/core/migrations/0059_auto_20211013_1657.py", line 14, in set_about_plugin_to_hpe
    homepage_element=True,
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/models/query.py", line 646, in update
    query.add_update_values(kwargs)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/models/sql/subqueries.py", line 124, in add_update_values
    field = self.get_meta().get_field(name)
  File "/root/.virtualenvs/janeway/lib/python3.7/site-packages/django/db/models/options.py", line 619, in get_field
    raise FieldDoesNotExist("%s has no field named '%s'" % (self.object_name, field_name))
django.core.exceptions.FieldDoesNotExist: Plugin has no field named 'homepage_element'

Thanks so much, I'm really excited to get janeway running!

~Scott

mauromsl commented 3 years ago

Hi @crypticrabbit,

I've just pushed a fix on master that should address this problem (effb5d796e55dbf28de2ec8d6711fcf2724bc62f ) Would you mind pulling the latest changes and giving it another go?

jscottbranson commented 3 years ago

Works now, thanks so much, @mauromsl. I really appreciate the effort you all put into to this terrific software!