fluidos-project / kubectl-fluidos-plugin

FLUIDOS kubectl CLI plugin
https://www.fluidos.eu
Apache License 2.0
1 stars 0 forks source link

Quick Start guide MSPL test fails #18

Closed ggari-robotnik closed 5 months ago

ggari-robotnik commented 6 months ago

I tried to follow the readme install guide and when I try to execute the MSPL test if fails:

I think that the documentation is missing as a requirement is to have a Metaorchestartor running. That could be?

kubectl get pods
NAME                     READY   STATUS    RESTARTS        AGE
nginx-748c667d99-dxwfr   1/1     Running   7567 (8d ago)   76d
nginx-748c667d99-swzdm   1/1     Running   0               76d
nginx-748c667d99-vjp76   1/1     Running   0               76d
python -m pip list | grep fluidos
kubectl-fluidos            0.0.1
git@github.com:fluidos-project/kubectl-fluidos-plugin.git
cd kubectl-fluidos-plugin
kubectl fluidos -f tests/dataset/test-mspl.xml
 kubectl fluidos -f tests/dataset/test-mspl.xml
2024-04-19 10:25:06,541 - kubectl_fluidos - INFO - Starting FLUIDOS kubectl extension
2024-04-19 10:25:06,541 - kubectl_fluidos - INFO - Invoking MSPL Service Handler
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 86, 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/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f35281c7c70>: 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 "/home/ggari/.local/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.2.102', port=8002): Max retries exceeded with url: /meservice (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f35281c7c70>: 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 "/home/ggari/.local/bin/kubectl-fluidos", line 8, in <module>
    sys.exit(main())
  File "/home/ggari/.local/lib/python3.10/site-packages/kubectl_fluidos/__init__.py", line 181, in main
    fluidos_kubectl_extension(
  File "/home/ggari/.local/lib/python3.10/site-packages/kubectl_fluidos/__init__.py", line 163, in fluidos_kubectl_extension
    return on_mlps(data)
  File "/home/ggari/.local/lib/python3.10/site-packages/kubectl_fluidos/__init__.py", line 184, in <lambda>
    on_mlps=lambda x: MSPLProcessor(MSPLProcessorConfiguration.build_configuration(sys.argv))(x),
  File "/home/ggari/.local/lib/python3.10/site-packages/kubectl_fluidos/mspl.py", line 130, in __call__
    response = post(self.configuration.get_url(), headers=self._build_headers(), data=data)
  File "/home/ggari/.local/lib/python3.10/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/home/ggari/.local/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/ggari/.local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/ggari/.local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/home/ggari/.local/lib/python3.10/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.2.102', port=8002): Max retries exceeded with url: /meservice (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f35281c7c70>: Failed to establish a new connection: [Errno 111] Connection refused'))
stefano81 commented 6 months ago

@ggari-robotnik thank you for pointing this out.

Yes one needs a MSPL-metaorchestrator to be available. Without specifying the endpoint the pluging assumes it runs on one of the control-plane nodes. We will clarify that in the documentation, and produce more informative error messages.