uwsgi cannot open "./router_redirect_plugin.so"

Earlier I installed FreeBSD 13-CURRENT, installed uwsgi through ports

Bash:
cd /usr/ports/www/uwsgi
make install clean

It did work well and I was able to access a plugin named router_redirect . When I'm installing the same in 12.1-STABLE on my RPi3, I'm unable to access the plugin

It prints
!!! UNABLE to load uWSGI plugin: Cannot open "./router_redirect_plugin.so" !!!

My .ini file is as follows:

INI:
...
plugins = router_redirect
...

I also tried uninstalling with port and installing with pkg, doesn't work!
 
I tried with the latest CURRENT. Same error. The configuration at end of port installation shows
plugin_dir = .
I'm not sure whether it is empty or it's the same directory. What to do now?

I'm unable to find where it's installed. I see some unreadable uwsgi files in /usr/local/bin
 
Bash:
find / -name uwsgi
shows 4 locations
/usr/local/etc/rc.d/uwsgi
/usr/local/bin/uwsgi
/usr/ports/www/uwsgi
/var/mail/uwsgi

Bash:
find / -name router_redirect_plugin.so
find / -name router_redirect

Above 2 commands show absolutely nothing! There's no such file!
Only the port maintainer can help me now.
 
Maybe make config install clean and enable plugins in the config screen?

Freshports shows this under configuration options:
Code:
 Enable plugins     PSGI=off: PSGI embedded plugin

This could explain your error message (UNABLE to load uWSGI plugin).

But I dont know this port, never used it.
 
Only the port maintainer can help me now.
You could also address the problem to the uWSGI mailing list: http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

There is a way to obtain the plugin. Build the plugin manually, execute in /usr/ports/www/uwsgi/work-py37/uwsgi-2.0.18:

python3.7 uwsgiconfig.py --plugin plugins/router_redirect
cp router_redirect_plugin.so /usr/local/lib
service uwsgi restart

But this is not a recommended procedure. It will produce a unregistered library, absent in the package database, invisible to the pkg(8) or ports(7) framework.

Also a default direct build from source tar ball doesn't produce any .so libraries. Maybe it's meant to be modular.

 
You could also address the problem to the uWSGI mailing list: http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

There is a way to obtain the plugin. Build the plugin manually, execute in /usr/ports/www/uwsgi/work-py37/uwsgi-2.0.18:

python3.7 uwsgiconfig.py --plugin plugins/router_redirect
cp router_redirect_plugin.so /usr/local/lib
service uwsgi restart

But this is not a recommended procedure. It will produce a unregistered library, absent in the package database, invisible to the pkg(8) or ports(7) framework.
That did it. Thanks a ton. I have requested uwsgi guys on the above mailing list to update the port since also, 2.0.19 is out. I will keep this setting till the updated port is out. Then I'll reinstall the port.
 
There is a misunderstanding. Suggesting the uWSGI mailing list was meant to clarify why the plugin is absent.

After further investigation, it's also possible the error message is an error itself, that the module is embedded in the uwsgi binary, the linking to router_redirect_plugin.so faulty. Running make on the port with script(1) recording the build and less verbosity ( Makefile #PYDISTUTILS_BUILDARGS= --verbose):
Code:
...
*** uWSGI compiling embedded plugins ***
...
[thread 3][cc] plugins/router_redirect/router_redirect.o
...

And the binary:
Code:
strings  work-py37/uwsgi-2.0.19.1/uwsgi | grep router_redirect
router_redirect_plugin
router_redirect

You should file a bug report at https://bugs.freebsd.org to clarify the situation.

I have requested uwsgi guys on the above mailing list to update the port since also, 2.0.19 is out.
Thats not the right place. They are not responsible for the port maintenance. You need to address the request at https://bugs.freebsd.org Ports & Packages (latest version is 2.0.19.1) . But the problem with the error message should be clarified first.
 
Last edited:
After further investigation, it's also possible the error message is an error itself, that the module is embedded in the uwsgi binary, the linking to router_redirect_plugin.so faulty. Running make on the port with script(1) recording the build and less verbosity ( Makefile #PYDISTUTILS_BUILDARGS= --verbose):
Code:
...
*** uWSGI compiling embedded plugins ***
...
[thread 3][cc] plugins/router_redirect/router_redirect.o
...

And the binary:
Code:
grep router_redirect_plugin work-py37/uwsgi-2.0.18/uwsgi

Yes, the plugin worked but once I tried to run my site on server, nothing works well. It shows a template error when my templates are present. It's broken without a doubt. I have filed a bug. I hope they fix it ASAP. I'm totally stuck!
 
My .ini file is as follows:
INI:
...
plugins = router_redirect

Reading though the documentation it seems to be a .ini configuration error on your side (embedded plugins a.k.a modules), try /usr/local/etc/uwsgi/uwsgi.ini:
Code:
[uwsgi]

module=router_redirect

Starting the service doesn't return an error with the above configuration, but I have no setup to see if the plugin/module is working as expected.
 
Code:
[uwsgi]

module=router_redirect
Starting the service doesn't return an error with the above configuration,

I was fooled by the absents of an error message, didn't thought to look in /var/log/uwsgi.log, but there was clearly a error recorded:
Code:
ModuleNotFoundError: No module named 'router_redirect'

The problem could be lang/python37. On July 6th the latest package repository was updated, python37 upgraded: 3.7.7_1 -> 3.7.8. python37 in the quarterly package repository remains at 3.7.7_1. Since the upgrade I can't reproduce the error. I have in /usr/local/etc/uwsgi/uwsgi.ini set:
Code:
[uwsgi]

plugins=router_redirect

No error message when starting the service or in the log.

Please upgrade your system to latest repository if on quarterly (to python-3.7.8), restart the service and check your server.
 
I installed python37 from ports. Most probably, it did not install correctly
I get "libpython3.8m.so.1.0" not found, required by "uwsgi"

Anyways, I don't think the minor change from 3.7.7 to 3.7.8 should affect uwsgi in such a way. uwsgi built for 3.7.8 and system having python3.7.7 can probably show those errors but I strongly think this will not solve the error. uwsgi 2.0.18 has been made about 6 months before today.

I enabled latest repo but the pkg showed some strange python versions, python37-3.7.0_3. python is 2.7_3,2 so I switched back to quarterly.

I think it's time for me to shift to alpine while developers fix this. I can't wait forever.
 
Back
Top