nm-l2tp / NetworkManager-l2tp

L2TP and L2TP/IPsec support for NetworkManager
GNU General Public License v2.0
486 stars 83 forks source link

nm-l2tp-ppp-plugin: (get_credentials): could not get secrets #177

Closed Bradley-Drummonds closed 2 years ago

Bradley-Drummonds commented 2 years ago

Feb 04 15:41:20 colibri-t30 pppd[12844]: nm-l2tp-ppp-plugin: (get_credentials): could not get secrets: (2) The name org.freedesktop.NetworkManager.l2tp-ppp was not provided by any .service

pppd seems to run the nm-l2p-ppp-plugin but cannot get the credentials

Is there supposed to be a seperate .service file created by the build that I am missing? I only can see the .conf file and .name files created by the build. Maybe I misunderstand how the plugin works, but I thought networkmanager loaded the .name file as a plugin and took care of handling exposing the relevant interfaces and methods on the dbus.

I am a newb though, so I am still learning how all of this works and would love to know how to fix this problem and any insight on how how the plugin communicates with the dbus.

Also, we build nm-l2tp with Yocto and would love if anyone could drop a link to recipe for the nm-l2tp package. I can't seem to find one and I think that the one we use, mostly created by devtool is missing some bits.

Thanks!

dkosovic commented 2 years ago

I don't understand where the (get_credentials): could not get secrets: error messages is coming from as it is not from any recent source code, in particular the following line doesn't have the (get_credentials) function as part of the error message : https://github.com/nm-l2tp/NetworkManager-l2tp/blob/1.2.18/src/nm-l2tp-pppd-plugin.c#L271

but does match the following 7 year old version which would have printed the (get_credentials) function as part of the error message : https://github.com/seriyps/NetworkManager-l2tp/blob/master/src/nm-l2tp-pppd-plugin.c#L247

The old version used the org.freedesktop.NetworkManager.l2tp-ppp interface while the new one uses org.freedesktop.NetworkManager.l2tp.ppp

The org.freedesktop.NetworkManager.l2tp.ppp D-Bus interface is used by nm-l2tp-pppd-plugin.c and nm-l2tp-service.c to communicate between each other. The D-Bus interfaces are defined in nm-l2tp-service.conf.

dkosovic commented 2 years ago

I was looking at the networkmanager recipes for Yocto Honister : http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-connectivity/networkmanager?h=honister

I think any networkmanager-l2tp recipe would need to contain something like the following to specify the pppd plugin dir :

EXTRA_OECONF = " \
    --disable-static \
    --with-pppd-plugin-dir=/usr/lib/pppd/2.4.5 \
"

But use the actual pppd version number for the pppd plugin dir, See the README.md file for more info on that configure switch as well as others : https://github.com/nm-l2tp/NetworkManager-l2tp/tree/1.2.18

Bradley-Drummonds commented 2 years ago

Hi dkosovic, sorry about the late response, had some really bad yocto build problems...

the version of nm-l2tp-pppd-plugin.so was old . I had used devtool to generate the recipe and as a result the package installer was not installing the nm-l2tp-ppp-plugin.so . So I had manually copied (an old version of the plugin, as you correctly pointed out, thanks!) the nm-l2tp-pppd-plugin and made a mistake .

I have rebuilt the networkmanager-l2tp with the head of the current 1.20 version and made sure to copy the nm-l2tp-pppd-plugin.so into the correct location.

thanks