Problem during auto-registration

88 views
Skip to first unread message

matteo fedeli

unread,
Aug 7, 2019, 2:58:32 PM8/7/19
to OpenWISP
Hi, I trying to connect my openwrt AP (18.06.4) to my production server but i get registration failed:

logread -f | grep wisp
Wed Aug  7 20:51:51 2019 daemon.info openwisp: OpenWISP config agent started
Wed Aug  7 20:51:51 2019 daemon.info openwisp: Registering device...
Wed Aug  7 20:51:52 2019 daemon.err openwisp: Registration failed! }

 this is my conf

config controller 'http'
        option url 'https://openwisp.planet.bn'
        option verify_ssl '0'
        option shared_secret 'LtmFYB7mLszBMlwkaP2hsVOlIGcKfXvB'
        option uuid ''
        option key ''
        list unmanaged 'system.@led'
        list unmanaged 'network.loopback'
        list unmanaged 'network.@switch'
        list unmanaged 'network.@switch_vlan'

What's the matter for you?

Ajay Tripathi

unread,
Aug 7, 2019, 3:10:07 PM8/7/19
to OpenWISP
Hi,
 
Wed Aug  7 20:51:52 2019 daemon.err openwisp: Registration failed! }

Interesting error.
Usually, it gives a error message after "Registration failed!", your output says only "}" which looks odd to me.
I am not sure what it means so I'll defer for someone else to have a look at this, but meanwhile, 
1. Can you please crosscheck if it is "}" in the output only.
2. Can you also please crosscheck the basic networking issues like some firewall or bad connection. 


Thanks,
Ajay Tripathi

henriqsc

unread,
Aug 7, 2019, 3:41:35 PM8/7/19
to OpenWISP
Hello

Is that a previously registered device? I had some issues with that and the soulution  we came up was to delete the device from Openwisp and register it again.

matteo fedeli

unread,
Aug 7, 2019, 3:45:31 PM8/7/19
to OpenWISP
I alredy do ping and nslookup in both direction and work coorectly. Should I do other test/check?


Message has been deleted

matteo fedeli

unread,
Aug 7, 2019, 3:49:14 PM8/7/19
to OpenWISP
I try more than one time but it isn't. Is not previously registered

Oliver Kraitschy

unread,
Aug 8, 2019, 1:08:48 AM8/8/19
to open...@googlegroups.com
On Wed, Aug 07, 2019 at 11:58:32AM -0700, matteo fedeli wrote:
> Hi, I trying to connect my openwrt AP (18.06.4) to my production server but
> i get registration failed:
>
> logread -f | grep wisp
> > Wed Aug 7 20:51:51 2019 daemon.info openwisp: OpenWISP config agent
> > started
> > Wed Aug 7 20:51:51 2019 daemon.info openwisp: Registering device...
> > Wed Aug 7 20:51:52 2019 daemon.err openwisp: Registration failed! }

Hi Matteo,

I recently had the problem that registration failed because some
registration parameter was not valid - in my case it was a hostname with a
'_' in it.

Check /tmp/openwisp/registration_parameters for the registration
parameters.

Greetings,
Oliver

matteo fedeli

unread,
Aug 11, 2019, 8:13:17 PM8/11/19
to OpenWISP
HTTP/1.1 400 Bad Request
Server: nginx/1.14.0 (Ubuntu)
Date: Wed, 07 Aug 2019 18:25:10 GMT
Content-Type: text/plain
Content-Length: 164
Connection: keep-alive
X-Openwisp-Controller: true
X-Frame-Options: SAMEORIGIN

{
    "mac_address": [
        "Device with this Mac address already exists."
    ]
}

Why? it isn't true! My domain is openwisp.planet.bn it's a reserved word?

Oliver Kraitschy

