Scheduled maintenance: Community will be offline Monday June 17th, 1:00 AM - 6:00 AM (PT)
Reply
New Member
Posts: 30
Registered: ‎10-16-2013
Kudos: 8
Solutions: 1
Accepted Solution

Problem connecting server to cloud

I had some problem with my server. Ended up uninstalling it with autoremove and then installing it again. It is on Ubuntu 14.04 LTS. After this last installation it finally started working. I set everything up again, had to reset the AP's and adopt them but that's OK, there are only few. Only thing that doesn't work is connecting the server to the cloud. This is the error I see in unifi/server.log:

[2017-07-06 13:49:31,983]  WARN  sdn    - failed to authenticate to sdn: sun.security.validator.ValidatorException: No trusted certificate found
[2017-07-06 13:49:31,983]  INFO  api    - [api] api.err.UbicUnreachable: /api/s/default/cmd/sdn

I'm not sure if it is trying to connect to ubnt or something else or if the certificate needs renewing.
Any ideas?

Accepted Solutions
New Member
Posts: 30
Registered: ‎10-16-2013
Kudos: 8
Solutions: 1

Re: Problem connecting server to cloud

[ Edited ]

A little update. I googled some more and found a way to see the keystore for java. Found out that it was empty. 

This is the solution I found:

$ sudo dpkg --purge --force-depends ca-certificates-java
$ sudo apt-get install ca-certificates-java

 First line cleans out the certificates if I understand it right. Second line install the certificates. Did that and rebooted the server, maybe it would have been enough to restart unifi service but I didn't think of that... getting VERY late here. Anyway, after reboot, everything works fine and I could connect the server to the cloud.

View solution in original post


All Replies
SuperUser
Posts: 20,402
Registered: ‎09-17-2013
Kudos: 5145
Solutions: 1458

Re: Problem connecting server to cloud

check for / apply updates to the server perhaps?

New Member
Posts: 30
Registered: ‎10-16-2013
Kudos: 8
Solutions: 1

Re: Problem connecting server to cloud

I've tried apt-get update and apt-get upgrade. When I try apt-get install unifi (to try to update it) it says it is already the latest update, which is righ, it is 5.4.18 (Build: atag_5.4.18_9252).

But when I go into settings and maintenance and click on Check for firmware update this comes in the server.log:

<webapi-10> WARN  system - failed to get firmware update info: sun.security.validator.ValidatorException: No trusted certificate found

And when I try connecting the server to the cloud, this comes in server.log:

<webapi-157> WARN  sdn    - failed to authenticate to sdn: sun.security.validator.ValidatorException: No trusted certificate found

Any ideas?

 

New Member
Posts: 30
Registered: ‎10-16-2013
Kudos: 8
Solutions: 1

Re: Problem connecting server to cloud

I tried sudo apt-get autoremove unifi. Then apt-get update and apt-get upgrade. Removed the GPG key. Added it again. apt-get install unifi again. Everything works and it asks if I have a backup, I say yes and server is up. I log in an everything is like it was before, sites and everything. Also my problem, still there. What I didn't do was to delete everything relate to unifi. Maybe I need to do that? Just find it weird if this is not fixable without completely wiping everything off and start from scratch.

New Member
Posts: 30
Registered: ‎10-16-2013
Kudos: 8
Solutions: 1

Re: Problem connecting server to cloud

[ Edited ]

A little update. I googled some more and found a way to see the keystore for java. Found out that it was empty. 

This is the solution I found:

$ sudo dpkg --purge --force-depends ca-certificates-java
$ sudo apt-get install ca-certificates-java

 First line cleans out the certificates if I understand it right. Second line install the certificates. Did that and rebooted the server, maybe it would have been enough to restart unifi service but I didn't think of that... getting VERY late here. Anyway, after reboot, everything works fine and I could connect the server to the cloud.

New Member
Posts: 1
Registered: ‎07-08-2018
Kudos: 1

Re: Problem connecting server to cloud

Thank you, thank you, thank you! Several days of troubleshooting and you found the problem. Following your steps to clear/update the java cert store fixed cloud access for me. The error I was getting is:

"There was an error registering credentials. Unable to connect to UniFi cloud. Please check your network connection, and try again." I performed the steps in your post on my controller, which is running on a raspberry pi 3/raspbian stretch lite.

 

New Member
Posts: 1
Registered: ‎10-19-2017

Re: Problem connecting server to cloud

Thank you, Thank you, Thank you!!!!

I no longer have any hair because I've pulled it all out.  Your solution worked great!


@OdinnBH wrote:

A little update. I googled some more and found a way to see the keystore for java. Found out that it was empty. 

This is the solution I found:

