Free5GMANO - Issue Installing nmctl Client

Hello,

I’m currently trying to implement free5gmano for use with free5gcore, however I’m stuck in the “Apply NSSI” section. Despite what appears to be a successful install of nmctl, when I try to enter any nmctl command such as “nmctl get plugin”, I’m told that the system cannot recognize the command. The output of “pip3 install -e ." is as follows. Do you know what’s going on here, and how I can get nmctl working properly?

Obtaining file:///home/cci5gbase/free5gmano-cli
Collecting click==7.1 (from nmctl==0.1)
Using cached https://files.pythonhosted.org/packages/cf/14/03d1edbed5fe8be89d0938f8bc015f97cc6ff47af55d1195ec0fab978e64/click-7.1-py2.py3-none-any.whl
Collecting pandas==0.24.2 (from nmctl==0.1)
Using cached https://files.pythonhosted.org/packages/19/74/e50234bc82c553fecdbd566d8650801e3fe2d6d8c8d940638e3d8a7c5522/pandas-0.24.2-cp36-cp36m-manylinux1_x86_64.whl
Collecting numpy>=1.12.0 (from pandas==0.24.2->nmctl==0.1)
Using cached https://files.pythonhosted.org/packages/00/16/476826a84d545424084499763248abbbdc73d065168efed9aa71cdf2a7dc/numpy-1.19.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting pytz>=2011k (from pandas==0.24.2->nmctl==0.1)
Using cached https://files.pythonhosted.org/packages/4f/a4/879454d49688e2fad93e59d7d4efda580b783c745fd2ec2a3adf87b0808d/pytz-2020.1-py2.py3-none-any.whl
Collecting python-dateutil>=2.5.0 (from pandas==0.24.2->nmctl==0.1)
Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil>=2.5.0->pandas==0.24.2->nmctl==0.1)
Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Installing collected packages: click, numpy, pytz, six, python-dateutil, pandas, nmctl
Found existing installation: nmctl 0.1
Uninstalling nmctl-0.1:
Successfully uninstalled nmctl-0.1
Running setup.py develop for nmctl
Successfully installed click-7.1 nmctl numpy-1.19.0 pandas-0.24.2 python-dateutil-2.8.1 pytz-2020.1 six-1.15.0

I am using the following guides:



Thanks,
Adam

Hi @gorski,

I’m at this step, could you please let me know how to configure? I will try to see if the same issue that you hit, but now i stuck at this step.

Setup free5gmano host and port

cd free5gmano-cli/nm
vim setting.py

Thanks.

@nmpvinh,

Thanks for the response. I was able to solve the initial issue by running the following command with sudo:

pip3 install -e .

After changing this the system recognizes the nmctl command, however I get the following error, which I believe has to do with the host and port configuration you’re referring to. Unfortunately I do not know what the correct config is. I will be sure to update if I find out.

cci5gbase@ubuntu:~$ nmctl register plugin kube5gnfvo -f simpleexampleplugin/
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, 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 601, in urlopen
    chunked=chunked)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.6/http/client.py", line 1264, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1310, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1259, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 976, in send
    self.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f99cc9630b8>: 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/lib/python3/dist-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=30088): Max retries exceeded with url: /plugin/management/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f99cc9630b8>: 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/cci5gbase/.local/bin/nmctl", line 11, in <module>
    load_entry_point('nmctl', 'console_scripts', 'nmctl')()
  File "/home/cci5gbase/.local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/cci5gbase/.local/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/cci5gbase/.local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/cci5gbase/.local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/cci5gbase/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/cci5gbase/.local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/cci5gbase/free5gmano-cli/nm/nmctl.py", line 295, in register_plugin
    response = api.register_service_mapping_plugin(data, files)
  File "/home/cci5gbase/free5gmano-cli/utils/api.py", line 55, in register_service_mapping_plugin
    return requests.post(register_plugin_url, files=files, data=data, headers=zip_headers)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 520, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 630, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=30088): Max retries exceeded with url: /plugin/management/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f99cc9630b8>: Failed to establish a new connection: [Errno 111] Connection refused',))

Hi @gorski,

Here is my setting.py content: Should we change host IP?
ubuntu@ubuntu-KVM:~ cd free5gmano-cli/nm ubuntu@ubuntu-KVM:~/free5gmano-cli/nm cat settings.py
NM_HOST = ‘127.0.0.1’
NM_PORT = ‘30088’
NM_URL = ‘http://{0}:{1}/’.format(NM_HOST, NM_PORT)

I hit same issue with yours
ubuntu@ubuntu-KVM:~/free5gmano-cli/nm$ nmctl register plugin kube5gnfvo -f simpleexampleplugin/
Traceback (most recent call last):
File “/home/ubuntu/.local/bin/nmctl”, line 11, in
load_entry_point(‘nmctl’, ‘console_scripts’, ‘nmctl’)()
File “/home/ubuntu/.local/lib/python3.6/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/.local/lib/python3.6/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/ubuntu/.local/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/.local/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/.local/lib/python3.6/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/.local/lib/python3.6/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/free5gmano-cli/nm/nmctl.py”, line 281, in register_plugin
os.chdir(os.path.abspath(folder))
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/ubuntu/free5gmano-cli/nm/simpleexampleplugin’

@nmpvinh

Your error is different from mine, you need to be in the directory directly above ‘simpleexampleplugin’ before running the command:

nmctl register plugin kube5gnfvo -f simpleexampleplugin/

@gorski

Thanks, it failed as below with “operationfailed”
>
> ubuntu@ubuntu-KVM:~$ nmctl register plugin kube5gnfvo -f simpleexampleplugin/
> OperationFailed

i tried both directory but it didnot help.

ubuntu@ubuntu-KVM:~/free5gmano$ ls -lrt
total 52
-rw-rw-r-- 1 ubuntu ubuntu  7703 Thg 8  7 16:57 README.md
-rw-rw-r-- 1 ubuntu ubuntu 10142 Thg 8  7 16:57 LICENSE
drwxrwxr-x 3 ubuntu ubuntu  4096 Thg 8  7 16:57 moi
-rw-rw-r-- 1 ubuntu ubuntu  1259 Thg 8  7 16:57 manage.py
drwxrwxr-x 2 ubuntu ubuntu  4096 Thg 8  7 16:57 free5gmano
drwxrwxr-x 4 ubuntu ubuntu  4096 Thg 8  7 16:57 docker
drwxrwxr-x 4 ubuntu ubuntu  4096 Thg 8  7 16:57 deploy
-rw-rw-r-- 1 ubuntu ubuntu   205 Thg 8  7 16:57 requirements.txt
drwxrwxr-x 5 ubuntu ubuntu  4096 Thg 8  7 16:57 nssmf
drwxrwxr-x 5 ubuntu ubuntu  4096 Thg 8 16 07:08 simpleexampleplugin
ubuntu@ubuntu-KVM:~/free5gmano$ nmctl register plugin kube5gnfvo -f simpleexampleplugin/
OperationFailed

i also try this but it still fails:
root@ubuntu-KVM:/home/ubuntu/free5gmano-cli# nmctl register plugin kube5gnfvo -f /home/ubuntu/simpleexampleplugin/
OperationFailed

try to modify simpleexampleplugin/config.yaml
nm_ip -> nm_host
nfvo_ip -> nfvo_host
kafka_ip -> subscription_host

finally works…

1 Like