Setup errors

Posted on
Wed Apr 29, 2020 6:26 pm
farberm offline
Posts: 393
Joined: Feb 24, 2008

Setup errors

Karl:

I cannot seems to get the plugin to connect to my two AP.... not sure what the issue is. The only system device created is the USG. I have defined the AP IP number in the config file.

Here is the error I am getting: 192.168.1.8 and 192.168.1.9 are the Ip# of my AP

uniFiAP check /Library/Application Support/Perceptive Automation/Indigo 7.4/Logs/com.karlwachs.uniFiAP/plugin.log <<<< for detailed logging
uniFiAP Plugin short Name UniFi
uniFiAP my PID 1328
uniFiAP set params for indigo V 7.4
Started plugin "uniFiAP 7.30.191"
uniFiAP testing if variable enableTimeTracking_UniFi is == on/off/print-option to enable/end/print time tracking of all functions and methods (option:'',calls,cumtime,pcalls,time)
uniFiAP myLogSet setting parameters -- logFileActive= indigo; logFile= /Library/Application Support/Perceptive Automation/Indigo 7.4/Logs/com.karlwachs.uniFiAP/plugin.log; debugLevel= ['all']
uniFiAP start runConcurrentThread, initializing loop settings and threads ..
uniFiAP initialized ... looping
uniFiAP Warning getMessages: ListenProcess started for uType: GWtail; ip: 192.168.1.1 pid:1533
uniFiAP Warning getMessages: ListenProcess started for uType: GWdict; ip: 192.168.1.1 pid:1537
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.8 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.8 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.9 wrong ip/ password or system down or ssh timed out or ..?
uniFiAP Error getMessages: (1) error connecting to ip#: 192.168.1.9 wrong ip/ password or system down or ssh timed out or ..?



Thanks for all your help in advance. I made some ip changes to my UAP but they are working and provisioned correctly.

I have a simple set-up with 4 components

Cloudkey
UAP-AP-Pro - 2 of them
USG

I have checked my passwords and I can ssh into all four devices with the correct password - all the same.

I did a complete reset by deleting the following
I have performed the following procedures and step to reset the system.
I have deleted the following files or folders:
1. Library/App Supp/Perc Automation/Prefs/Plugins/com.karlwachs... folder
2. Library/App Supp/Perc Auto/Prefs/com.karlwachs.uniFiap.indpref
3. Removed all old logs
4. Deleted the plugin, restarted computer and reinstalled plugin
5I did not find any other files anywhere....

Reinstalled the new plugin

My site id is default which I confirmed in the web address of the controller. .........https://192.168.1.7:8443/manage/site/de ... tings/site


I looked at the logfile and this is the error I see in it

20:26:44 testServerIfOK: ===========192.168.1.8 ssh response, tags ['welcome', 'unifi', 'debian', 'edge', 'busybox', 'ubiquiti', 'ubnt', 'login', 'BZ.v'] not found : ==>
spawn ssh farberm@192.168.1.8

the authenticity of host '192.168.1.8 (192.168.1.8)' can't be established.
rsa key fingerprint is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
are you sure you want to continue connecting (yes/no/[fingerprint])?
2020-04-29 20:26:44.341 ERROR Plugin.getMessages getMessages: (1) error connecting to ip#: 192.168.1.8 wrong ip/ password or system down or ssh timed out or ..?
20:26:44 testServerIfOK: ===========192.168.1.8 ssh response, tags ['welcome', 'unifi', 'debian', 'edge', 'busybox', 'ubiquiti', 'ubnt', 'login', 'BZ.v'] not found : ==>
spawn ssh farberm@192.168.1.8

the authenticity of host '192.168.1.8 (192.168.1.8)' can't be established.
rsa key fingerprint is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
are you sure you want to continue connecting (yes/no/[fingerprint])?
2020-04-29 20:26:44.351 ERROR Plugin.getMessages getMessages: (1) error connecting to ip#: 192.168.1.8 wrong ip/ password or system down or ssh timed out or ..?
20:26:45 testServerIfOK: ===========192.168.1.9 ssh response, tags ['welcome', 'unifi', 'debian', 'edge', 'busybox', 'ubiquiti', 'ubnt', 'login', 'BZ.v'] not found : ==>
spawn ssh farberm@192.168.1.9

the authenticity of host '192.168.1.9 (192.168.1.9)' can't be established.
rsa key fingerprint is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
are you sure you want to continue connecting (yes/no/[fingerprint])?
2020-04-29 20:26:45.758 ERROR Plugin.getMessages getMessages: (1) error connecting to ip#: 192.168.1.9 wrong ip/ password or system down or ssh timed out or ..?
20:26:46 testServerIfOK: ===========192.168.1.9 ssh response, tags ['welcome', 'unifi', 'debian', 'edge', 'busybox', 'ubiquiti', 'ubnt', 'login', 'BZ.v'] not found : ==>
spawn ssh farberm@192.168.1.9

the authenticity of host '192.168.1.9 (192.168.1.9)' can't be established.
rsa key fingerprint is XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
are you sure you want to continue connecting (yes/no/[fingerprint])?
2020-04-29 20:26:46.991 ERROR Plugin.getMessages getMessages: (1) error connecting to ip#: 192.168.1.9 wrong ip/ password or system down or ssh timed out or ..?

I obviously deleted the actual key and inserted " XXXXXXXX"
Is this an error with the plugin or a problem with my setup not authenticating???

Posted on
Wed Apr 29, 2020 7:48 pm
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: Setup errors

Karl:

I have SSH authentication enables under theSite Device authentication section. But no SSH keys there. Is this causing the issue?
Attachments
Screen Shot 2020-04-29 at 9.44.47 PM.png
Screen Shot 2020-04-29 at 9.44.47 PM.png (49.74 KiB) Viewed 3168 times

Posted on
Thu Apr 30, 2020 1:17 pm
farberm offline
Posts: 393
Joined: Feb 24, 2008

Re: Setup errors

Karl and/or others:

I was able to get the login errors to resolve for the AP devices by resetting my username and password to something completely different on my Controller and cloudkey via new superadmin.

After resetting them I can ssh into all four devices GW, controller and both APs.

The only issue now is that I get a controller login error even though the un and pw I use I can use terminal and ssh into without an issue?

uniFiAP Error UNIFI executeCMDOnController error: (wrong UID/passwd, ip number?192.168.1.7) ...>>{"meta":{"rc":"error","msg":"api.err.LoginRequired"},"data":[]}<<
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 129 100 63 100 66 139 146 --:--:-- --:--:-- --:--:-- 286


Did I miss another place to change passwords?

I reset them by -
1. Logging into https://192.168.1.7:8443/manage/site/de ... gs/admin-->change PW
2. Logging into https://192.168.1.7:8443/manage/site/de ... ngs/site-->change SSH authorization
2. Logging into https://192.168.1.7/login/maintenance -->change password

I then rebooted the Cloudkey and rebooted the USG. This should restart the controller.

Is there any other place to change things to get the controller setting correct? (I have double checked the setting in the unifiAP plugin and they are correct I am sure.)?

Posted on
Wed May 06, 2020 12:52 pm
MartinG offline
Posts: 116
Joined: Aug 19, 2016

Re: Setup errors

I'm seeing the same set of errors (and some others), despite having confirmed the correctness of the username/password login details:

Code: Select all
 uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.9 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.3 wrong ip/ password or system down or ssh timed out or ..?

6 May 2020 at 19:50:39
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.5 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.6 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.5 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.6 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.8 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.8 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.9 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.9 wrong ip/ password or system down or ssh timed out or ..?
   uniFiAP Error                   getMessages: (1)  error connecting to ip#: 192.168.1.3 wrong ip/ password or system down or ssh timed out or ..?

6 May 2020 at 19:51:04
   uniFiAP Error                   UNIFI executeCMDOnController error: (wrong UID/passwd, ip number?192.168.1.109) ...>>{ "data" : [ ] , "meta" : { "msg" : "api.err.LoginRequired" , "rc" : "error"}}<<
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   148  100    78  100    70    876    786 --:--:-- --:--:-- --:--:--  1662


I can manually access each AP (192.168.1.5, .6, .8 & .9) via ssh using the same login credentials, so that definitely works.

Posted on
Thu May 07, 2020 6:39 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Setup errors

could you switch on expect debug and connect debug in config,
then check the plugin.log file (*)
there you should find the commands used something like:
Code: Select all
 /usr/bin/expect   '/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/dictLoop.exp' 'userid' 'passwd' 192.168.1.19 US.v xxxThisIsTheEndTokenxxx 120 40 "mca-dump | sed -e 's/^ *//'"   doNotSendAliveMessage
and
/usr/bin/expect   '/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/execLog.exp' 'userid' 'passwd' 192.168.1.1 :~ "/usr/bin/tail -F /var/log/messages"


could you copy , open terminal, paste that command (must be on the indigo server)
if it does not work you should see some error messages


