openaicellular / oaic

Core software for Open AI Cellular
https://openaicellular.github.io/oaic/
GNU General Public License v3.0
65 stars 23 forks source link

Connection Refused Error While Deploying NexRAN xAPP #125

Closed leviosacz closed 1 year ago

leviosacz commented 1 year ago

Hello all,

I am encountering an issue while attempting to deploy the NexRAN xAPP, following the instructions outlined in the https://openaicellular.github.io/oaic/nexran1.html.

During the deployment process, specifically in the "Deploying the xApp" section, when I execute the following command:

curl -L -X POST "http://$KONG_PROXY:32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@nexran-onboard.url"

I am confronted with the following error message:

ConnectionRefusedError: [Errno 111] Connection refused

Please note that the full error message is quite lengthy due to an accompanying HTML file. Here is a part with error message for reference:

$ curl -L -X POST "http://$KONG_PROXY:32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@nexran-onboard.url"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>AttributeError: 'ConnectionError' object has no attribute 'message' // Werkzeug Debugger</title>
    <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css"
        type="text/css">
    <!-- We need to make sure this has a favicon so that the debugger does
         not by accident trigger a request to /favicon.ico which might
         change the application state. -->
    <link rel="shortcut icon"
        href="?__debugger__=yes&amp;cmd=resource&amp;f=console.png">
    <script src="?__debugger__=yes&amp;cmd=resource&amp;f=jquery.js"></script>
    <script src="?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js"></script>
    <script type="text/javascript">
      var TRACEBACK = 140161265159952,
          CONSOLE_MODE = false,
          EVALEX = true,
          EVALEX_TRUSTED = false,
          SECRET = "g2fKOlM8aHBpxs0XsRBJ";
    </script>
  </head>
  <body style="background-color: #fff">
    <div class="debugger">
<h1>AttributeError</h1>
<div class="detail">
  <p class="errormsg">AttributeError: 'ConnectionError' object has no attribute 'message'</p>
</div>

...

<div class="plain">
  <form action="/?__debugger__=yes&amp;cmd=paste" method="post">
    <p>
      <input type="hidden" name="language" value="pytb">
      This is the Copy/Paste friendly version of the traceback.  <span
      class="pastemessage">You can also paste this traceback into
      a <a href="https://gist.github.com/">gist</a>:
      <input type="submit" value="create paste"></span>
    </p>
    <textarea cols="50" rows="10" name="code" readonly>Traceback (most recent call last):
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connection.py&quot;, line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py&quot;, line 84, in create_connection
    raise err
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py&quot;, line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py&quot;, line 672, in urlopen
    chunked=chunked,
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py&quot;, line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File &quot;/usr/local/lib/python3.7/http/client.py&quot;, line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File &quot;/usr/local/lib/python3.7/http/client.py&quot;, line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File &quot;/usr/local/lib/python3.7/http/client.py&quot;, line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File &quot;/usr/local/lib/python3.7/http/client.py&quot;, line 1026, in _send_output
    self.send(msg)
  File &quot;/usr/local/lib/python3.7/http/client.py&quot;, line 966, in send
    self.connect()
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connection.py&quot;, line 184, in connect
    conn = self._new_conn()
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connection.py&quot;, line 169, in _new_conn
    self, &quot;Failed to establish a new connection: %s&quot; % e
urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x7f79d66c20d0&gt;: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/local/lib/python3.7/site-packages/requests/adapters.py&quot;, line 449, in send
    timeout=timeout
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py&quot;, line 760, in urlopen
    **response_kw
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py&quot;, line 760, in urlopen
    **response_kw
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py&quot;, line 760, in urlopen
    **response_kw
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py&quot;, line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File &quot;/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py&quot;, line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.86.33', port=5010): Max retries exceeded with url: /config_files/nexran-config-file.json (Caused by NewConnectionError('&lt;urllib3.connection.HTTPConnection object at 0x7f79d66c20d0&gt;: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/local/lib/python3.7/site-packages/xapp_onboarder/api/onboard.py&quot;, line 86, in download_config_and_schema_and_onboard
    response_content = session.get(config_file_url, timeout=settings.HTTP_TIME_OUT)
  File &quot;/usr/local/lib/python3.7/site-packages/requests/sessions.py&quot;, line 543, in get
    return self.request('GET', url, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/requests/sessions.py&quot;, line 530, in request
    resp = self.send(prep, **send_kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/requests/sessions.py&quot;, line 643, in send
    r = adapter.send(request, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/requests/adapters.py&quot;, line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.86.33', port=5010): Max retries exceeded with url: /config_files/nexran-config-file.json (Caused by NewConnectionError('&lt;urllib3.connection.HTTPConnection object at 0x7f79d66c20d0&gt;: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 2449, in wsgi_app
    response = self.handle_exception(e)
  File &quot;/usr/local/lib/python3.7/site-packages/flask_restplus/api.py&quot;, line 584, in error_router
    return original_handler(e)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/_compat.py&quot;, line 38, in reraise
    raise value.with_traceback(tb)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File &quot;/usr/local/lib/python3.7/site-packages/flask_restplus/api.py&quot;, line 584, in error_router
    return original_handler(e)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/_compat.py&quot;, line 38, in reraise
    raise value.with_traceback(tb)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File &quot;/usr/local/lib/python3.7/site-packages/flask/app.py&quot;, line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File &quot;/usr/local/lib/python3.7/site-packages/flask_restplus/api.py&quot;, line 325, in wrapper
    resp = resource(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/views.py&quot;, line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/flask_restplus/resource.py&quot;, line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/xapp_onboarder/api/endpoints/onboard_ep.py&quot;, line 70, in post
    return download_config_and_schema_and_onboard(config_file_url, controls_schema_url)
  File &quot;/usr/local/lib/python3.7/site-packages/xapp_onboarder/api/onboard.py&quot;, line 88, in download_config_and_schema_and_onboard
    log.error(err.message)
AttributeError: 'ConnectionError' object has no attribute 'message'</textarea>
  </form>
</div>
<div class="explanation">
  The debugger caught an exception in your WSGI application.  You can now
  look at the traceback which led to the error.  <span class="nojavascript">
  If you enable JavaScript you can also use additional features such as code
  execution (if the evalex feature is enabled), automatic pasting of the
  exceptions and much more.</span>
</div>
      <div class="footer">
        Brought to you by <strong class="arthur">DON'T PANIC</strong>, your
        friendly Werkzeug powered traceback interpreter.
      </div>
    </div>

    <div class="pin-prompt">
      <div class="inner">
        <h3>Console Locked</h3>
        <p>
          The console is locked and needs to be unlocked by entering the PIN.
          You can find the PIN printed out on the standard output of your
          shell that runs the server.
        <form>
          <p>PIN:
            <input type=text name=pin size=14>
            <input type=submit name=btn value="Confirm Pin">
        </form>
      </div>
    </div>
  </body>
</html>

<!--

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f79d66c20d0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 760, in urlopen
    **response_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 760, in urlopen
    **response_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 760, in urlopen
    **response_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.86.33', port=5010): Max retries exceeded with url: /config_files/nexran-config-file.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f79d66c20d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/xapp_onboarder/api/onboard.py", line 86, in download_config_and_schema_and_onboard
    response_content = session.get(config_file_url, timeout=settings.HTTP_TIME_OUT)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 543, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.86.33', port=5010): Max retries exceeded with url: /config_files/nexran-config-file.json (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f79d66c20d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask_restplus/api.py", line 584, in error_router
    return original_handler(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask_restplus/api.py", line 584, in error_router
    return original_handler(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.7/site-packages/flask_restplus/api.py", line 325, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask_restplus/resource.py", line 44, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/xapp_onboarder/api/endpoints/onboard_ep.py", line 70, in post
    return download_config_and_schema_and_onboard(config_file_url, controls_schema_url)
  File "/usr/local/lib/python3.7/site-packages/xapp_onboarder/api/onboard.py", line 88, in download_config_and_schema_and_onboard
    log.error(err.message)
AttributeError: 'ConnectionError' object has no attribute 'message'

-->

I would appreciate any guidance or assistance in resolving this issue. Please let me know if any additional information is needed to diagnose and address this problem effectively.

leviosacz commented 1 year ago

I solved this. I didn't do the previous procedure "xApp Deployment - General Guidelines". So there is no service listening on port 5010.