cache/index.php not found or unable to stat

I have this error:

[Fri May 18 16:38:30.827547 2018] [php7:error] [pid 21065] [client 10.192.192.80:49735] script ‘/mnt/vol01/suitecrm/cache/index.php’ not found or unable to stat, referer: https://site…/index.php?module=Users&action=EditView&record=19c0e37a-fe6b-f9cf-b578-4b9805d1d1b4
[Fri May 18 16:43:06.193122 2018] [php7:error] [pid 21543] [client 10.192.192.81:59666] script ‘/mnt/vol01/suitecrm/cache/index.php’ not found or unable to stat, referer: https://site…/cache/themes/SuiteP/css/Dawn/style.css?v=UdYXHyLulMVD07WeXHFoJw
[Fri May 18 16:45:42.213282 2018] [php7:error] [pid 21663] [client 10.192.192.80:52266] script ‘/mnt/vol01/suitecrm/cache/index.php’ not found or unable to stat, referer: https://site…/index.php?module=Home&action=index
[Fri May 18 16:47:49.301346 2018] [php7:error] [pid 22815] [client 10.192.192.80:53060] script ‘/mnt/vol01/suitecrm/cache/index.php’ not found or unable to stat, referer: https://site…/index.php?module=Home&action=index&parentTab=Principal
[Fri May 18 16:47:54.704631 2018] [php7:error] [pid 20879] [client 10.192.192.81:60895] script ‘/mnt/vol01/suitecrm/cache/index.php’ not found or unable to stat, referer: https://site…/cache/themes/SuiteP/css/Dawn/style.css?v=UdYXHyLulMVD07WeXHFoJw

There is no index.php on cache/ !
I think this is the cause for error 502.

I have SuiteCRM 7.10.4/PHP7.2.4

Hi! :slight_smile:

Is this a newly installed server? I have seen these errors “unable to stat” be caused by a missing PHP module called “fileinfo”. This can be enabled in php.ini.

1 Like

Yes it is a new server but it has fileinfo enabled:

fileinfo support enabled
version 1.0.5
libmagic 531

Maybe this problem with hosts file?

https://serverfault.com/questions/185954/hosts-file-entries-for-multiple-domains-on-vps

I also wonder if your PHP version might be causing trouble, it’s very new and so it is less tested than others…

1 Like

I was also seeing that right now!

I’ll pass to systems staff and wait…

Thank you!

Changing hosts didn’t resolve.

Maybe is the PHP version…

If you can please try with an earlier PHP, tell me if it worked.

Once we know it’s caused by PHP version we can focus on fixing this particular compatibility issue, since we want to support PHP 7.2. Thanks

I am having the same errors in my logs. This ordinarily wouldn’t be as big an issue but we use automated blocking for repeated 404 requests which effectively locks out our users from the entire system after a couple minutes in suitecrm. There is no index.php in the cache folder and my logs are also showing the request originating from css files. Would it be a short term fix to put an empty index.php file in the cache directory or could that cause further issues?

SuiteCRM version 7.10.4.
PHP 7.0.30-0ubuntu0.16.04.1

@criterion9: try it and tell us if it worked.

We could also try and really check your permissions on the cache directory. Permissions for new files are inherited from the parent directory, according to the SetUID and SetGID bits. Sometimes people don’t check these small permissions details, and so they think they have enough access, when reality they don’t.

www-data is both owner and group on the directory and has 77x access.

I will add an empty php file to the cache directory and see if that clears it up. I was wondering if there maybe used to be an index.php file in there that the css files were utilizing for something…

See how you totally ignored what I said about permissions? You don’t even mention the SetGID and SetUID bits… :slight_smile: Try 2770 for the cache directory, if it’s not already like that.

If you put an index.php file in the cache directory, don’t use an empty one, copy the one from your SuiteCRM root instead

ls -la on the directory:

drwxrwsr-x 3 www-data www-data 4096 Jul 4 2017 cache

I wouldn’t add the index.php from the install root as it will then include/execute code that is unneeded. I added an index.php with no output so the file can be stat’ed but not open any security risks by executing anything.

The error is in the css files…when they are copied to the cache folder their depth is increased by the actual files have relative references to index.php to get theme information…

“suitcrm install directory”/cache/themes/SuiteP/css/Day/style.css?v=fanKYIfrReXKmKQhun2xZA

url("…/…/…/…/…/index.php?entryPoint=getImage&themeName=SuiteP&themeName=SuiteP&imageName=p_create_arrow.svg")

https://ibb.co/jgQW0y

So on a single page load we get multiple 404 errors when those lines get hit. I guess I should submit as a bug but I’m not familiar enough with the caching process to create a patch for it.

1 Like

In style.css there is url(…/…/…/…/index.php and url(…/…/…/…/…/index.php

I think all must be url(…/…/…/…/…/index.php

This also appears to be a consistent issue between the different sub-themes. Has a bug already been entered for this on github?

I don’t think there is a GitHub issue for this yet… but I can’t be 100% sure.

Do you have any explanation for why such a bug would only hit a couple of users, instead of all of them?

My guess would be that until a rebuild the css files aren’t impacted (or some other concurrency or caching thing). Additionally, I only became aware because of a security tool we use and wouldn’t have paid much mind to 404 entries in the log otherwise.

Ok, please open an issue for this on GitHub. Thanks for reporting!

Thanks for the help in troubleshooting. I opened an issue others can follow to see when a fix is issued: https://github.com/salesagility/SuiteCRM/issues/5950

2 Likes