Karl
*)/Library/Application Support/Perceptive Automation/Indigo 7.4/Logs/com.karlwachs.uniFiAP/plugin.log

Posted on
Thu May 07, 2020 8:01 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Setup errors

published v .216 that gives more logging info incase ssh does not work
and added UDM improvements (not yet 100% right, but much better)

Karl

Posted on
Sat May 23, 2020 8:53 am
MartinG offline
Posts: 116
Joined: Aug 19, 2016

Re: Setup errors

Hi Karl,

Took me a while to get to this, but having extracted the line you suggested from the log, here's what I got:

Code: Select all
>/usr/bin/expect '/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/uniFiAP.indigoPlugin/Contents/Server Plugin/test.exp' 'username' 'passw0rd' 192.168.1.5
spawn ssh admin@192.168.1.5
The authenticity of host '192.168.1.5 (192.168.1.5)' can't be established.
RSA key fingerprint is SHA256:+tzfRknbpxJCni635es4P4Kq0PA/u+InyDJ6t4NT9zk.
Are you sure you want to continue connecting (yes/no/[fingerprint])?


Then nothing for while, until it returns to the command prompt.

Looking at plugin.log, I see a little more:

Code: Select all
15:45:14 testServerIfOK: ===========192.168.1.5  ssh response, tags ['welcome', 'unifi', 'debian', 'edge', 'busybox', 'ubiquiti', 'ubnt', 'login', 'BZ.v'] not found : ==>
spawn ssh admin@192.168.1.5

the authenticity of host '192.168.1.5 (192.168.1.5)' can't be established.
rsa key fingerprint is sha256:+tzfrknbpxjcni635es4p4kq0pa/u+inydj6t4nt9zk.
are you sure you want to continue connecting (yes/no/[fingerprint])?
2020-05-23 15:45:14.392   ERROR          Plugin.getMessages               getMessages: (1 - test connect)  error for APtail, ip#: 192.168.1.5 wrong ip/ password or system down or ssh timed out or ..?

Posted on
Sat May 23, 2020 9:30 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Setup errors

your prompt is different:
(yes/no/[fingerprint])?
I only get
(yes/no)?

have seen this also w pibeacon, it seems that for some OS X the ssh connect prompt has changed.

added that in v 7.30.242, just posted

Karl

