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

Bug: AH01075: Error dispatching request on Basic CI4 #3110

Closed
isantolin opened this issue Jun 17, 2020 · 20 comments
Closed

Bug: AH01075: Error dispatching request on Basic CI4 #3110

isantolin opened this issue Jun 17, 2020 · 20 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@isantolin
Copy link

isantolin commented Jun 17, 2020

Describe the bug
The basic Codeigniter 4 without any configuration and a Server with default configuration (That works with Codeigniter 3) Cant load and shows 503 error

CodeIgniter 4 version
v4.0.3

Affected module(s)
Codeigniter

Expected behavior, and steps to reproduce if appropriate

  • Put Basic Codeigniter on /Apache directory
  • point DocumentRoot to /Apache/public
  • Point the browser to: http://localhost (Delays more than 10 seconds to load) and...
  • The following error will appear
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
[Tue Jun 16 21:51:05.886556 2020] [proxy_fcgi:error] [pid 937802:tid 140579791218432] [client ::1:34246] AH01067: Failed to read FastCGI header
[Tue Jun 16 21:51:05.886598 2020] [proxy_fcgi:error] [pid 937802:tid 140579791218432] (104)Connection reset by peer: [client ::1:34246] AH01075: Error dispatching request to :
[Tue Jun 16 21:53:09.284478 2020] [proxy_fcgi:error] [pid 937802:tid 140579681842944] [client ::1:34798] AH01067: Failed to read FastCGI header
[Tue Jun 16 21:53:09.284563 2020] [proxy_fcgi:error] [pid 937802:tid 140579681842944] (104)Connection reset by peer: [client ::1:34798] AH01075: Error dispatching request to : 

Context

  • OS: Fedora 32
  • Web server: Apache 2.4.43
  • PHP-FPM: 7.4.7
@isantolin isantolin added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 17, 2020
@paulbalandan
Copy link
Member

Is this still an issue?

If yes, have you tried giving permissions to php to write in the writable folder?

@isantolin
Copy link
Author

@paulbalandan Now showing :

( ! ) Fatal error: Uncaught Error: Maximum function nesting level of '256' reached, aborting! in /var/www/html/project-root/vendor/codeigniter4/framework/system/Config/BaseService.php on line 195

(Same configuration)

@paulbalandan
Copy link
Member

Have you tried upgrading to the latest version?

@isantolin
Copy link
Author

Have you tried upgrading to the latest version?

yes, i am using the last version

@paulbalandan
Copy link
Member

@paulbalandan Now showing :

( ! ) Fatal error: Uncaught Error: Maximum function nesting level of '256' reached, aborting! in /var/www/html/project-root/vendor/codeigniter4/framework/system/Config/BaseService.php on line 195

(Same configuration)

This is a problem with the xdebug extension. It seems BaseService has entered infinite recursion. Can you post a screenshot of the error page?

@isantolin
Copy link
Author

@paulbalandan
image

@michalsn
Copy link
Member

Please, edit your php.ini file and increase value for xdebug.max_nesting_level

@isantolin
Copy link
Author

@michalsn Xdebug not installed

(base) [root@airwave7 php.d]# php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imagick
intl
json
libxml
mbstring
mcrypt
memcache
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
uopz
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

@paulbalandan
Copy link
Member

How is that possible? That error page is produced by xdebug

@paulbalandan
Copy link
Member

@isantolin can you try changing BaseService on lines 191 to 201 and changing to the following. See diff:

        public static function __callStatic(string $name, array $arguments)
	{
		$name = strtolower($name);

-		if (method_exists(Services::class, $name))
+		if (method_exists(static::class, $name))
		{
-			return Services::$name(...$arguments);
+			return static::$name(...$arguments);
		}

		return static::discoverServices($name, $arguments);
	}

Please see if that solves your issue?

@isantolin
Copy link
Author

@paulbalandan Not yet

image

@isantolin
Copy link
Author

image

@paulbalandan
Copy link
Member

@paulbalandan Not yet

image

At least that solves the function nesting issue. Can you try using the latest develop branch? Line 139 on system/bootstrap.php on mine is a whitespace only.

@isantolin
Copy link
Author

@paulbalandan I tryied with the development version. Old error returns

image

@paulbalandan
Copy link
Member

Yes that is expected because it will overwrite your changes. Trying changing it again to use static.

@isantolin
Copy link
Author

@paulbalandan Yes, i tried

image

@paulbalandan
Copy link
Member

@isantolin i'm sorry i think this is a bug in PHP already. __callStatic should only be called when the static method is not present in a class. In your case, however, __callStatic is ALWAYS called even though the static method is existing in the class. autoloader and discoverServices are, as you can see, defined static methods, so calling those should invoke them directly, not going through __callStatic. This causes the infinite recursion error you are facing.

Have you tried in php other than php-fpm?

@isantolin
Copy link
Author

@paulbalandan no, because all my server infraestructure is based in php-fpm and CI4 needs to be compatible.
Exists any workaround to deal with this bug?

@paulbalandan
Copy link
Member

I'm sorry I'm not well versed with php-fpm. Can you try opening a bug report to the PHP core?

@paulbalandan
Copy link
Member

Since this is not a framework issue, I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

3 participants