Hi Yves, when this happens, you should verify what URL openwisp-config is trying to fetch and call the same curl command the agent is calling to see the result.
That response is coming from nginx, so nginx is replying 404, the reasons could be many: - URL is pointing to another server - Nginx is not finding the uwsgi application server and returning 404 This is how a good response looks like, you can try this command and see what you receive: curl -v -I "$(uci get openwisp.http.url)" > HEAD / HTTP/1.1 > Host: openwisp.******.com > User-Agent: curl/7.77.0 > Accept: */* > < HTTP/1.1 302 Found HTTP/1.1 302 Found < Server: nginx/1.18.0 (Ubuntu) Server: nginx/1.18.0 (Ubuntu) < Date: Mon, 19 Jul 2021 20:42:37 GMT Date: Mon, 19 Jul 2021 20:42:37 GMT < Content-Type: text/html; charset=utf-8 Content-Type: text/html; charset=utf-8 < Content-Length: 0 Content-Length: 0 < Connection: keep-alive Connection: keep-alive < Location: /admin/ Location: /admin/ < X-Frame-Options: DENY X-Frame-Options: DENY < Vary: Origin, Accept-Language Vary: Origin, Accept-Language < Content-Language: en Content-Language: en < X-Content-Type-Options: nosniff X-Content-Type-Options: nosniff < Referrer-Policy: same-origin Referrer-Policy: same-origin < Strict-Transport-Security: max-age=31536000 Strict-Transport-Security: max-age=31536000 < X-Content-Type-Options: nosniff X-Content-Type-Options: nosniff On Friday, July 16, 2021 at 10:27:56 AM UTC-5 [email protected] wrote: > > Hello, > > I've installed the openwisp agent on a router. And I've installed the > openwisp controller on a VirtualBox using the Ansible installation. Now > I've configured the agent to automatically register to the controller. But > the agent fails in connecting to the controller. Here is the end of the > `logread` command: > ``` > Tue Feb 16 16:42:00 2021 daemon.info openwisp: OpenWISP config agent > started > Tue Feb 16 16:42:00 2021 daemon.info openwisp: Registering device... > Tue Feb 16 16:42:01 2021 daemon.err openwisp: Invalid url: missing > X-Openwisp-Controller header > Tue Feb 16 16:42:01 2021 daemon.info procd: Instance > openwisp_config::instance1 s in a crash loop 7 crashes, 0 seconds since > last crash > ``` > > The agent complains the X-Openwisp-Controller header is missing. > > Here is the content of the registration_parameter file: > ``` > root@OpenWrt:~# cat /tmp/openwisp/registration_parameters > HTTP/1.1 404 Not Found > Server: nginx/1.14.2 > Date: Fri, 16 Jul 2021 14:48:06 GMT > Content-Type: text/html > Content-Length: 169 > Connection: keep-alive > > <html> > <head><title>404 Not Found</title></head> > <body bgcolor="white"> > <center><h1>404 Not Found</h1></center> > <hr><center>nginx/1.14.2</center> > </body> > </html> > > ``` > > It returns a 404 error. > > Does anyone have an idea? Is there any information on the controller side > I can use to solve this issue? > > Regards > Yves > > > > > > -- 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]. To view this discussion on the web, visit https://groups.google.com/d/msgid/openwisp/25f05512-960d-41cc-aa9a-d01424ab59d7n%40googlegroups.com.
