v3.2.x - installing rlm_python3 attempts to install rlm_python
Hello Everyone, Happy Monday Trying to understand how to install FR with rlm_python3 module. Using python:3.9-alpine docker image, when I run the below configure: ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ ... ... --disable-developer --with-pcre \ --with-rlm_python3 \ --with-rlm-python3-config-bin=/usr/local/bin/python3-config During the `make` process, i get a lot of errors for rlm_python. Im assuming because it's trying to use python2 but not sure really. (see output here: https://pastebin.com/raw/eRFQnKb0) I dont see any indication that rlm_python3 is being built or even in `make install` that it was installed BUT when i look at the lib files i see it. Along with python bash-5.1# ls -al /usr/lib/freeradius/rlm_python* -rwxr-xr-x 1 root root 132732 Jul 18 14:44 /usr/lib/freeradius/rlm_python.a -rwxr-xr-x 1 root root 20 Jul 18 14:44 /usr/lib/freeradius/rlm_python.la -rwxr-xr-x 1 root root 112920 Jul 18 14:44 /usr/lib/freeradius/rlm_python.so -rwxr-xr-x 1 root root 140028 Jul 18 14:14 /usr/lib/freeradius/rlm_python3.a -rwxr-xr-x 1 root root 20 Jul 18 14:14 /usr/lib/freeradius/rlm_python3.la -rwxr-xr-x 1 root root 120328 Jul 18 14:14 /usr/lib/freeradius/rlm_python3.so Using the --without-rlm_python option just doesnt install it at all... I've also tried within src/modules/rlm_python3 directory but get some interesting output below: bash-5.1# ./configure --with-rlm-python3-config-bin=/usr/local/bin/python3-config ... checking for python... /usr/local/bin/python checking for python version... 3.9 checking for python platform... linux checking for python script directory... ${prefix}/lib/python3.9/site-packages checking for python extension module directory... ${exec_prefix}/lib/python3.9/site-packages ./configure: line 1898: /usr/local/bin/python3-config : not found configure: /usr/local/bin/python3-config 's cflags were "" configure: Sanitized cflags were " " checking for gawk... gawk ./configure: line 1898: /usr/local/bin/python3-config : not found configure: /usr/local/bin/python3-config 's ldflags were "}" configure: Sanitized ldflags were "" checking for dl_iterate_phdr... yes ... So honestly at a loss... attempted what had been suggested here but get the same m4_include() output as the last post says. https://github.com/FreeRADIUS/freeradius-server/issues/4441 How can I install rlm_python3 ? Any input is much appreciated. Regards, Dave
On Jul 18, 2022, at 11:01 AM, Dave Macias <davama@gmail.com> wrote:
Trying to understand how to install FR with rlm_python3 module.
It should just build. We run CI every day, and build packages regularly.
During the `make` process, i get a lot of errors for rlm_python. Im assuming because it's trying to use python2
Yes. The rlm_python module is Python 2. We need to support that, to avoid breaking peoples systems.
Using the --without-rlm_python option just doesnt install it at all...
I've also tried within src/modules/rlm_python3 directory but get some interesting output below:
You need to pass many more flags to configure to get it working in a subdirectory.
So honestly at a loss... attempted what had been suggested here but get the same m4_include() output as the last post says. https://github.com/FreeRADIUS/freeradius-server/issues/4441
How can I install rlm_python3 ?
$ rm -rf src/modules/rlm_python $ ./configure ... $ make $ make install The server can *use* rlm_python. It doesn't *require* rlm_python. Alan DeKok.
Thank you Alan $ rm -rf src/modules/rlm_python
$ ./configure ... $ make $ make install
Unfortunately, that didnt install rlm_pytohn3 (with flags --with-rlm_python3 --with-rlm-python3-config-bin=/usr/local/bin/psython3-config ) bash-5.1# ls -al /usr/lib/freeradius/rlm_python* ls: /usr/lib/freeradius/rlm_python*: No such file or directory Adding --with-rlm_python didnt work either, im guessing because the rlm_python directory didnt exist. But doing this got rlm_python3 installed but with some errors: $ rm -rf src/modules/rlm_python \ $ cp -r src/modules/rlm_python3 src/modules/rlm_python \ $ ./configure ... \ --with-rlm_python3 ... ... CC src/modules/rlm_python/rlm_python3.c src/modules/rlm_python/rlm_python3.c:1033:1: warning: 'visibility' attribute ignored [-Wattributes] 1033 | { | ^ src/modules/rlm_python/rlm_python3.c: In function 'python_interpreter_init': src/modules/rlm_python/rlm_python3.c:1136:17: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations] 1136 | PyEval_InitThreads(); /* This also grabs a lock (which we then need to release) */ | ^~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/python3.9/Python.h:140, from src/modules/rlm_python/rlm_python3.c:37: /usr/local/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~~~~~~~~~~~~~ LINK build/lib/rlm_python3.la What could I be doing wrong?
On Jul 18, 2022, at 2:22 PM, Dave Macias <davama@gmail.com> wrote:
Unfortunately, that didnt install rlm_pytohn3 (with flags --with-rlm_python3 --with-rlm-python3-config-bin=/usr/local/bin/psython3-config )
deleting rlm_python doesn't make rlm_python3 build. It avoids errors with rlm_python.
Adding --with-rlm_python didnt work either, im guessing because the rlm_python directory didnt exist. But doing this got rlm_python3 installed but with some errors:
$ rm -rf src/modules/rlm_python \ $ cp -r src/modules/rlm_python3 src/modules/rlm_python \
Uh... no. That's not the right thing to do.
What could I be doing wrong?
The solution is to delete rlm_python, and then do: $ ./configure --with-experimental-modules ... and it will build rlm_python3. Alan DeKok.
Which is the Python3 version? e.g: share the “python3 —version” As Alan said, we have the CI building all targets successfully. Other than that, I did a simple test locally and the rim_python3 was generated as well. 1. Using latest v3.2.x/HEAD [jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ git log -1 commit db3ad0c4663030d4248118e1539eb91b4e7257c8 (HEAD -> v3.2.x, upstream/v3.2.x) Author: Alan T. DeKok <aland@freeradius.org> Date: Mon Jul 18 16:35:49 2022 -0400 python3 should be stable [jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ 2. Simple build [jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ ./configure --with-rlm-python3-config-bin=$(which python3-config); make 3. The rlm_python3 [jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ find build/ -iname rlm_python3* -type f build//objs/src/modules/rlm_python3/rlm_python3.o build//objs/src/modules/rlm_python3/rlm_python3.lo build//make/src/src/modules/rlm_python3/rlm_python3.mk build//lib/rlm_python3.la build//lib/local/rlm_python3.la build//lib/local/.libs/rlm_python3.a build//lib/local/.libs/rlm_python3.dylib build//lib/.libs/rlm_python3.a build//lib/.libs/rlm_python3.dylib [jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ i.e: If you get any error again. Please go to src/modules/rlm_python3 and execute ./configure, then copy/paste the output with us. — Jorge
On 18 Jul 2022, at 15:22, Dave Macias <davama@gmail.com> wrote:
Thank you Alan
$ rm -rf src/modules/rlm_python
$ ./configure ... $ make $ make install
Unfortunately, that didnt install rlm_pytohn3 (with flags --with-rlm_python3 --with-rlm-python3-config-bin=/usr/local/bin/psython3-config )
bash-5.1# ls -al /usr/lib/freeradius/rlm_python* ls: /usr/lib/freeradius/rlm_python*: No such file or directory
Adding --with-rlm_python didnt work either, im guessing because the rlm_python directory didnt exist. But doing this got rlm_python3 installed but with some errors:
$ rm -rf src/modules/rlm_python \ $ cp -r src/modules/rlm_python3 src/modules/rlm_python \ $ ./configure ... \ --with-rlm_python3 ... ... CC src/modules/rlm_python/rlm_python3.c src/modules/rlm_python/rlm_python3.c:1033:1: warning: 'visibility' attribute ignored [-Wattributes] 1033 | { | ^ src/modules/rlm_python/rlm_python3.c: In function 'python_interpreter_init': src/modules/rlm_python/rlm_python3.c:1136:17: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations] 1136 | PyEval_InitThreads(); /* This also grabs a lock (which we then need to release) */ | ^~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/python3.9/Python.h:140, from src/modules/rlm_python/rlm_python3.c:37: /usr/local/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~~~~~~~~~~~~~ LINK build/lib/rlm_python3.la
What could I be doing wrong? - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Jorge Pereira jpereira@networkradius.com
Thank you Alan and Jorge for your responses. Still getting errors, unfortunately... using docker image * python:3.9-alpine3.15 * Ran: ./configure .... --with-experimental-modules --with-rlm-python3-config-bin=$(which python3-config) CC src/modules/rlm_python3/rlm_python3.c src/modules/rlm_python3/rlm_python3.c:1033:1: warning: 'visibility' attribute ignored [-Wattributes] 1033 | { | ^ src/modules/rlm_python3/rlm_python3.c: In function 'python_interpreter_init': src/modules/rlm_python3/rlm_python3.c:1136:3: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations] 1136 | PyEval_InitThreads(); /* This also grabs a lock (which we then need to release) */ | ^~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/python3.9/Python.h:140, from src/modules/rlm_python3/rlm_python3.c:37: /usr/local/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~~~~~~~~~~~~~ LINK build/lib/rlm_python3.la Here is my env output: bash-5.1# python3 -V Python 3.9.13 bash-5.1# apk info python3-dev python3-dev-3.9.7-r4 installed bash-5.1# git log -1 commit db3ad0c4663030d4248118e1539eb91b4e7257c8 (grafted, HEAD -> v3.2.x, origin/v3.2.x) Author: Alan T. DeKok <aland@freeradius.org> Date: Mon Jul 18 16:35:49 2022 -0400 python3 should be stable bash-5.1# cd src/modules/rlm_python3/ bash-5.1# ls all.mk all.mk.in config.h config.h.in config.log config.status configure configure.ac example.py prepaid.py prepaid.sql radiusd.py rlm_python3.c rlm_python3.h bash-5.1# ./configure checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for a Python interpreter with version >= 3.0... python checking for python... /usr/local/bin/python checking for python version... 3.9 checking for python platform... linux checking for python script directory... ${prefix}/lib/python3.9/site-packages checking for python extension module directory... ${exec_prefix}/lib/python3.9/site-packages checking for python3-config... python3-config configure: python3-config's cflags were "-I/usr/local/include/python3.9 -I/usr/local/include/python3.9 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall" configure: Sanitized cflags were " -isystem/usr/local/include/python3.9 -isystem/usr/local/include/python3.9 -fwrapv " checking for gawk... gawk configure: python3-config's ldflags were " -L/usr/local/lib -lpython3.9 -ldl -lm -lm }" configure: Sanitized ldflags were "-L/usr/local/lib -lpython3.9 -ldl -lm -lm" checking for dl_iterate_phdr... yes configure: creating ./config.status config.status: creating all.mk config.status: creating config.h config.status: config.h is unchanged Hope this covers it. Please let me know if im missing anything Thank you networkradius for you awesome support! Best, Dave On Mon, Jul 18, 2022 at 10:30 PM Jorge Pereira <jpereira@freeradius.org> wrote:
Which is the Python3 version? e.g: share the “python3 —version”
As Alan said, we have the CI building all targets successfully. Other than that, I did a simple test locally and the rim_python3 was generated as well.
1. Using latest v3.2.x/HEAD
[jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ git log -1 commit db3ad0c4663030d4248118e1539eb91b4e7257c8 (HEAD -> v3.2.x, upstream/v3.2.x) Author: Alan T. DeKok <aland@freeradius.org> Date: Mon Jul 18 16:35:49 2022 -0400
python3 should be stable [jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$
2. Simple build
[jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ ./configure --with-rlm-python3-config-bin=$(which python3-config); make
3. The rlm_python3
[jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$ find build/ -iname rlm_python3* -type f build//objs/src/modules/rlm_python3/rlm_python3.o build//objs/src/modules/rlm_python3/rlm_python3.lo build//make/src/src/modules/rlm_python3/rlm_python3.mk build//lib/rlm_python3.la build//lib/local/rlm_python3.la build//lib/local/.libs/rlm_python3.a build//lib/local/.libs/rlm_python3.dylib build//lib/.libs/rlm_python3.a build//lib/.libs/rlm_python3.dylib [jpereira@jorge-sugarloaf:freeradius-server-v3.2.x.git]$
i.e: If you get any error again. Please go to src/modules/rlm_python3 and execute ./configure, then copy/paste the output with us.
— Jorge
On 18 Jul 2022, at 15:22, Dave Macias <davama@gmail.com> wrote:
Thank you Alan
$ rm -rf src/modules/rlm_python
$ ./configure ... $ make $ make install
Unfortunately, that didnt install rlm_pytohn3 (with flags --with-rlm_python3 --with-rlm-python3-config-bin=/usr/local/bin/psython3-config )
bash-5.1# ls -al /usr/lib/freeradius/rlm_python* ls: /usr/lib/freeradius/rlm_python*: No such file or directory
Adding --with-rlm_python didnt work either, im guessing because the rlm_python directory didnt exist. But doing this got rlm_python3 installed but with some errors:
$ rm -rf src/modules/rlm_python \ $ cp -r src/modules/rlm_python3 src/modules/rlm_python \ $ ./configure ... \ --with-rlm_python3 ... ... CC src/modules/rlm_python/rlm_python3.c src/modules/rlm_python/rlm_python3.c:1033:1: warning: 'visibility' attribute ignored [-Wattributes] 1033 | { | ^ src/modules/rlm_python/rlm_python3.c: In function 'python_interpreter_init': src/modules/rlm_python/rlm_python3.c:1136:17: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations] 1136 | PyEval_InitThreads(); /* This also grabs a lock (which we then need to release) */ | ^~~~~~~~~~~~~~~~~~ In file included from /usr/local/include/python3.9/Python.h:140, from src/modules/rlm_python/rlm_python3.c:37: /usr/local/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~~~~~~~~~~~~~ LINK build/lib/rlm_python3.la
What could I be doing wrong? - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Jorge Pereira jpereira@networkradius.com
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 19, 2022, at 8:48 AM, Dave Macias <davama@gmail.com> wrote:
Still getting errors, unfortunately... using docker image
Errors?
CC src/modules/rlm_python3/rlm_python3.c src/modules/rlm_python3/rlm_python3.c:1033:1: warning: 'visibility'
warning
src/modules/rlm_python3/rlm_python3.c:1136:3: warning: 'PyEval_InitThreads'
warning "warning != error". What's the problem? Did you try the module to see if it worked? Alan DeKok.
Yes did try to enable but radiusd crashes with below. Yes, example.py does exist... freeradius | Tue Jul 19 12:56:34 2022 : Debug: # Instantiating module "python3" from file /etc/raddb/mods-enabled/python3 freeradius | Tue Jul 19 12:56:34 2022 : Info: Python version: 3.9.13 (main, May 18 2022, 02:37:36) [GCC 10.3.1 20211027] freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Module 'example' not found freeradius | Tue Jul 19 12:56:34 2022 : Error: python_error_log:209, Exception type: <class 'ModuleNotFoundError'>, Exception value: No module named 'example' freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Failed to import python function 'example.instantiate' freeradius | Tue Jul 19 12:56:34 2022 : Error: python_error_log:201, Unknown error freeradius | Tue Jul 19 12:56:34 2022 : Error: /etc/raddb/mods-enabled/python3[9]: Instantiation failed for module "python3" Perhaps the way the module is loaded? It's a volume: - ./raddb/sites-enabled/default:/etc/raddb/sites-enabled/default - ./raddb/mods-enabled/ldap:/etc/raddb/mods-enabled/ldap - ./raddb/mods-enabled/linelog:/etc/raddb/mods-enabled/linelog - ./raddb/mods-enabled/python3:/etc/raddb/mods-enabled/python3 - ./raddb/mods-config/python3/webhook.py:/etc/raddb/mods-config/python3/webhook.py On Tue, Jul 19, 2022 at 8:55 AM Alan DeKok <aland@deployingradius.com> wrote:
On Jul 19, 2022, at 8:48 AM, Dave Macias <davama@gmail.com> wrote:
Still getting errors, unfortunately... using docker image
Errors?
CC src/modules/rlm_python3/rlm_python3.c src/modules/rlm_python3/rlm_python3.c:1033:1: warning: 'visibility'
warning
src/modules/rlm_python3/rlm_python3.c:1136:3: warning: 'PyEval_InitThreads'
warning
"warning != error". What's the problem?
Did you try the module to see if it worked?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 19, 2022, at 8:58 AM, Dave Macias <davama@gmail.com> wrote:
Yes did try to enable but radiusd crashes with below. Yes, example.py does exist...
A failure message is not a crash. Describing things incorrectly makes it harder to fix problems.
freeradius | Tue Jul 19 12:56:34 2022 : Debug: # Instantiating module "python3" from file /etc/raddb/mods-enabled/python3 freeradius | Tue Jul 19 12:56:34 2022 : Info: Python version: 3.9.13 (main, May 18 2022, 02:37:36) [GCC 10.3.1 20211027] freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Module 'example' not found
Perhaps the way the module is loaded?
It's a python issue. Python needs a path set, so that it knows where to look for things.
It's a volume:
- ./raddb/sites-enabled/default:/etc/raddb/sites-enabled/default - ./raddb/mods-enabled/ldap:/etc/raddb/mods-enabled/ldap - ./raddb/mods-enabled/linelog:/etc/raddb/mods-enabled/linelog - ./raddb/mods-enabled/python3:/etc/raddb/mods-enabled/python3 - ./raddb/mods-config/python3/webhook.py:/etc/raddb/mods-config/python3/webhook.py
So... how does python3 know to find things here? This directory doesn't exist in the default configuration. Perhaps look into mods-available/python3, and see if there's some way to set a Python path. This is documented... Perhaps you did set that, but it's impossible to tell. Because you helpfully deleted almost all of the debug output. And used -Xx, too, which all of the documentation says "don't do". We write documentation and examples for a reason. They exist to help you. It helps to read them. Alan DeKok.
It was the PYTHONPATH environment variable. Thought I had set it. Set it to below where the default example.py is found. PYTHONPATH=/etc/raddb/mods-config/python3 Appreciate the help!! Thank you On Tue, Jul 19, 2022 at 9:15 AM Alan DeKok <aland@deployingradius.com> wrote:
On Jul 19, 2022, at 8:58 AM, Dave Macias <davama@gmail.com> wrote:
Yes did try to enable but radiusd crashes with below. Yes, example.py
does
exist...
A failure message is not a crash.
Describing things incorrectly makes it harder to fix problems.
freeradius | Tue Jul 19 12:56:34 2022 : Debug: # Instantiating module "python3" from file /etc/raddb/mods-enabled/python3 freeradius | Tue Jul 19 12:56:34 2022 : Info: Python version: 3.9.13 (main, May 18 2022, 02:37:36) [GCC 10.3.1 20211027] freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Module 'example' not found
Perhaps the way the module is loaded?
It's a python issue. Python needs a path set, so that it knows where to look for things.
It's a volume:
- ./raddb/sites-enabled/default:/etc/raddb/sites-enabled/default - ./raddb/mods-enabled/ldap:/etc/raddb/mods-enabled/ldap - ./raddb/mods-enabled/linelog:/etc/raddb/mods-enabled/linelog - ./raddb/mods-enabled/python3:/etc/raddb/mods-enabled/python3 -
./raddb/mods-config/python3/webhook.py:/etc/raddb/mods-config/python3/webhook.py
So... how does python3 know to find things here? This directory doesn't exist in the default configuration.
Perhaps look into mods-available/python3, and see if there's some way to set a Python path. This is documented...
Perhaps you did set that, but it's impossible to tell. Because you helpfully deleted almost all of the debug output. And used -Xx, too, which all of the documentation says "don't do".
We write documentation and examples for a reason. They exist to help you. It helps to read them.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Please, 1. Check where is the example.py e.g: find / -name example.py 2. Then, set the “python_path=/etc/raddb/…” in /etc/raddb/mods-available/python3 3. Restart the server
On 19 Jul 2022, at 09:58, Dave Macias <davama@gmail.com> wrote:
Yes did try to enable but radiusd crashes with below. Yes, example.py does exist...
freeradius | Tue Jul 19 12:56:34 2022 : Debug: # Instantiating module "python3" from file /etc/raddb/mods-enabled/python3 freeradius | Tue Jul 19 12:56:34 2022 : Info: Python version: 3.9.13 (main, May 18 2022, 02:37:36) [GCC 10.3.1 20211027] freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Module 'example' not found freeradius | Tue Jul 19 12:56:34 2022 : Error: python_error_log:209, Exception type: <class 'ModuleNotFoundError'>, Exception value: No module named 'example' freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Failed to import python function 'example.instantiate' freeradius | Tue Jul 19 12:56:34 2022 : Error: python_error_log:201, Unknown error freeradius | Tue Jul 19 12:56:34 2022 : Error: /etc/raddb/mods-enabled/python3[9]: Instantiation failed for module "python3"
Perhaps the way the module is loaded?
It's a volume:
- ./raddb/sites-enabled/default:/etc/raddb/sites-enabled/default - ./raddb/mods-enabled/ldap:/etc/raddb/mods-enabled/ldap - ./raddb/mods-enabled/linelog:/etc/raddb/mods-enabled/linelog - ./raddb/mods-enabled/python3:/etc/raddb/mods-enabled/python3 - ./raddb/mods-config/python3/webhook.py:/etc/raddb/mods-config/python3/webhook.py
On Tue, Jul 19, 2022 at 8:55 AM Alan DeKok <aland@deployingradius.com> wrote:
On Jul 19, 2022, at 8:48 AM, Dave Macias <davama@gmail.com> wrote:
Still getting errors, unfortunately... using docker image
Errors?
CC src/modules/rlm_python3/rlm_python3.c src/modules/rlm_python3/rlm_python3.c:1033:1: warning: 'visibility'
warning
src/modules/rlm_python3/rlm_python3.c:1136:3: warning: 'PyEval_InitThreads'
warning
"warning != error". What's the problem?
Did you try the module to see if it worked?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Jorge Pereira jpereira@networkradius.com
Thank you Jorge. Yes, setting the PYTHONPATH was what resolved it. Thank you for your assistance! Best, Dave On Jul 19, 2022, 6:58 PM -0400, Jorge Pereira <jpereira@freeradius.org>, wrote:
Please,
1. Check where is the example.py
e.g: find / -name example.py
2. Then, set the “python_path=/etc/raddb/…” in /etc/raddb/mods-available/python3
3. Restart the server
On 19 Jul 2022, at 09:58, Dave Macias <davama@gmail.com> wrote:
Yes did try to enable but radiusd crashes with below. Yes, example.py does exist...
freeradius | Tue Jul 19 12:56:34 2022 : Debug: # Instantiating module "python3" from file /etc/raddb/mods-enabled/python3 freeradius | Tue Jul 19 12:56:34 2022 : Info: Python version: 3.9.13 (main, May 18 2022, 02:37:36) [GCC 10.3.1 20211027] freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Module 'example' not found freeradius | Tue Jul 19 12:56:34 2022 : Error: python_error_log:209, Exception type: <class 'ModuleNotFoundError'>, Exception value: No module named 'example' freeradius | Tue Jul 19 12:56:34 2022 : Error: python_function_load - Failed to import python function 'example.instantiate' freeradius | Tue Jul 19 12:56:34 2022 : Error: python_error_log:201, Unknown error freeradius | Tue Jul 19 12:56:34 2022 : Error: /etc/raddb/mods-enabled/python3[9]: Instantiation failed for module "python3"
Perhaps the way the module is loaded?
It's a volume:
- ./raddb/sites-enabled/default:/etc/raddb/sites-enabled/default - ./raddb/mods-enabled/ldap:/etc/raddb/mods-enabled/ldap - ./raddb/mods-enabled/linelog:/etc/raddb/mods-enabled/linelog - ./raddb/mods-enabled/python3:/etc/raddb/mods-enabled/python3 - ./raddb/mods-config/python3/webhook.py:/etc/raddb/mods-config/python3/webhook.py
On Tue, Jul 19, 2022 at 8:55 AM Alan DeKok <aland@deployingradius.com> wrote:
On Jul 19, 2022, at 8:48 AM, Dave Macias <davama@gmail.com> wrote:
Still getting errors, unfortunately... using docker image
Errors?
CC src/modules/rlm_python3/rlm_python3.c src/modules/rlm_python3/rlm_python3.c:1033:1: warning: 'visibility'
warning
src/modules/rlm_python3/rlm_python3.c:1136:3: warning: 'PyEval_InitThreads'
warning
"warning != error". What's the problem?
Did you try the module to see if it worked?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Jorge Pereira jpereira@networkradius.com
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 19 Jul 2022, at 19:59, Dave Macias <davama@gmail.com> wrote:
Thank you Jorge. Yes, setting the PYTHONPATH was what resolved it.
Great! Just keep in mind that the “PYTHONPATH” is an env and the ”python_path=...” (similar as PYTHONPATH env) is an option found in /etc/raddb/mods-available/python3
Thank you for your assistance!
Best, Dave
participants (3)
-
Alan DeKok -
Dave Macias -
Jorge Pereira