Hi Juniper experts, I've a Juniper MX-80 running Junos 19.2R1.8 and I'm trying to use the REST-API calls.
It always returns a 500 Internal Server Error, even though the REST calls seem to be processed, in response to curl or REST API Explorer embedded calls. Sending the RPC via Netconf interface of the same underlying XML API works fine. I have enabled the set rest traceoptions flag all, but the /var/chroot/rest-api/var/log/lighttpd log (available below [2]) does not show much clues, at least for me. Since the Netconf way goes through, I assume the mgd process is fine and the problem is somewhere at lighttpd or mod_juise level. I've found similar issues with vSRX [1], but I don't know if the solution can follow the same path. Did anyone encounter this or could point towards further debugging? Regards, Rafael [1] https://community.juniper.net/communities/community-home/digestviewer/viewthread?MID=72012 [2] # curl http://a.b.c.d:3000/rpc/get-software-information -u "xxx:xxxx" -H "Content-Type: application/xml" -H "Accept: application/xml" <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>500 - Internal Server Error</title> </head> <body> <h1>500 - Internal Server Error</h1> </body> </html> % tail -n 20 /var/chroot/rest-api/var/log/lighttpd 2021-04-27 15:26:15: (../../../../../../src/dist/lighttpd/src/server.c.1412) server started (lighttpd/1.4.48) 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.736) mod_juise: connection_reset: 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.739) mod_juise: connection_reset: done 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1841) mod_juise: physical: fn /www/rpc/get-software-information 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1842) mod_juise: physical: uri /rpc/get-software-information 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1753) mod_juise: start: looking at /usr/sbin/juise 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1072) juise: argv: /usr/sbin/juise 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1072) juise: argv: --rpc-on-box 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1072) juise: argv: --auth-socket 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1072) juise: argv: /var/run/rest_api_mgmt_sock 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1072) juise: argv: --trace 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1072) juise: argv: /var/log/juise 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1072) juise: argv: /usr/sbin/juise 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.1945) mod_juise: handle: 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.736) mod_juise: connection_reset: 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.739) mod_juise: connection_reset: done 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.736) mod_juise: connection_reset: 2021-04-27 15:26:31: (../../../../../../../src/dist/juise/mod_juise/mod_juise.c.739) mod_juise: connection_reset: done 2021-04-27 15:27:41: (../../../../../../src/dist/lighttpd/src/server.c.936) [note] graceful shutdown started 2021-04-27 15:27:41: (../../../../../../src/dist/lighttpd/src/server.c.2011) server stopped aph@JMX5T> show configuration system services rest | display set set system services rest http port 3000 set system services rest control allowed-sources a.b.c.d set system services rest enable-explorer _______________________________________________ juniper-nsp mailing list juniper-nsp@puck.nether.net https://puck.nether.net/mailman/listinfo/juniper-nsp