Troubleshooting

These are some common issues that can occur while using the alwaysAI platform:

aai app deploy: ssh: Could not resolve hostname pi@raspberrypi: Name or service not known

Signature

$ aai app deploy
✔ Target configuration not found. Do you want to create it now? … yes
✔ What is the destination? › Remote device
✔ Found Dockerfile
✔ Please enter the hostname (with optional user name) to connect to your device via ssh (e.g. "pi@1.2.3.4"): … pi@raspberrypi
⚠ Connect by SSH
Process exited with non-zero status code 255

$ ssh -i /home/eric/.ssh/alwaysai.id_rsa -o BatchMode=yes -o StrictHostKeyChecking=no pi@raspberrypi echo

ssh: Could not resolve hostname pi@raspberrypi: Name or service not known

Cannot connect to your device. Please check the address and try again.
? Please enter the hostname (with optional user name) to connect to your device via ssh (e.g. "pi@1.2.3.4"):

Causes and Fixes

There are many reasons your device might not be findable by the CLI. The simplest reason is that the hostname or IP address could be wrong. Double check that it is entered correctly. Our Raspberry Pi OS image comes with mDNS installed so you could try adding “.local” to your hostname (e.g. pi@raspberrypi.local).

Another possibility is that the device is not connected to the same network as your development computer. Our Raspberry Pi OS image starts WiFi-Connect when the device can’t connect to a network, which makes it easy to connect your device to the WiFi network of your choice.

no permission to read from ‘/home/pi/alwaysai/realtime_object_detector/core’

Signature

“$ docker build --quiet .
error checking context: ‘no permission to read from ‘/home/pi/alwaysai/realtime_object_detector/core’’.”

Cause

There is a file in the target app directory that can’t be loaded by docker, likely due to a permissions issue. This is often called by using to exit an app using an NCS as the accelerator, as this tends to generate a core file owned by root.

Fix

To get the Docker build to succeed, you’ll need to delete the core file on the target device. running aai app exec rm -rf core --superuser may work, but you might need to SSH directly onto the device and manually delete the file. To prevent core dumps, close your app using the “stop” button on the Streamer, or another method of cleanly exiting your app.

RuntimeError: Model alwaysai/mobilenet_ssd not installed!

Cause

A model used in your app.py is not installed using the CLI. It may not be added as an app dependency, or simply not deployed to the device.

Fix

First, check your app config using aai app show. If there aren’t any models added to your app, the output will look like this:

$ aai app show
Models: None

Scripts:
  start => "python app.py"

Target: docker container on this host

To add a model, go to the alwaysAI Model Catalog, pick out your model, and follow the instructions to add the model to your app.

If the model is added your config might look like this:

$ aai app show
Models:
  alwaysai/mobilenet_ssd@4

Scripts:
  start => "python app.py"

Target: docker container on this host

This means that you added to model using the CLI, but you haven’t run aai app deploy after to deploy the model to the target device.

python: error while loading shared libraries: libpython3.5m.so.1.0

Signature

python: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

Cause

A virtualenv exists in the app directory that was built with a different edgeIQ version.

Fix

Linux local/remote, Mac remote, Windows remote

$ aai app exec rm -rf venv
$ aai app deploy

Windows Local

Delete the venv directory and run:

$ aai app deploy

OSError: [Errno 98] Address already in use

Cause

The Streamer can’t bind to it’s default port due to another connection occupying the port.

Fix

This is most often caused by another alwaysAI app that has been left running, and the simplest solution is to reboot the target device. It could also be caused by a connection to the same port on your development machine. Rebooting your development machine may also help.

Switch between running locally and remotely on Windows

On Windows, there are two options for running your app, running natively on Windows using

$ aai app install
$ aai app start

And running on a target device using

$ aai app deploy
$ aai app start

However, once you run aai app deploy the aai app start command will only start the app on the remote device. This is due to aai app deploy creating the alwaysai.target.json file. In order to run locally again on Windows, you must delete the alwaysai.target.json in your app directory and then run aai app start.

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Signature

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Cause

The current user doesn’t have rights to run the Docker daemon.

Fix

Add the current user to the docker group:

sudo usermod -aG docker $USER

Can not init USB device: NC_ERROR in function ‘initPlugin’

Signature

E: [ncAPI] ncDeviceOpen:672 Failed to find suitable device, rc: X_LINK_DEVICE_NOT_FOUND

cv2.error: OpenCV(4.1.1-openvino) /opencv-build/build/opencv-4.1.1-openvino/modules/dnn/src/op_inf_engine.cpp:477: error: (-215:Assertion failed) Failed to initialize Inference Engine backend: Can not init USB device: NC_ERROR in function 'initPlugin'

Cause

This error occurs when your app is set up to use the DNN_OPENVINO engine and a MYRIAD device can’t be found. This could happen is an NCS device is not plugged in.

Fix

In most cases, the fix is to just plug in or unplug and replug your NCS device. In other cases this could be due to USB driver issues and would require further debugging.

App prints “This is a stub of an alwaysAI application”

Signature

$ aai app start
This is a stub of an alwaysAI application

Cause

This happens when you run an empty alwaysAI application. When you run aai app configure in a directory without an alwaysAI app, it creates this empty application to get you started. However, this can also happen when you run the aai commands in an unexpected directory.

Fix

Either start writing your app, or figure out if you ran the commands in the wrong directory. If you don’t know how to get started, head back to the dashboard for instructions on running the “hello world” app.