record: 4 releases in 15 minutes :(

Posted on
Mon May 25, 2020 1:23 pm
MartinG offline
Posts: 116
Joined: Aug 19, 2016

Re: Setup errors

That made a difference - thanks. I've now got a (mostly) functional plugin.

I am seeing the following (new) errors though. (I've blanked the username & password, though there were correct for controller login).


Code: Select all
25 May 2020 at 20:15:06
   uniFiAP Error                   UNIFI executeCMDOnController  login cmd:/usr/bin/curl --insecure -c /tmp/unifiCookie -H "Content-Type: application/json" --data '{"username": "xxxxxxx", "strict": true, "password": "pppppppppp"}' 'https://192.168.1.109:8443/api/s/'
gives  error: { "data" : [ ] , "meta" : { "msg" : "api.err.LoginRequired" , "rc" : "error"}}
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   148  100    78  100    70    951    853 --:--:-- --:--:-- --:--:--  1804

Posted on
Mon May 25, 2020 2:30 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Setup errors

your login web parameter is wrong >> 'https://192.168.1.109:8443/api/s/'

change in config it is NOT /api/s

but either
/api/login
or
/api/auth/login
depending on your controller
please use the latest version and click on set parameters. that should set the things correctly IF YOU HAVE SELECTED THE RIGHT controller

api/s is the web page after login, where the plugin gets the data .

Karl

and ps PLEASE look at https://forums.indigodomo.com/viewforum.php?f=199
In the announcement section are the docs that go through the details of configuration and especially this item too.

Posted on
Tue May 26, 2020 2:04 am
MartinG offline
Posts: 116
Joined: Aug 19, 2016

Re: Setup errors

Making progress... at least, I'm seeing a different error message now. I've read all the announcements and how-to posts, and I think I'm configured correctly according to my controller type (I'm using the MacOS-based controller, running on the same machine as Indigo)

I see one mention of disabling 2FA, but I can't find an option to do this, either in the plugin config, or in the Unifi controller. I'm not using any of the UniFi cloud-based services.

This is what I see, every 3 minutes, which is the period I have the plugin set to retrieve (un)blocked client info.

Code: Select all
26 May 2020 at 09:01:53
   uniFiAP Error                   in Line 4154 has error=HTTPSConnectionPool(host='192.168.1.109', port=8433): Max retries exceeded with url: /api/login (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10836ff10>: Failed to establish a new connection: [Errno 61] Connection refused',))   Connection
Attachments
Screenshot 2020-05-26 at 08.59.42.png
Screenshot 2020-05-26 at 08.59.42.png (227.15 KiB) Viewed 2818 times

Posted on
Tue May 26, 2020 8:34 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Setup errors

your config looks ok.

could you switch from python requests to curl and switch on debug "(6)connection" at the bottom of top section in config

you then should see some curl statements in plugin.log

... curl --insecure -c /tmp/unifiCookie -H \"Content-Type: application/json\" --data ...
and
... curl --insecure -b /tmp/unifiCookie ...

post those and the surrounding lines w password xxxed

Karl

Posted on
Tue May 26, 2020 9:50 am
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Setup errors

ps: which OS X version are you using. "el capitan" or older might not work with python requests. the ssl libs are too old. There you must use curl

Karl

Posted on
Tue May 26, 2020 10:47 am
MartinG offline
Posts: 116
Joined: Aug 19, 2016

Re: Setup errors

Pasted below.
There are no "curl -b"s in plugin.log at all
This is running on 10.15.4

Code: Select all
17:39:38 Connection: /usr/bin/curl --insecure -c /tmp/unifiCookie -H "Content-Type: application/json" --data '{"username": "myusername", "strict": false, "password": "xxxxxx"}' 'https://192.168.1.109:8433/api/login'
2020-05-26 17:39:38.643   ERROR          Plugin.executeCMDOnController    UNIFI executeCMDOnController error no json object: (wrong UID/passwd, ip number?192.168.1.109) ...>><<
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to 192.168.1.109 port 8433: Connection refused

17:40:02 Connection: /usr/bin/curl --insecure -c /tmp/unifiCookie -H "Content-Type: application/json" --data '{"username": "myusername", "strict": false, "password": "xxxxxx"}' 'https://192.168.1.109:8433/api/login'
2020-05-26 17:40:02.719   ERROR          Plugin.executeCMDOnController    UNIFI executeCMDOnController error no json object: (wrong UID/passwd, ip number?192.168.1.109) ...>><<
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to 192.168.1.109 port 8433: Connection refused

17:40:14 getMessage: APtail 192.168.1.5 ThisIsTheAliveTestFromUnifiToPlugin received
17:40:16 getMessage: APtail 192.168.1.6 ThisIsTheAliveTestFromUnifiToPlugin received
17:40:18 getMessage: APtail 192.168.1.8 ThisIsTheAliveTestFromUnifiToPlugin received
17:40:21 getMessage: APtail 192.168.1.9 ThisIsTheAliveTestFromUnifiToPlugin received
17:41:15 getMessage: APtail 192.168.1.5 ThisIsTheAliveTestFromUnifiToPlugin received
17:41:17 getMessage: APtail 192.168.1.6 ThisIsTheAliveTestFromUnifiToPlugin received
17:41:19 getMessage: APtail 192.168.1.8 ThisIsTheAliveTestFromUnifiToPlugin received
17:41:22 getMessage: APtail 192.168.1.9 ThisIsTheAliveTestFromUnifiToPlugin received
17:42:05 Connection: /usr/bin/curl --insecure -c /tmp/unifiCookie -H "Content-Type: application/json" --data '{"username": "myusername", "strict": false, "password": "xxxxxx"}' 'https://192.168.1.109:8433/api/login'
2020-05-26 17:42:05.188   ERROR          Plugin.executeCMDOnController    UNIFI executeCMDOnController error no json object: (wrong UID/passwd, ip number?192.168.1.109) ...>><<
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to 192.168.1.109 port 8433: Connection refused

Posted on
Tue May 26, 2020 1:47 pm
kw123 offline
User avatar
Posts: 8360
Joined: May 12, 2013
Location: Dallas, TX

Re: Setup errors

Code: Select all
/usr/bin/curl --insecure -c /tmp/unifiCookie -H "Content-Type: application/json" --data '{"username": "myusername", "strict": false, "password": "xxxxxx"}' 'https://192.168.1.109:8433/api/login'


is the correct command if your ip# and port numbers are correct.

1. could you past above command into a terminal window (with your uid and password ) and paste response
( try "strict": true although that is likely not the issue, you can drop that part if it is not ,"strict":true)
2. then can you login w chrome to
192.168.1.109:8433
192.168.1.109:8433/api/login
?

Karl

Who is online

Users browsing this forum: No registered users and 3 guests