Capif error when running register-and-onboard command

Goal:
Trying to setup Capif with the IMM NetApp.

Result:
Errors when running manually the prepare.sh script:

requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘capifcore’, port=8080): Max retries exceeded with url: /register (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x00000252E3118E80>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed’))

Screenshot of the error:

Steps to reproduce:

  1. Run the Capif services (sudo ./run.sh, got the “All Capif services are running” message)

  2. Run the NEF emulator. Emulator starts successfully, but unclear if the unboarding with Capif went well or not.

  3. Run the ./prepare.sh command. I’m doing it manually since I wanted to test Capif locally for now (=> not using a container for our NetApp).

Host environment:
Windows 10
Git bash
Docker-for-Windows
NEF emulator 1.6.1
Recent CAPIF version (from last week, develop branch)

/etc/host file: tried with localhost, then localhost and 172.17.0.1:
Etc_hosts_file

File structure:

Content of capif_onboarding folder:
Onboarding_folder

Capif_registration json file:

Is there something I missed in the procedure to setup Capif?
Thank you in advance for your help.

Hi Charles.
Do you run/deploy CAPIF-NEF-netapp on the same host?

Also, the prepare.sh should be run inside the netapp container not the host.

Have a look if you can on the dummy netapp repo

Hi Stavros,

Thank you for the quick answer.

Yes, Capif and Nef are running on the same host. I tried to reproduce what I saw on the dummy netapp and the videos from Ricardo and Dimitris.

However, I may have missunderstood the part about the prepare.sh script. Is is required only when using a container? Should I only use a container when working with Capif? Usually I’m working locally first (running the NetApp through my IDE) because it’s more convenient, then I try with a containerized version when its ready.

Concerning the IP 172… etc, I think is visible only from containers on the same network.
So I would propose to work from the containerized version.

Ok, I will focus on the containerized version.

One more question then: how can I check within the container that the capif registration and onboarding was successfull? So far, I’m getting the following error:

FileNotFoundError: [Errno 2] No such file or directory: ‘usr/src/app/capif_onboarding/capif_api_details.json’

I’m calling the prepare.sh script in the Dockerfile like shown in the dummy NetApp:
image

However, I have the impression that the command is ignored:

Any idea? As suggested there, I saved the script with Unix end of line style.

Hi Charles.
First of all, to see that the capif registration was made successfully, you can access the mongodb express portal in localhost:8082 (or the IP of the machine hosting the CAPIF).
There, if the registration is successful, there will be a database named “capif”, then a table named “users” and inside you can see the info of your netapp.

Concerning the second one, have you create an empty folder “capif_onboarding” in your netapp?
If you see, in the dummy netapp, inside the python container, the certain empty folder exists.

Hi Stavros,

Ok, I will check.

Yes, I had created the capif_onboarding folder before, as shown in the file structure screenshot of my initial post. It is located at the same level of the Dockerfile, capif_registration and prepare.sh script.
The only difference with the initial screenshots is that I’m using /usr/src/app instead of ./ as path for the folder certificates in order to mimic the dummy netapp.

I started from scratch on my workstation and got the same result so far. Here is what the database looks like:

When clicking on the user collection:

Overall, no users collection and the infos about the netapp are not there. It seems that the registration/onboarding was not performed (no file created in the capif_onboarding folder, but I have the certificates on app/core/certificates/ on the NEF side).

Edit: I replaced the CMD command in the Dockerfile by a RUN command and the script is now called. However, I have a NewConnectionError as it could not find the capifcore host :

What I tried:

  1. Complete the /etc/hosts as shown in the dummy netapp. Got an error telling that the file system is read-only.
  2. Add an extra host directly in the docker-compose. Does not seems to do the trick.

I will investigate the n°1 as it looks like a permission issue (even if I already lauch commands in administrator mode).