Tutorials/Getting started => Internal Server Error

Hi there,

I am running the tutorial for Nomad: Deploy and Update a Job | Nomad | HashiCorp Developer

The web app show Internal server error both on Mac and Linux.

Any help is appreciated.

Hey!

We would need more information about it. Could you paste your error? What step are you struggling with? Could you help us to reproduce the problem?

Thanks!

Hi there.

I’m experiencing the same problem: When following the instructions for the “Local” nomad cluster, I get an internal server error when trying to access the web app’s frontend on 127.0.0.1:5000. The tutorial works perfectly fine for AWS.

My base setup as follows:

  • 2020 Apple M1, 16GB
  • Homebrew 4.0.19
  • Docker version 23.0.5, build bc4487a installed via homebrew/ cask but it’s Docker Desktop
  • Terraform and Nomad installed from hashicorp/tap
  • System firewall is off

Here’s the error log from the web app’s docker container. The redis task is running and doesn’t show any errors (unless I try connect to it via http).

2023-05-27 11:28:27 [2023-05-27 09:28:27,726] ERROR in app: Exception on / [GET]
2023-05-27 11:28:27 Traceback (most recent call last):
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 624, in connect
2023-05-27 11:28:27     sock = self.retry.call_with_retry(
2023-05-27 11:28:27            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/retry.py", line 46, in call_with_retry
2023-05-27 11:28:27     return do()
2023-05-27 11:28:27            ^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 625, in <lambda>
2023-05-27 11:28:27     lambda: self._connect(), lambda error: self.disconnect(error)
2023-05-27 11:28:27             ^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 690, in _connect
2023-05-27 11:28:27     raise err
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 678, in _connect
2023-05-27 11:28:27     sock.connect(socket_address)
2023-05-27 11:28:27 ConnectionRefusedError: [Errno 111] Connection refused
2023-05-27 11:28:27 
2023-05-27 11:28:27 During handling of the above exception, another exception occurred:
2023-05-27 11:28:27 
2023-05-27 11:28:27 Traceback (most recent call last):
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
2023-05-27 11:28:27     response = self.full_dispatch_request()
2023-05-27 11:28:27                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
2023-05-27 11:28:27     rv = self.handle_user_exception(e)
2023-05-27 11:28:27          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
2023-05-27 11:28:27     rv = self.dispatch_request()
2023-05-27 11:28:27          ^^^^^^^^^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
2023-05-27 11:28:27     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-05-27 11:28:27            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/src/app/./webviewer.py", line 62, in home
2023-05-27 11:28:27     return render_template("index.html", stats=stats(), refresh_interval=refresh_interval)
2023-05-27 11:28:27                                                ^^^^^^^
2023-05-27 11:28:27   File "/usr/src/app/./webviewer.py", line 67, in stats
2023-05-27 11:28:27     for key in r.scan_iter("*"):
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/commands/core.py", line 3003, in scan_iter
2023-05-27 11:28:27     cursor, data = self.scan(
2023-05-27 11:28:27                    ^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/commands/core.py", line 2978, in scan
2023-05-27 11:28:27     return self.execute_command("SCAN", *pieces, **kwargs)
2023-05-27 11:28:27            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/client.py", line 1255, in execute_command
2023-05-27 11:28:27     conn = self.connection or pool.get_connection(command_name, **options)
2023-05-27 11:28:27                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 1427, in get_connection
2023-05-27 11:28:27     connection.connect()
2023-05-27 11:28:27   File "/usr/local/lib/python3.11/site-packages/redis/connection.py", line 630, in connect
2023-05-27 11:28:27     raise ConnectionError(self._error_message(e))
2023-05-27 11:28:27 redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:26529. Connection refused.
2023-05-27 11:28:27 172.17.0.1 - - [27/May/2023 09:28:27] "GET / HTTP/1.1" 500 -

1 Like