unread,
Aug 12, 2019, 12:59:43 AM8/12/19
to open...@googlegroups.com
On Sun, Aug 11, 2019 at 05:13:16PM -0700, matteo fedeli wrote:
> HTTP/1.1 400 Bad Request
> Server: nginx/1.14.0 (Ubuntu)
> Date: Wed, 07 Aug 2019 18:25:10 GMT
> Content-Type: text/plain
> Content-Length: 164
> Connection: keep-alive
> X-Openwisp-Controller: true
> X-Frame-Options: SAMEORIGIN
>
> {
> "mac_address": [
> "Device with this Mac address already exists."
> ]
> }
>
> Why? it isn't true! My domain is openwisp.planet.bn it's a reserved word?

Hello Matteo,

the error message is about the mac address, not about the hostname. Please
check if your device / the mac address of your device doesn't already
exist on the OpenWISP server.

Greetings,
Oliver

matteo fedeli

unread,
Aug 12, 2019, 9:51:25 AM8/12/19
to OpenWISP
In the device section there isn't anyone AP... It's empty.
Message has been deleted

henriqsc

unread,
Aug 12, 2019, 5:41:27 PM8/12/19
to OpenWISP
Have you checked under ORGANIZATIONS > YOUR ORGANIZATION > CONFIGURATION MANAGEMENT SETTINGS > Auto-registration enabled?

matteo fedeli

unread,
Aug 12, 2019, 5:47:05 PM8/12/19
to OpenWISP
I reinstalled all openwisp controller and the nossl config in my ap.

hosts

playbook.yml
- hosts: openwisp.planet.bn
  become: "{{ become | default('yes') }}"
  roles:
    - openwisp.openwisp2
  vars:
    openwisp2_network_topology: true
    openwisp2_default_from_email: "mym...@example.com"
  

cat /tmp/openwisp/registration_parameters
HTTP/1.1 400 Bad Request
Server: nginx/1.14.0 (Ubuntu)
Date: Mon, 12 Aug 2019 21:36:06 GMT
Content-Type: text/plain
Content-Length: 81

Connection: keep-alive
X-Openwisp-Controller: true
X-Frame-Options: SAMEORIGIN

{
    "name": [
        "Must be either a valid hostname or mac address."
    ]
}

This is my situation now... The auto-registration in my organization is enabled

matteo fedeli

unread,
Aug 12, 2019, 5:49:23 PM8/12/19
to OpenWISP
ap conf
config controller 'http'
option url 'https://openwisp.planet.bn/'
option verify_ssl '0'
option shared_secret 'ccGbrULI41UEpopcxqjiLklE3RHwSmp9'
option consistent_key '1'
option mac_interface 'eth0'
option uuid ''
option key ''
Message has been deleted

matteo fedeli

unread,
Aug 13, 2019, 7:45:04 AM8/13/19
to OpenWISP
This is the curl request
curl -s
--connect-timeout 15
--max-time 30 -k
--data backend=netjsonconfig.OpenWrt&key=5a9140a8e92ed6f168a818caaee09e05
--data-urlencode secret=ccGbrULI41UEpopcxqjiLklE3RHwSmp9 
--data-urlencode name=AP_CISCO
--data-urlencode hardware_id=
--data-urlencode mac_address=00:18:0A:6A:79:93
--data-urlencode tags=
--data-urlencode model=modelofdevice
--data-urlencode os=OpenWrt 18.06.4 r7808-ef686b7292
--data-urlencode system=Qualcomm Atheros QCA9558 ver 1 rev 0
-i https://openwisp.planet.bn/controller/register/ > /tmp/openwisp/registration_parameters

I also found a SYNTAX ERROR in /usr/sbin/openwisp_config: (line 138)
local tags=$(uci get openwisp.http.tags 2&> /dev/null)

2>&1 /dev/null or &> /dev/null ?

matteo fedeli

unread,
Aug 13, 2019, 6:11:12 PM8/13/19
to OpenWISP
Solved! The hostname of the ap was unrechable. Thanks to all
Reply all
Reply to author
Forward
0 new messages