$ sudo dpkg --purge --force-depends ca-certificates-java
$ sudo apt-get install ca-certificates-java

 First line cleans out the certificates if I understand it right. Second line install the certificates. Did that and rebooted the server, maybe it would have been enough to restart unifi service but I didn't think of that... getting VERY late here. Anyway, after reboot, everything works fine and I could connect the server to the cloud.


 

New Member
Posts: 2
Registered: ‎08-24-2018

Re: Problem connecting server to cloud

[ Edited ]

Thanks for this @OdinnBH! Only set up my network yesterday and been struggling on connecting to the Cloud Access and a few other minor things I noticed, after various attempts at port opening, etc. and finally looking through the logs I came across this. Perfect!

New Member
Posts: 3
Registered: ‎07-06-2018

Re: Problem connecting server to cloud

[ Edited ]

Thank You So Much!!! This has been beating me since I upgraded to Controller version 5.10.17. This was exactly what I needed!


@OdinnBH wrote:

A little update. I googled some more and found a way to see the keystore for java. Found out that it was empty. 

This is the solution I found:

$ sudo dpkg --purge --force-depends ca-certificates-java
$ sudo apt-get install ca-certificates-java

 First line cleans out the certificates if I understand it right. Second line install the certificates. Did that and rebooted the server, maybe it would have been enough to restart unifi service but I didn't think of that... getting VERY late here. Anyway, after reboot, everything works fine and I could connect the server to the cloud.


Emerging Member
Posts: 84
Registered: ‎12-04-2018
Kudos: 9
Solutions: 5

Re: Problem connecting server to cloud

I know this is an old post, but just thought I would share that this fixed my issue when I had a similar problem.

 

[2019-04-14T17:45:31,320] <webapi-737> INFO  api    - [api] api.err.UbicUnreachable: /api/s/oywn0ckm/cmd/cloudaccess
[2019-04-14T17:46:17,288] <webapi-740> INFO  api    - [api] api.err.UbicUnreachable: /api/s/oywn0ckm/cmd/cloudaccess
[2019-04-14T17:49:17,269] <webapi-755> INFO  api    - [api] api.err.UbicUnreachable: /api/s/oywn0ckm/cmd/cloudaccess

 

That was in my logs, along with:

 

	at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:450) ~[?:1.8.0_201]
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1621) ~[?:1.8.0_201]
	at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200) ~[?:1.8.0_201]
	at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120) ~[?:1.8.0_201]
	at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104) ~[?:1.8.0_201]
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1621) ~[?:1.8.0_201]
[2019-04-13T16:42:01,358] <check-iot-certificate> WARN  sdn    - failed to get connectivity details: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
	at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:450) ~[?:1.8.0_201]
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1621) ~[?:1.8.0_201]
	at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200) ~[?:1.8.0_201]
	at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120) ~[?:1.8.0_201]
	at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104) ~[?:1.8.0_201]
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1621) ~[?:1.8.0_201]
[2019-04-14T16:42:01,249] <check-iot-certificate> WARN  sdn    - failed to get connectivity details: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

and i'm running 5.10.20

Senior Member
Posts: 25,949
Registered: ‎08-04-2017
Kudos: 4866
Solutions: 1287

Re: Problem connecting server to cloud

Hello @swwifty,

 

Take a backup of your controller, than reinstall JAVA 8 64 bit.

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
Emerging Member
Posts: 84
Registered: ‎12-04-2018
Kudos: 9
Solutions: 5

Re: Problem connecting server to cloud


@AmazedMender16 wrote:

Hello @swwifty,

 

Take a backup of your controller, than reinstall JAVA 8 64 bit.

 

 

Regards,

Glenn R.


Sorry if I wasn't clear, but reinstalling the java certs fixed this for me.

Senior Member
Posts: 25,949
Registered: ‎08-04-2017
Kudos: 4866
Solutions: 1287

Re: Problem connecting server to cloud

Hello @swwifty,

 

I’m sorry for the confusion, glad it resolved your issues.

 

 

Regards,

Glenn R.

Cloud Hosted Controllers | Glenn R. | UniFi Installation/Easy Update Scripts | UniFi-Video Installation Scripts | UniFi-VoIP Installation Scripts
USG-XG-8 • USG-4-PRO • USG
US-XG-16 • US-48-500W • US-24-POE-250W 2x • US-16-POE-150W 3x • US-24 • US-8-150W • US-8
UAP XG • UAP-SHD • UAP-HD • UAP-NanoHD 2x • UAP-AC-PRO 2x • UAP-AC-LITE • UAP-AC-IW • UAP-AC-M • UAP-AC-M-PRO 2x
UAS-XG • UCK-G2-PLUS • UCK-G2 • UCK
Reply