Bug 247689 - www/uwsgi: has the plugin embedded but doesn't work
Summary: www/uwsgi: has the plugin embedded but doesn't work
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-07-01 09:15 UTC by Sagar Acharya
Modified: 2020-07-13 13:29 UTC (History)
4 users (show)

See Also:
lwhsu: maintainer-feedback? (eugene)


Attachments
version 2.0.18 build log (3.48 KB, text/plain)
2020-07-03 10:27 UTC, Newton Terry
no flags Details
version 2.0.18 build log (12.93 KB, text/plain)
2020-07-03 10:28 UTC, Newton Terry
no flags Details
version 2.0.19.1 build log (13.11 KB, text/plain)
2020-07-03 10:30 UTC, Newton Terry
no flags Details
version 2.0.18 binary embedded plugins (3.48 KB, text/plain)
2020-07-03 10:31 UTC, Newton Terry
no flags Details
version 2.0.19.1 binary embedde plugins (3.48 KB, text/plain)
2020-07-03 10:32 UTC, Newton Terry
no flags Details
Folder structure similar to my environment. (595 bytes, application/gzip)
2020-07-07 13:53 UTC, Sagar Acharya
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sagar Acharya 2020-07-01 09:15:11 UTC
Cannot access router_redirect_plugin.so even though it is built.

It seems that by default, some plugins like above should be embedded in uwsgi build but an error throws up. Plugin is not loaded. T-Daemon mentions on the forum link below that the plugin is built.

https://forums.freebsd.org/threads/uwsgi-cannot-open-router_redirect_plugin-so.75953/#post-467755

Please see T-Daemon 's comment on 30th June.

Also, the version of uwsgi is 2.0.18 and 2.0.19. It would be great if you can update the port. That would also remove the error.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-03 04:23:33 UTC
(In reply to Sagar Acharya from comment #0)

@Sagar Can you clarify/confirm, that the 2.0.19 or 2.0.19.1 releases (which one?) fixes *this* issue as reported?
Comment 3 Sagar Acharya 2020-07-03 06:03:22 UTC
(In reply to Kubilay Kocak from comment #1)

It doesn't. It's just a suggestion. Someone will have to probably update the uwsgi to latest version. I though making a 2.0.19.1 port will solve both these things.

I think the port is broken. There is no issue with 2.0.18 uwsgi.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-03 06:08:44 UTC
(In reply to Sagar Acharya from comment #3)

"no issue with 2.0.18 uwsgi". Is that to say the current version of the port (2.0.18) is *not* affected by this issue at present?
Comment 5 Sagar Acharya 2020-07-03 06:15:01 UTC
It is affected. I mean there's an issue with makefile or something. I've never made a port, I don't know how the build is customized for FreeBSD.

But what I know is that pkg and port of uwsgi currently give the error shown in detail in the forum link in my 1st comment.

In comment #3 , I say that the release of unbit doesn't have any problem, the pkg of FreeBSD and port making files have problems.
Comment 6 Newton Terry 2020-07-03 10:26:23 UTC
I can reproduce the error. Current www/uwsgi, version 2.0.18, having set plugins in configuration file, returns plugin error message when starting service:

service uwsgi onestart

[uWSGI] getting INI configuration from /usr/local/etc/uwsgi/uwsgi.ini
!!! UNABLE to load uWSGI plugin: Cannot open "./router_redirect_plugin.so" !!!

/usr/local/etc/uwsgi/uwsgi.ini

[uwsgi]
plugins=router_redirect

In ports work-py37 directory no router_redirect_plugin.so is present. Recording the build process with less verbosity (Makefile: #PYDISTUTILS_BUILDARGS= --verbose) demonstrates the plugins are build embedded into the binary. From the build log:

...
using profile: buildconf/default.ini

cut  ---------------------
work-py37/uwsgi-2.0.18/buildconf/default.ini
[uwsgi]
main_plugin = python,gevent
inherit = base

work-py37/uwsgi-2.0.18/buildconf/base.ini
[uwsgi]
...
embedded_plugins = %(main_plugin)s, ..., router_redirect,...

continue  ----------------

*** uWSGI compiling embedded plugins ***
...
[thread 4][cc] plugins/router_redirect/router_redirect.o
...

Also the build binary indicates having the plugins, inclusive router_redirect_plugin, embedded:

strings /usr/local/bin/uwsgi | grep router_redirect
router_redirect_plugin
router_redirect

Updating the port to version 2.0.19.1 doesn't resolve, error message remains.

Attached:
uwsgi-2.0.18-build.log
uwsgi-2.0.19.1-build.log
uwsgi18-binary-embedd-plugins-list.txt
uwsgi19.1-binary-embedd-plugins-list.txt
Comment 7 Newton Terry 2020-07-03 10:27:10 UTC
Created attachment 216166 [details]
version 2.0.18 build log
Comment 8 Newton Terry 2020-07-03 10:28:49 UTC
Created attachment 216167 [details]
version 2.0.18 build log
Comment 9 Newton Terry 2020-07-03 10:30:31 UTC
Created attachment 216168 [details]
version 2.0.19.1 build log
Comment 10 Newton Terry 2020-07-03 10:31:41 UTC
Created attachment 216169 [details]
version 2.0.18 binary embedded plugins
Comment 11 Newton Terry 2020-07-03 10:32:35 UTC
Created attachment 216170 [details]
version 2.0.19.1 binary embedde plugins
Comment 12 Newton Terry 2020-07-05 10:30:41 UTC
(In reply to Sagar Acharya from comment #5)

Please check the forum posting

https://forums.freebsd.org/threads/uwsgi-cannot-open-router_redirect_pluginso.75953/post-468200

Tell us if the situation has changed.
Comment 13 Sagar Acharya 2020-07-06 14:54:48 UTC
So this eugene guy, comes out of nowhere, breaks the port, has an email id that doesn't work and FreeBSD developers don't fix uwsgi, a pretty important tool that many people use for quite some time (precisely a week)! Older version did work and simply reverting to that should solve this problem too but it hasn't been done!

This is ridiculous.
Comment 14 emz 2020-07-07 08:19:46 UTC
My definition of "ridiculous" radically differs from yours. I define it as the following: a guy that just pops out of nowhere^WIndia and has zero knowledge of ports in general, and of this port in particular stars to make waves.

When it comes to this port - I use it in production every day.
So far you failed to
- describe problem properly
- submit any patch

All you do is whine and whine.

Furthermore, you behave in extemely annoying way.
Nobody owes you anything.

Go seek for a commercial support.
Comment 15 Eugene M. Zheganin 2020-07-07 08:39:38 UTC
User tries to add the plugin that isn't neither built now included with the port into the configuration. As expected, the uwsgi master process complains about it.

This is the expected behavior.

This PR should be closed for now.
Comment 16 Sagar Acharya 2020-07-07 09:50:27 UTC
(In reply to emz from comment #14)

You incompetent autistic retard, Terry Newton just reproduced the bug. Everything that I posted has been nothing but positive and to the point.

I'm a user of this system. I don't maintain these systems. It would be much costly for me to maintain these systems as for a single port, I have to understand the structure first. In things that I maintain, users of those don't complain because the maintainers haven't posed problems for them.
Comment 17 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-07 10:48:09 UTC
Sagar, Emz 

That language and behaviour in comment 13 comment 14 and comment 16 is not appropriate on our issue tracker, nor any other forum within the FreeBSD community. 

Further comment in any form on this issue will result in accounts being suspended, at minimum.

I refer you to our project Code of Conduct: https://www.freebsd.org/internal/code-of-conduct.html

If you would like to raise an issue with respect to this request that you both do not continue to comment on this issue, you may reach out to the conduct@ team, the email address is in the link above. You may also cc me (koobs@) if you feel comfortable doing so
Comment 18 Li-Wen Hsu freebsd_committer 2020-07-07 10:55:38 UTC
Please calm down, this kind of comments won't help solving the issue here.  I understand the frustration of a thing doesn't work and eager to get the support.  On the other hand, people also want to help but need more detailed information to figure out the root cause.  Most of the people are volunteers and need time to work on things.  This is usually a thankless work. Please be patient and be nice to each other, to get the issue solved.

I think there is a misunderstanding of T-Daemon's comment at
https://forums.freebsd.org/threads/uwsgi-cannot-open-router_redirect_plugin-so.75953/#post-467755

"router_redirect" feature in www/uwsgi port is build and linked in the uwsgi binary as a "module", not a separated .so as a "plugin."

And as described in this comment:
https://forums.freebsd.org/threads/uwsgi-cannot-open-router_redirect_plugin-so.75953/#post-468200

The correct way to use it in the .ini is `module=router_redirect` instead of `plugins=router_redirect`

You might want to check your configure file again, change it as suggested and see if the feature works.

If there is a need of having this feature as a plugin, that is a feature request and it may need more work to patch the port. The help of this is definitely welcomed.
Comment 19 Sagar Acharya 2020-07-07 11:02:59 UTC
(In reply to Li-Wen Hsu from comment #18)

Tried that, doesn't work. I told T-Daemon that in forums msgs.

Initial error goes away. The following error pops up

*** Operational MODE: preforking ***
ModuleNotFoundError: No module named 'router_redirect'

What's wrong with comment #13? If it is maintainer's mistake then it is, I will point out. I just told the truth.
Comment 20 Li-Wen Hsu freebsd_committer 2020-07-07 11:47:17 UTC
(In reply to Sagar Acharya from comment #19)
Next time please reply that in public, or others cannot help or get helped.  Would you please provide more detailed information about your uwsgi/router_redirect setup?  It would be best if you can include how you install it, your full configuration file, your wsgi script, and how you check if it works.

You did tell some truth in comment #13 , but in a not very friendly way, and some things are not related to the issue itself.  Even something is broken, people are not intentional break things.  People are willing to fix things, but need more information, like what's the exact number of the "old version" you said that works.

Again, emotional words won't help.  Please discuss technical things in a professional way.
Comment 21 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-07 11:49:23 UTC
If/when attaching large bodies of text, configuration files or logs, please use attachments instead of pasting in comments
Comment 22 Sagar Acharya 2020-07-07 13:53:07 UTC
Created attachment 216294 [details]
Folder structure similar to my environment.
Comment 23 Sagar Acharya 2020-07-07 14:18:16 UTC
When I removed the white space on RHS at https line in uwsgiConf.ini the attached tar. I was able to get rest of the things running WITHOUT router_redirect.so

1st line shows

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

I go to the folder portbug, execute "uwsgi --ini uwsgiConf.ini". Everything runs correctly EXCEPT the above plugin. I can't get https to my site due to that.
Comment 24 Sagar Acharya 2020-07-07 14:24:30 UTC
1 month ago, I did the exact same thing on 13-CURRENT with uwsgi, it ran perfectly fine! By version I mean not 2.0.17. I mean maybe something before some patchwork. Precisely, I mean uwsgi available a month ago.

I do cd /usr/ports/www/uwsgi & make install
I keep PSGI and XML unchecked in the graphical configuration display but I have tried with them both being on too. I have tried on all 3 12.1-RELEASE and latest STABLE and CURRENT images.
Comment 25 Sagar Acharya 2020-07-13 13:29:40 UTC
I use alpine currently. It has many packages for uwsgi of which router_redirect is one. If FreeBSD offers additional plugins separately as pkgs, then not having router_redirect is okay else having options for building extra plugins is recommended. I'm facing a very nasty bug posted

https://stackoverflow.com/questions/62814165/jinja2exceptions-templatenotfound-index-html-with-uwsgi-but-not-flask-run

here. The most astonishing part is I can run things with flask run but not uwsgi. I strongly think this is a bug on uwsgi's part but unsure. I have round brackets around HTTP_POST and REQUEST_URI which must be changed to curly brackets.