I see. Glad you found out and fixed it.
I really hope we'll be able to fix this problem and ensure a good and easy 
to understand error message will be displayed in the log in the future.

Federico


On Thursday, November 16, 2017 at 11:07:49 AM UTC+1, Aarnav Bos wrote:
>
> There was no bug. Apparently a clone(with the same MAC addr) was already 
> registered and I was trying to register a duplicate. I figured this out 
> through the contents of /tmp/openwisp/registration_parameters. The  error 
> response was displayed quite clearly in the file. 
>
> content of /tmp/openwisp/registration_parameters:
>
> HTTP/1.1 400 Bad Request
> Server: nginx/1.10.3
> Date: Thu, 16 Nov 2017 09:18:59 GMT
> Content-Type: text/plain
> Content-Length: 85
> Connection: keep-alive
> X-Openwisp-Controller: true
> X-Frame-Options: SAMEORIGIN
>
> {
>     "mac_address": [
>         "Device with this Mac address already exists."
>     ]
> }
>
>
> On Thursday, November 16, 2017 at 3:53:18 AM UTC-5, Federico Capoano wrote:
>>
>> Hey Aarnav,
>>
>> It's unfortunate this is happening.
>> Same thing happened to me recently for an unexpected bug created during 
>> development and it was not easy to debug.
>>
>> The log line "openwisp: Registration failed! }" is a bug in logging 
>> failures which I described here: 
>> https://github.com/openwisp/openwisp-config/issues/42
>>
>> I have some questions for you that will help me to debug the problem:
>>
>> - I suppose you installed using ansible-openwisp2, could you show us your 
>> playbook.yml?
>> - run the playbook again to ensure the latest versions of the modules are 
>> installed
>> - in LEDE, after the registration fails, stop the openwisp_config deamon 
>> and run this command: cat /tmp/openwisp/registration_parameters, copy the 
>> output and paste it here please
>> - after the registration fails, is the configuration downloaded and 
>> applied anyway? You can find out if this happens by trying to change the 
>> name of the device in the openwisp2 web app, if the hostname is updated, 
>> this bug is happening: 
>> https://github.com/openwisp/openwisp-config/issues/43
>>
>> Thank you for your feedback.
>> Federico
>>
>>
>>
>>
>> On Thu, Nov 16, 2017 at 7:32 AM Aarnav Bos <[email protected]> wrote:
>>
>>> Excuse the spelling mistakes, it was typed out in haste.
>>>
>>>
>>> On Thursday, November 16, 2017 at 1:31:30 AM UTC-5, Aarnav Bos wrote:
>>>>
>>>> I was using openwisp_config to register my device to the controller. 
>>>> And the device registration fails.
>>>>
>>>> Some detail: 
>>>> Running openwisp2_config openssl version0.4.6a on LEDE 17.01
>>>> this is my /etc/config/openwisp
>>>>
>>>> config controller 'http'
>>>>     option url 'https://192.168.10.201'
>>>>     #option interval '120'
>>>>     option verify_ssl '0'
>>>>     option shared_secret 'wMQQmI4xyzc9ubo87WN9cme5TW4e89CG'
>>>>     #option consistent_key '0'
>>>>     option mac_interface 'eth0'
>>>>     #option merge_config '1'
>>>>     #option test_config '1'
>>>>     #option test_script '/usr/sbin/mytest'
>>>>     option uuid ''
>>>>     option key 'H4MJysbthCLrZ7OPlspvdnCURiB8D7su'
>>>>     list unmanaged 'system.@led'
>>>>     list unmanaged 'network.loopback'
>>>>     list unmanaged 'network.@switch'
>>>>     list unmanaged 'network.@switch_vlan'
>>>>     # curl options
>>>>     option connect_timeout '15'
>>>>     option max_time '30'
>>>>     #option capath '/etc/ssl/certs'
>>>>     option cacert '/etc/ssl/certs/server.crt'
>>>>     # hooks
>>>>     #option pre_reload_hook '/usr/sbin/my_pre_reload_hook'
>>>>
>>>>
>>>> after restarting the agent, my log provides this:
>>>>
>>>> Mon Nov 13 00:41:21 2017 daemon.info openwisp: OpenWISP config agent 
>>>> stopping
>>>> Mon Nov 13 00:41:21 2017 daemon.info openwisp: OpenWISP config agent 
>>>> started
>>>> Mon Nov 13 00:41:21 2017 daemon.info openwisp: Registering device...
>>>> Mon Nov 13 00:41:22 2017 daemon.err openwisp: Registration failed! }
>>>>
>>>>
>>>> And from the UWSGI log, the controlloer's response  to the POST request 
>>>> on /controler/register/ is an ERROR 400(Bad Request).
>>>>
>>>> Could someone point out a potential mistake in the config? 
>>>>
>>> -- 
>>> 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 [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to