Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: php argument composition #2653

Merged
merged 3 commits into from
Apr 29, 2019

Conversation

dvzrv
Copy link
Contributor

@dvzrv dvzrv commented Apr 28, 2019

Moves the composition of arguments to a backgrounded php call (i.e. when using shell_exec or exec) to assemble_php_args() in lib/functions.php. Further establishes details discussed in #2643.

This works for me during installation. However, when using an unset global php configuration (while serving cacti with all requirements via uwsgi) and spawning external php processes, these throw warnings as they can't load certain (probably builtin) extensions, which are not found in the default extensions path. I don't know what to do about that.
Therefore, please review and test! Also, please advise in regards to function documentation.

Also: I had to apply the directory for $path_cactilog twice during installation, before it got picked up and the next installation step gets started. However, this was also the case before applying this patch.

@dvzrv
Copy link
Contributor Author

dvzrv commented Apr 28, 2019

To give some insight as to how this looks like in cacti.log:

2019/04/29 01:00:01 - ERROR PHP CORE_WARNING: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib/php/modules/mysqlnd (/usr/lib/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib/php/modules/mysqlnd.so (/usr/lib/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory)) in file: Unknown on line: 0
2019/04/29 01:00:01 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
2019/04/29 01:00:01 - ERROR PHP CORE_WARNING: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib/php/modules/mysqlnd (/usr/lib/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib/php/modules/mysqlnd.so (/usr/lib/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory)) in file: Unknown on line: 0
2019/04/29 01:00:01 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
2019/04/29 01:00:02 - SYSTEM STATS: Time:1.5330 Method:cmd.php Processes:1 Threads:N/A Hosts:1 HostsPerProcess:1 DataSources:5 RRDsProcessed:5                                       
2019/04/29 01:00:03 - ERROR PHP CORE_WARNING: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib/php/modules/mysqlnd (/usr/lib/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib/php/modules/mysqlnd.so (/usr/lib/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory)) in file: Unknown on line: 0
2019/04/29 01:00:03 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
2019/04/29 01:00:03 - ERROR PHP CORE_WARNING: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib/php/modules/mysqlnd (/usr/lib/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib/php/modules/mysqlnd.so (/usr/lib/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory)) in file: Unknown on line: 0
2019/04/29 01:00:03 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
2019/04/29 01:00:03 - ERROR PHP CORE_WARNING: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib/php/modules/mysqlnd (/usr/lib/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib/php/modules/mysqlnd.so (/usr/lib/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory)) in file: Unknown on line: 0
2019/04/29 01:00:03 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())
2019/04/29 01:00:03 - AUTOM8 [PID: 18834] Network Discover is now running for Subnet Range '1'                                                                                       
2019/04/29 01:00:04 - ERROR PHP CORE_WARNING: PHP Startup: Unable to load dynamic library 'mysqlnd' (tried: /usr/lib/php/modules/mysqlnd (/usr/lib/php/modules/mysqlnd: cannot open shared object file: No such file or directory), /usr/lib/php/modules/mysqlnd.so (/usr/lib/php/modules/mysqlnd.so: cannot open shared object file: No such file or directory)) in file: Unknown on line: 0
2019/04/29 01:00:04 - CMDPHP PHP ERROR Backtrace:  (CactiShutdownHandler())

Can we assume, that mysqlnd could probably be filtered?

@netniV netniV merged commit 8a23ca3 into Cacti:develop Apr 29, 2019
netniV added a commit that referenced this pull request Apr 29, 2019
@netniV
Copy link
Member

netniV commented Apr 30, 2019

So I merged this, rolled it back and applied a patch containing all the changes to the 13 branch (including the earlier #2643 changes and some other minor ones that @cigamit had done).

However, on my Ubuntu system, the poller suddenly started to generate a time exceed warning and as I didn't have the time to debug it I just disabled my test poller to prevent being spammed by mails.

Once I have the 1.2.4 release completed, I shall be revisiting it to see why but there's already an issue outstanding which makes me feel it was definitely the right choice to roll it back out for now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants