openlibhums / janeway

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

Registration of new account results in error #1199

Closed wernerkrampl closed 5 years ago

wernerkrampl commented 5 years ago

Describe the bug After installation of Janeway by the wiki and initial setup, I tried to submit a testing article. When I was done creating new account, I clicked on "Register" and I got "Issue Server Error Sorry, there was a server error. Our team has been notified." error. Nevertheless, account is registered, but is not active and no confirmation mail has been sent. Log records in janeway/logs/janeway.log are:

CRITICAL 2019-06-28 10:29:59,863 setting_handler P:25665 T:140312091252480 [<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>] Failed to load plugin setting for context:
plugin: [HTML] 1.0 - True,
setting_name: html_block_content,
journal: <journal>: <domain>,
fallback: ,
request language: en,
settings language: en,

ERROR 2019-06-28 10:29:59,864 hooks P:25665 T:140312091252480 [<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>:<journal>] Plugin setting does not exist and will not be created.
Traceback (most recent call last):
  File "<path>/janeway/src/utils/setting_handler.py", line 242, in _get_plugin_setting
    journal=journal
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
    self.model._meta.object_name
hvad.models.DoesNotExist: PluginSettingValueTranslation matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<path>/janeway/src/core/homepage_elements/html/hooks.py", line 14, in yield_homepage_element_context
    html_block_content = setting_handler.get_plugin_setting(plugin, 'html_block_content', request.journal).value
  File "<path>/janeway/src/utils/setting_handler.py", line 234, in get_plugin_setting
    raise e
  File "<path>/janeway/src/utils/setting_handler.py", line 219, in get_plugin_setting
    return _get_plugin_setting(plugin, setting, journal, lang, create, fallback)
  File "<path>/janeway/src/utils/setting_handler.py", line 250, in _get_plugin_setting
    raise IndexError('Plugin setting does not exist and will not be created.')
IndexError: Plugin setting does not exist and will not be created.
WARNING 2019-06-28 10:30:00,254 base P:25665 T:140312124856064 Not Found: /favicon.ico
WARNING 2019-06-28 10:30:09,639 base P:25665 T:140312124856064 Not Found: /favicon.ico
ERROR 2019-06-28 10:35:03,217 exception P:25665 T:140312091252480 Invalid HTTP_HOST header: '<IP>'. You may need to add '<IP>' to ALLOWED_HOSTS.
ERROR 2019-06-28 10:45:26,343 exception P:25665 T:140312124856064 Internal Server Error: /register/step/1/
Traceback (most recent call last):
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "<path>/janeway/src/core/views.py", line 282, in register
    logic.send_confirmation_link(request, new_user)
  File "<path>/janeway/src/core/logic.py", line 61, in send_confirmation_link
    notify_helpers.send_email_with_body_from_user(request, subject, new_user.email, message, log_dict=log_dict)
  File "<path>/janeway/src/utils/notify_helpers.py", line 40, in send_email_with_body_from_user
    notify.notification(**notify_contents)
  File "<path>/janeway/src/utils/notify.py", line 21, in notification
    [func(**kwargs) for func in settings.NOTIFY_FUNCS]
  File "<path>/janeway/src/utils/notify.py", line 21, in <listcomp>
    [func(**kwargs) for func in settings.NOTIFY_FUNCS]
  File "<path>/janeway/src/utils/notify_plugins/notify_email.py", line 88, in notify_hook
    response = send_email(subject, to, html, request.journal, request, bcc, cc, attachment)
  File "<path>/janeway/src/utils/notify_plugins/notify_email.py", line 60, in send_email
    return msg.send()
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/core/mail/message.py", line 348, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 104, in send_messages
    new_conn_created = self.open()
  File "<path>/virtualenvs/janeway/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 69, in open
    self.connection.starttls(keyfile=self.ssl_keyfile, certfile=self.ssl_certfile)
  File "/usr/lib/python3.6/smtplib.py", line 749, in starttls
    self.ehlo_or_helo_if_needed()
  File "/usr/lib/python3.6/smtplib.py", line 600, in ehlo_or_helo_if_needed
    if not (200 <= self.ehlo()[0] <= 299):
  File "/usr/lib/python3.6/smtplib.py", line 440, in ehlo
    self.putcmd(self.ehlo_msg, name or self.local_hostname)
  File "/usr/lib/python3.6/smtplib.py", line 367, in putcmd
    self.send(str)
  File "/usr/lib/python3.6/smtplib.py", line 359, in send
    raise SMTPServerDisconnected('please run connect() first')
smtplib.SMTPServerDisconnected: please run connect() first
WARNING 2019-06-28 10:45:26,613 base P:25665 T:140312124856064 Not Found: /favicon.ico

Janeway version v1.3.4

To Reproduce Steps to reproduce the behavior: By "BirkbeckCTP/janeway" wiki including installation of apache2, MySQL database and setting up initial journal settings. Click on "Start Submission", then "Register a new account", fill all the fields and click on "Register".

Expected behavior Confimation that the Account registration was successful.

Additional context Running on Ubuntu 18.04.2 LTS Apache/2.4.29 (Ubuntu) MySQL 14.14 Distrib 5.7.26 Python 3.6.7

ajrbyers commented 5 years ago

Hi @wernerkrampl have you configured your email server?

ajrbyers commented 5 years ago

If you have configured it can you post up all the email related settings (excluding passwords!).

amardesi commented 5 years ago

This error has also been appearing for me since upgrading to 1.3.5.1, whenever the press or journal home page is loaded.

Maybe this is related, but I also see this error when loading the plugin page, for both 1.3.4 and 1.3.5.1 installations: ERROR 2019-06-28 09:54:28,200 views P:49509 T:123145555025920 [press] Importing plugin [HTML] 1.0 - True failed: No module named 'plugins.HTML' ERROR 2019-06-28 09:54:28,200 views P:49509 T:123145555025920 [press] Importing plugin [News] 1.0 - True failed: No module named 'plugins.News'

Looks like this is related to https://github.com/BirkbeckCTP/janeway/issues/1111

ajrbyers commented 5 years ago

Hi Andy,

Although that error is present it's not the one that is causing the issue. The HTML setting being missing is not critical and is a warning only.

On Fri, 28 Jun 2019, 18:04 Andy Mardesich, notifications@github.com wrote:

This error has also been appearing for me since upgrading to 1.3.5, whenever the press or journal home page is loaded.

Maybe this is related, but I also see this error when loading the plugin page, for both 1.3.4 and 1.3.5.1 installations: ERROR 2019-06-28 09:54:28,200 views P:49509 T:123145555025920 [press] Importing plugin [HTML] 1.0 - True failed: No module named 'plugins.HTML' ERROR 2019-06-28 09:54:28,200 views P:49509 T:123145555025920 [press] Importing plugin [News] 1.0 - True failed: No module named 'plugins.News'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BirkbeckCTP/janeway/issues/1199?email_source=notifications&email_token=AB7PSYWTUTAQG3OP4MHMXDLP4ZAA7A5CNFSM4H4EXBK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY2UIJY#issuecomment-506807335, or mute the thread https://github.com/notifications/unsubscribe-auth/AB7PSYVWDNUCNDIQ6YC4VO3P4ZAA7ANCNFSM4H4EXBKQ .

wernerkrampl commented 5 years ago

If you have configured it can you post up all the email related settings (excluding passwords!).

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = '<IP ADRESS>'
EMAIL_PORT = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = True
DUMMY_EMAIL_DOMAIN = "@<domain>"

#Settings for use with Mailgun
MAILGUN_ACCESS_KEY = ''
MAILGUN_SERVER_NAME = ''
MAILGUN_REQUIRE_TLS = False
ENABLE_ENHANCED_MAILGUN_FEATURES = False  # Enables email tracking
ajrbyers commented 5 years ago

Hi @wernerkrampl so it looks like you've set up Janeway to send ails over SMTP but not setup SMTP server details. Is this a "production" install on a server or a "development" install on your local machine?