openwisp -> curl exit code 2

24 views
Skip to first unread message

Hugo Zárate

unread,
Dec 11, 2019, 5:10:36 PM12/11/19
to OpenWISP
Well, I'm trying to register a device but I got this error.
daemon.err openwisp: Failed to connect to controller during registration: curl exit code 2

This is my playbook configuration
- hosts: openwisp2
  become: "{{ become | default('yes') }}"
  roles:
    - openwisp.openwisp2
  vars:
    openwisp2_default_from_email: "hugo"
    shared_secret: "test"   

And my hosts file
[openwisp2]
localhost

And in my router (I'm using Openwrt) I have this
config controller 'http'
    option url -k 'https://localhost/'
    #option interval '120'
    option verify_ssl '0'
    option shared_secret 'test'
    #option consistent_key '1'
    #option mac_interface 'eth0'
    #option merge_config '1'
    #option test_config '1'
    #option test_script '/usr/sbin/mytest'
    option uuid ''
    option key ''
    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/ca-certificates.crt'
    # hooks
    #option pre_reload_hook '/usr/sbin/my_pre_reload_hook'

I really don't know how to fix it :c

Federico Capoano

unread,
Dec 12, 2019, 5:02:40 AM12/12/19
to OpenWISP
Hi Hugo,

CURLE_FAILED_INIT (2)

Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn't get done at init time.

I see something in your config that does not look correct:

On Wed, Dec 11, 2019 at 11:10 PM Hugo Zárate <hugo....@gmail.com> wrote:
And in my router (I'm using Openwrt) I have this
config controller 'http'
    option url -k 'https://localhost/'

The -k option does not make sense there, plus, unless the openwisp server is sitting on the router itself, having localhost will not work, you must use the ip or hostname where the openwisp server is reachable.

Should be something like:



Best regards
Federico

Hugo Zárate

unread,
Dec 12, 2019, 12:40:44 PM12/12/19
to OpenWISP
Thanks for your answer, I did everything you said, I removed "-k" in 'option url' and I changed 'localhost' to 'openwispnerd.com' and still not working
Now I have this error.
Failed to connect to controller during registration: curl exit code 6
I also tried with an IP address but I had the same error.
If I go to https://openwispnerd.com/admin/ works perfectly but I can't register my device (I'm using a Linksys EA6350)
What am I doing wrong?

Federico Capoano

unread,
Dec 12, 2019, 12:47:46 PM12/12/19
to OpenWISP
CURLE_COULDNT_RESOLVE_HOST (6)
Couldn't resolve host. The given remote host was not resolved.

Where is OpenWISP installed? Is installed online or in your LAN? Ensure you can reach the server from the router.
Ensure DNS resolution works fine.

--
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/27c6086b-24b2-45e3-a639-d0785c688d43%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages