Registration failed! - Hostname invalid

138 views
Skip to first unread message

Nilesh Agarwalla

unread,
Jan 14, 2021, 9:51:18 AM1/14/21
to OpenWISP
Hello,

I recently switched my home network to use 4x OpenWRT-based Access Points.  I have an Ubiquiti EdgeRouter that is configured to assign static IPs via DHCP to the access points.  I also have DNSmasq enabled so that I can do local hostname lookups.

I cannot get auto-registration to work using the local DNS hostname but using the MAC address directly works.

E.g. my access point is named: ap_master.agarwalla.local and has a local IP: 10.0.1.5

I can successfully do an nslookup of ap_master.agarwalla.local from the OpenWisp server:

nilesh@OpenWisp:~$ nslookup ap_master.agarwalla.local
Server:         10.0.1.1
Address:        10.0.1.1#53

Name:   ap_master.agarwalla.local
Address: 10.0.1.5
 
I installed and setup OpenWisp and also configured /etc/config/openwisp on the OpenWRT router:

config controller 'http'
option verify_ssl '0'
option uuid ''
option key ''
option shared_secret 'XXXX'


Auto-registration fails as follows:

root@ap_master:~# logread -f
Thu Jan 14 14:45:03 2021 daemon.info openwisp: Registering device...
Thu Jan 14 14:45:03 2021 daemon.err openwisp: Registration failed! {     "name": [         "Must be either a valid hostname or mac address."     ] }

Using the MAC address directly DOES work, though....but then I can't change the hostname via the web interface:
Screenshot 2021-01-14 094911.png

Any thoughts on how to get this all to work with the local DNS hostname?

Tnx!

Federico Capoano

unread,
Jan 14, 2021, 10:20:40 PM1/14/21
to OpenWISP
Dear Nitesh,

At the moment the validation rule does not allow dots, I am not sure this was intentional.
Using only "ap_master" as the hostname will work. Does this prevent you from deploying the configuration you need?

Best regards
Federico



--
You received this message because you are subscribed to the Google Groups "OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/08852d12-0bca-458d-9893-b5efbe6e06d4n%40googlegroups.com.

Nilesh Agarwalla

unread,
Jan 14, 2021, 11:31:13 PM1/14/21
to open...@googlegroups.com
Hi Federico,

The regex doesn’t seem to allow underscore ‘_’, so ‘ap_master’ didn’t work either, but ‘master’ did. 

You received this message because you are subscribed to a topic in the Google Groups "OpenWISP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openwisp/odjkLhfpQ7I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openwisp+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/CAERYH6VszdSbN%3D1MmaXh5YN24q4zq2Y4z99Yx3Fv20Wnp%2BRVcg%40mail.gmail.com.
--

--- ɥsǝlıu

Federico Capoano

unread,
Jan 16, 2021, 12:59:49 PM1/16/21
to OpenWISP
Sounds like a bug, I opened a bug report here: https://github.com/openwisp/openwisp-controller/issues/367

Thanks!
Federico

Reply all
Reply to author
Forward
0 new messages