Bug 863429

Summary: Apache logs are growing to gigabytes in size
Product: [Fedora] Fedora Reporter: Michael Cronenworth <mike>
Component: gallery2Assignee: Gwyn Ciesla <gwync>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: gwync
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 16:00:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
php.ini
none
error_log text from one web page view attempt none

Description Michael Cronenworth 2012-10-05 13:07:15 UTC
Description of problem: My error_log from Apache has grown huge due to PHP messages output from gallery2.
# du -sh gallery*error_log*
1.6G	gallery.cronenworth.com-error_log
4.1G	gallery.cronenworth.com-error_log-20120909
4.9G	gallery.cronenworth.com-error_log-20120916
5.2G	gallery.cronenworth.com-error_log-20120923
4.8G	gallery.cronenworth.com-error_log-20120930


Version-Release number of selected component (if applicable):
gallery2-2.3.2-2.fc17.noarch


Additional info: Sample log output:
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryCoreApi::getPluginParameter() should not be called statically in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 3078
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryCoreApi::requireOnce() should not be called statically in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 300
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryPluginHelper_simple::getParameter() should not be called statically in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 302
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryPluginHelper_simple::_fetchAllParameters() should not be called statically in /usr/share/gallery2/modules/core/classes/helpers/GalleryPluginHelper_simple.class on line 222
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryDataCache::containsKey() should not be called statically in /usr/share/gallery2/modules/core/classes/helpers/GalleryPluginHelper_simple.class on line 281
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryDataCache::_getCache() should not be called statically in /usr/share/gallery2/modules/core/classes/GalleryDataCache.class on line 203
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryDataCache::get() should not be called statically in /usr/share/gallery2/modules/core/classes/helpers/GalleryPluginHelper_simple.class on line 282
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryDataCache::_getCache() should not be called statically in /usr/share/gallery2/modules/core/classes/GalleryDataCache.class on line 186
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryUtilities::prefixFormVariable() should not be called statically, assuming $this from incompatible context in /usr/share/gallery2/modules/core/classes/GallerySession.class on line 986
[Fri Oct 05 08:00:51 2012] [error] [client 66.249.73.234] PHP Strict Standards:  Non-static method GalleryUtilities::prefixFormVariable() should not be called statically, assuming $this from incompatible context in /usr/share/gallery2/modules/core/classes/GallerySession.class on line 993

Comment 1 Gwyn Ciesla 2012-10-05 14:56:45 UTC
Do you have any custom php.ini settings or gallery2 configs set?  Like Strict?

Comment 2 Michael Cronenworth 2012-10-05 15:17:25 UTC
Created attachment 622271 [details]
php.ini

I do not have any settings that should be enabling this output. I have attached my /etc/php.ini file. I do not have a custom php.ini file for gallery2.

The only setting I have changed is to allow larger file upload sizes.

Comment 3 Gwyn Ciesla 2012-10-05 15:27:17 UTC
See if, in modules/core/classes/Gallery.class, changing line 672 from

error_reporting(E_ALL &~ 2048);

to

error_reporting(E_ALL ^ E_STRICT);

helps.

Comment 4 Michael Cronenworth 2012-10-05 15:36:15 UTC
I changed the line and restarted Apache just in case. The error log is still being filled with the same messages.

Comment 5 Gwyn Ciesla 2012-10-05 15:39:37 UTC
Try

error_reporting(0);

Comment 6 Michael Cronenworth 2012-10-05 15:42:12 UTC
Same as comment #4.

Comment 7 Gwyn Ciesla 2012-10-05 15:55:17 UTC
Is there a pattern to the function names in the logs?  I'd like to determine how many we might be talking about, which will determine the complexity of the patch.

Comment 8 Michael Cronenworth 2012-10-05 16:17:52 UTC
Created attachment 622291 [details]
error_log text from one web page view attempt

The only pattern I see is that every line contains "... PHP Strict Standards:  Non-static method [method] should not be called statically in [filename] on line ###" or "... PHP Strict Standards:  Non-static method [method] should not be called statically, assuming $this from incompatible context in [filename] on line ###".

I have caught the log text for one web page browse attempt: Over 2MB. I will attach it as XZ-compressed.

Comment 9 Gwyn Ciesla 2012-10-05 16:21:54 UTC
Try changing init.inc, starting at line 254, from

    $errorType = array(
        E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error',
        E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning',
        E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning',
        E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning',
        E_USER_NOTICE => 'User Notice',
        /* PHP5+: E_STRICT => 'Runtime Notice' */
        /* PHP5.2+: E_RECOVERABLE_ERROR => 'Catchable Fatal Error' */
        );

to:

    $errorType = array(
        E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error',
        E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning',
        E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning',
        E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning',
        E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice',
        E_RECOVERABLE_ERROR => 'Catchable Fatal Error'
        );

Comment 10 Michael Cronenworth 2012-10-05 16:27:35 UTC
(In reply to comment #9)
> Try changing init.inc, starting at line 254, from

No difference.

Comment 11 Michael Cronenworth 2012-10-09 02:08:43 UTC
I found a workaround. Adding the following value to my .htaccess (which is currently empty) has stopped the strict error messages:

php_value error_reporting 30719

Comment 12 Gwyn Ciesla 2012-10-09 17:08:33 UTC
Interesting.  Do you think this should be a default?

Comment 13 Michael Cronenworth 2012-10-09 19:52:28 UTC
My first suggestion would be for upstream to fix their code. If they consider G2 to be closed to development then I guess adding a .htaccess variable is the next best thing. Note that G2 does utilize the .htaccess file in some modules such as the Apache rewrite module.

Comment 14 Gwyn Ciesla 2012-10-10 12:39:34 UTC
Upstream is totally focused on G3 now, so I'll add this to the included htaccess.

Comment 15 Fedora Update System 2012-10-10 12:55:58 UTC
gallery2-2.3.2-4.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/gallery2-2.3.2-4.fc18

Comment 16 Fedora Update System 2012-10-10 12:56:08 UTC
gallery2-2.3.2-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gallery2-2.3.2-4.fc17

Comment 17 Fedora Update System 2012-10-10 18:06:54 UTC
Package gallery2-2.3.2-4.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gallery2-2.3.2-4.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-15804/gallery2-2.3.2-4.fc18
then log in and leave karma (feedback).

Comment 18 Fedora Update System 2012-12-20 16:00:04 UTC
gallery2-2.3.2-4.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.