Phpmyadmin 500 internal server error with big number of tables - php

I have database with lots of tables in it, when I try to navigate the tables list I ma getting a 500 error from phpmyadmin
this is the related error in the apache log
[proxy_fcgi:error] [pid 14770] [client 94.130.127.152:20932] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to PhpMyAdmin\\DatabaseInterface::dataSeek() must be of the type int, string given, called in /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php on line 488
and defined in /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/DatabaseInterface.php:2730
Stack trace:
#0 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php(488): PhpMyAdmin\\DatabaseInterface->dataSeek()
#1 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php(514): PhpMyAdmin\\Navigation\\Nodes\\NodeDatabase->getTablesOrViews()
#2 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/Nodes/NodeDatabase.php(373): PhpMyAdmin\\Navigation\\Nodes\\NodeDatabase->getTables()
#3 /var/www/html/phpMyAdmin-5.0.1-all-languages/libraries/classes/Navigation/NavigationTree.php(400): PhpMyAdmin\\Navigation\\Nodes\\NodeDatabase->getDa...'
centos7
php7.4
directadmin 1.6
mysql 5.7
php1_release 5.6
php1_mode mod_php
php2_release 7.4
php2_mode php-fpm
my php1_release is php5.6 but since phpmyadmin required php7.2+ I manually changed the handler to point to the php 7.4 fpm socket
I am guesting that some resources are low on the php size which causing this error because its working just fine in my other server ...
so what config do I need to change?

Tanks to #MagnusEriksson here is the solution :
https://github.com/phpmyadmin/phpmyadmin/issues/15772
https://github.com/phpmyadmin/phpmyadmin/commit/6981910c8c2c2fd1aaa515c2a37459e68a3740e3
in libraries/classes/Navigation/NavigationTree.php:129
$this->pos2Value[0] = (int) $_REQUEST['pos2_value'];
just add the cast to int

Related

Symfony Monolog container error once every 500 requests

Since upgrading to PHP 8.1, Symfony 6.1, Monolog 3.2, I have been seeing a PHP fatal error while constructing the Symfony DI container:
2022/12/12 04:10:02 [error] 31#31: *919 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: Monolog\Logger::getLevelName(): Argument #1 ($level) must be of type Monolog\Level|int, Symfony\Bridge\Monolog\Handler\ConsoleHandler given, called in /app/vendor/monolog/monolog/src/Monolog/Logger.php on line 196 and defined in /app/vendor/monolog/monolog/src/Monolog/Logger.php:437
Stack trace:
#0 /app/vendor/monolog/monolog/src/Monolog/Logger.php(196): Monolog\Logger::getLevelName()
#1 /app/var/cache/prod/ContainerOqglp2q/App_KernelProdContainer.php(1441): Monolog\Logger->pushHandler()
#2 /app/var/cache/prod/ContainerOqglp2q/App_KernelProdContainer.php(1103): ContainerOqglp2q\App_KernelProdContainer->getMonolog_Logger_RequestService()
#3 /app/vendor/symfony/dependency-injection/Container.php(218): ContainerOqglp2q\App_KernelProdContainer->getHttpKernelService()
#4 /app/vendor/symfony/dependency-injection/Container.php(198): Symfony\Component\DependencyInjection\Container->make()
#5 /app/vendor/symfony/http-kernel/Kernel.php(195): Symfony\Compone" while reading response header from upstream, client: 172.27.0.16, server: _, request: "POST /job-engine-client/execute HTTP/1.0", upstream: "fastcgi://192.168.64.5:9000", host: "x"
I have not been able to reproduce the error manually, as it only happens in my staging environment, and very inconsistent.
It is currently only visible in HTTP requests triggered by a cronjob every 5 minutes. In the past 4 days, it only happened 2 times.
The application is deployed using docker compose, with a custom Ubuntu Dockerfile.
The application is deployed to multiple hosts, and shows the same random occurence of errors on each host.
When looking at the Monolog Logger.php file, it is really hard to understand how the stack trace that is logged can be ever triggered.
I'm suspecting some kind of PHP opcache or JIT issue, or perhaps an issue with the docker filesystem returning some other cached (older) versions of files.
Has anyone seen similar errors, or perhaps other suggestions how to debug & resolve this issue?

Unable to Launch Octane RoadRunner Server for PHP 8.0

Octane is installed with roadrunner while following the official guide, on the Ubuntu 18.04 server. Each step works as expected until the server is started:
php artisan octane:start --server=roadrunner --port=8181
Then, an error is received and the command exits. The complete stacktrace is attached:
INFO Server running…
Local: http://127.0.0.1:8181
Press Ctrl+C to stop the server
INFO [INFO] RoadRunner server started; version: 2.6.3, buildtime: 2021-12-03T11:37:00+0000
PHP Warning: require(/path/vendor/bin/bootstrap.php): Failed to open stream: No such file or directory in /path/vendor/bin/roadrunner-worker on line 18
PHP Fatal error: Uncaught Error: Failed opening required '/path/vendor/bin/bootstrap.php' (include_path='.:/usr/share/php') in /path/vendor/bin/roadrunner-worker:18
Stack trace:
#0 {main}
thrown in /path/vendor/bin/roadrunner-worker on line 18
INFO error occurred: WorkerAllocate:
INFO goridge_frame_receive: EOF, plugin: http.Plugin
ERROR 2021-12-07T12:01:53.048Z ERROR container/poller.go:16 vertex got an error {"id": "http.Plugin", "error": "WorkerAllocate:\n\tgoridge_frame_receive: EOF"}
ERROR github.com/spiral/endure/pkg/container.(*Endure).poll.func1
ERROR github.com/spiral/endure#v1.0.10/pkg/container/poller.go:16
ERROR handle_serve_command: WorkerAllocate:
ERROR goridge_frame_receive: EOF
Since roadrunner is based on go, I don't have much insights on how to navigate through the error. Please let me know if anyone has solved this issue before, thanks.
You should fix all warnings like this one: PHP Warning: require(/path/vendor/bin/bootstrap.php): Failed to open stream: No such file or directory in /path/vendor/bin/roadrunner-worker on line 18
These warnings appear in the stdout, but stdout is used as a process fd to communicate with the RR. That means if some data is sent to the stdout (like PHP warning) before RR initializes all processes (aka worker), RR will stop allocating the workers and exit with code 1.

Clean wordpress instalation first load problem php7.4

I just downloaded wordpress, copied it to ISPConfig vhost, with php7.4-fpm and got this error when I want to first load WP and configure DB connection.
[proxy_fcgi:error] [pid 14720] [client 62.109.143.214:39852] AH01071:
Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to
undefined function wp_guess_url() in
/var/www/clients/client1/web31/web/wp-load.php:56\nStack trace:\n#0
/var/www/clients/client1/web31/web/wp-blog-header.php(13):
require_once()\n#1 /var/www/clients/client1/web31/web/index.php(17):
require('/var/www/client...')\n#2 {main}\n thrown in
/var/www/clients/client1/web31/web/wp-load.php on line 56'
PHP7.4-FPM is working I tested it on another site where I already have WordPress and it is working.
Seems like my linux has corrupted or bugged "Ark" (Archiving Tool) and it was not able to extract all datas.
I downloaded WordPress with wget on server and copied to webroot and it works now. Thanks #cobrerahector for tip.

Drush cim command causing PHP fatal error on windows machine

When running drush cim/cr commands in a Drupal 8 (core 8.5.5) project i get the following error:
Fatal error: Default value for parameters with a class type hint can only be NULL in E:\Work\EmakinaCH\IheidCH\web\modules\contrib\search_api_solr\src\Plugin\search_api\backend\SearchApiSolrBackend.php on line 2669
[error] Drush command terminated abnormally due to an unrecoverable error.
Error: Default value for parameters with a class type hint can only be NULL in E:\Work\EmakinaCH\IheidCH\web\modules\contrib\search_api_solr\src\Plugin\search_api\backend\SearchApiSolrBackend.php, line 2669
And here's the aforementioned line of code
protected function flattenKeys($keys, array $fields = [], string $parse_mode_id = 'phrase') {
This error only occurs on one test machine which is running Win10 + Wamp 64-bit version 3.1.0, regardless of which php version is run on it 5.6, 7.0 or 7.1.9. On any other linux machine i use there are no issues.
Anyone know how to fix this, or what is the cause of this error?
Thanks

Mantis SOAP-Error accessing mantisconnect.php (Eclipse Mylyn-Plugin)

I installed Mantis BT 1.2.19 on my server and it works well. To benefit from it in my Eclipse-IDE (Mars) I installed the Task-Repo Plugin for Mantis and tried to add the connection.
When I click on "Validate settings" in Eclipse I get the following error:
SOAP-ERROR: Parsing WSDL: Couldn't load from '/var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.wsdl' : failed to load external entity "/var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.wsdl"
In my error-log on the server are the following entries
[14-Oct-2015 11:25:05 Europe/Berlin] [mantisconnect.php] Error Type: SYSTEM WARNING,
Error Description: SoapServer::SoapServer(): I/O warning : failed to load external entity "/var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.wsdl"
Stack Trace:
mantisconnect.php L121 SoapServer(<string>'mantisconnect.wsdl', <Array> { ['features'] => 5 })
[14-Oct-2015 11:25:05 Europe/Berlin] PHP Warning: Uncaught SoapFault exception: [Server] Error Type: SYSTEM WARNING,
Error Description: SoapServer::SoapServer(): I/O warning : failed to load external entity "/var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.wsdl" in /var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mc_api.php:107
Stack trace:
#0 /var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mc_api.php(530): SoapActions::sendSoapFault('Server', 'Error Type: SYS...')
#1 [internal function]: mc_error_handler(2, 'SoapServer::Soa...', '/var/www/vhosts...', 121, Array)
#2 /var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.php(121): SoapServer->SoapServer('mantisconnect.w...', Array)
#3 {main}
thrown in /var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mc_api.php on line 107
[14-Oct-2015 11:25:05 Europe/Berlin] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from '/var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.wsdl' : failed to load external entity "/var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.wsdl"
in /var/www/vhosts/{myhost}/httpdocs/mantis/api/soap/mantisconnect.php on line 121
The errors above are produced by the Mantis plugin on accessing the URL
188.109.171.76 - - [14/Oct/2015:11:25:05 +0200] "POST /mantis/api/soap/mantisconnect.php HTTP/1.0" 500 1067 "-" "Mylyn/3.17.0 Mylyn-Mantis Connector/3.10.1 Apache Axis/1.4 Eclipse (org.eclipse.epp.package.jee.product) HttpClient/3.1 Java/1.8.0_60 (Oracle) Windows 7/6.1 (amd64; de_DE)"
But even a "normal" GET-access to the URL mentioned above produces the same error
https://{myhost}/mantis/api/soap/mantisconnect.php
No error is produced on accessing
https://{myhost}/mantis/api/soap/mantisconnect.php?wsdl
To solve the problem on my own I checked several ideas:
The file IS existant ... {myhost} is just a placeholder here obviously - placed by me
I switched to the context of the webserver www-data and tried accessing the file ... it IS accessible
So I´ve no idea...
PHP version is 5.5.9-1ubuntu4.13 on Ubuntu 14.04.3 LTS
€dit:
Tracked down the error to the following PHP-line in mantis/api/soap/mantisconnect.php
$server = new SoapServer("mantisconnect.wsdl",
array('features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS)
);
I don´t understand why there an error is thrown - because as I said: it exists and is readable by the webserver...
€edit2:
I replaced the line
$server = new SoapServer("mantisconnect.wsdl",
with
$server = new SoapServer("http://{myhost}/mantis/api/soap/mantisconnect.wsdl",
THIS works... so I´ve a "solution" but I don´t know why the access via file does not work
I Think I found the answere on my own (my workaround failed some hours later - with same error again).
Seems to be a bug in PHP (on Ubuntu) as mentioned here
https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1160336
Unresolved since 2013
:-(
My current workaround is disabling soap.wsdl_cache_enabled in php.ini which seems to help for the moment.

Categories