Nitrate icon indicating copy to clipboard operation
Nitrate copied to clipboard

500 Service Error

Open aldous-nelsoft opened this issue 3 years ago • 12 comments

I'm trying to Register a New Account in Nitrate but I'm receiving 500 Service Error. 1

aldous-nelsoft avatar Jul 02 '21 03:07 aldous-nelsoft

How do you run Nitrate? Run it in container? Can you get the traceback from the log file?

tkdchen avatar Jul 02 '21 06:07 tkdchen

Yes, I'm using Docker and I run it in a container. Attached image is my setup and the log file. 2 image

aldous-nelsoft avatar Jul 02 '21 09:07 aldous-nelsoft

These are the steps that we did during the setup.

  1. Execute command: git clone https://github.com/Nitrate/Nitrate.git
  2. Execute command: cd ./Nitrate
  3. Execute command: docker-compose -f container-compose.yml up Optional: when there's an error after executing docker-compose up
  • 3.1. Open ./container-compose.yml, replace RABBITMQ_DEFAULT_VHOST=myvhost to - RABBITMQ_DEFAULT_VHOST=myvhost
  • 3.2. Open ./container-compose.yml, remove NITRATE_MIGRATE_DB: yes and NITRATE_SET_DEFAULT_PERMS: yes
  1. Execute command: docker exec -it nitrate_web_1 django-admin migrate
  2. Execute command: docker exec -it nitrate_web_1 django-admin createsuperuser
  3. Execute command: docker exec -it nitrate_web_1 django-admin setdefaultperms

aldous-nelsoft avatar Jul 02 '21 10:07 aldous-nelsoft

The log shows a sueruser admin has been created. So, you can login by using admin:admin. For local use, as a workaround, you can create user in the administration web UI.

tkdchen avatar Jul 02 '21 11:07 tkdchen

I tried creating a user in administration web UI but it's still not working. I also tried adding a Test Case in a Test Run and I also received 500 Server Error. Please help me fix the issue. Please see attached. 1

aldous-nelsoft avatar Jul 02 '21 14:07 aldous-nelsoft

I got this error:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/celery/app/trace.py", line 405, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/celery/app/trace.py", line 697, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/tcms/core/mailto.py", line 60, in mailto
    email_msg.send()
  File "/usr/lib/python3.9/site-packages/django/core/mail/message.py", line 284, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/usr/lib/python3.9/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
    new_conn_created = self.open()
  File "/usr/lib/python3.9/site-packages/django/core/mail/backends/smtp.py", line 62, in open
    self.connection = self.connection_class(self.host, self.port, **connection_params)
  File "/usr/lib64/python3.9/smtplib.py", line 255, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib64/python3.9/smtplib.py", line 341, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib64/python3.9/smtplib.py", line 312, in _get_socket
    return socket.create_connection((host, port), timeout,
  File "/usr/lib64/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib64/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

This is because the EMAIL_ related settings are not set properly. You can set them in the contrib/compose/web_custom_conf.py and start the container again.

At least, EMAIL_HOST and EMAIL_PORT are required to set.

tkdchen avatar Jul 03 '21 09:07 tkdchen

Alternatively, if you don't care about the email notification for now, you can set EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' in the contrib/compose/web_custom_conf.py instead.

tkdchen avatar Jul 03 '21 10:07 tkdchen

How about when I assigned test cases in a test run? I'm also receiving 500 Server Error.

aldous-nelsoft avatar Jul 05 '21 01:07 aldous-nelsoft

@aldouslbstda Hi, there could be some issue to the asynchronous task sending email. Let me find a time to investigate.

tkdchen avatar Jul 05 '21 03:07 tkdchen

@tkdchen I'll patiently wait. Thanks in advance.

aldous-nelsoft avatar Jul 05 '21 03:07 aldous-nelsoft

@tkdchen Hi, I just wanted to ask if there's an update? Thank you.

aldous-nelsoft avatar Jul 09 '21 03:07 aldous-nelsoft

@aldouslbstda Hi, Thank you very much for your patience. There is actually an issue and it has been fixed. Please remove the nitrate and nitrate-worker image and up the compose again. New image containing the fix will be pulled.

tkdchen avatar Jul 10 '21 07:07 tkdchen