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

PHP Catchable fatal error: Argument 1 passed to ManualLogEntry::setPerformer() #1983

Closed
kghbln opened this Issue Nov 5, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@kghbln
Copy link
Member

commented Nov 5, 2016

Setup and configuration

  • MediaWiki 1.27.1 (8c593e7) 23:49, 26 October 2016
  • PHP 5.6.11-1ubuntu3.4 (apache2handler)
  • MySQL 5.6.31-0ubuntu0.15.10.1
  • Semantic MediaWiki 2.4.1 (af78257) 12:28, 12 July 2016

Issue

After the upgrade of smw.o from MW 1.25.6 to MW 1.27.1 suddenly the "rebuildPropertyStatistics.php" script starts to fail using the --with-maintenance-log parameter which I added yesterday:

Updated statistics for 686 Properties.
PHP Catchable fatal error:  Argument 1 passed to ManualLogEntry::setPerformer() must be an instance of User, boolean given, called in /.../w/extensions/SemanticMediaWiki/src/MediaWiki/ManualEntryLogger.php on line 69 and defined in /.../w/includes/logging/LogEntry.php on line 491

PHP Stack trace:

PHP   1. {main}() /.../w/extensions/SemanticMediaWiki/maintenance/rebuildPropertyStatistics.php:0
PHP   2. require_once() /.../w/extensions/SemanticMediaWiki/maintenance/rebuildPropertyStatistics.php:71
PHP   3. SMW\Maintenance\RebuildPropertyStatistics->execute() /.../w/maintenance/doMaintenance.php:103
PHP   4. SMW\Maintenance\MaintenanceLogger->log() /.../w/extensions/SemanticMediaWiki/maintenance/rebuildPropertyStatistics.php:53
PHP   5. SMW\MediaWiki\ManualEntryLogger->log() /.../w/extensions/SemanticMediaWiki/src/Maintenance/MaintenanceLogger.php:49
PHP   6. ManualLogEntry->setPerformer() /.../w/extensions/SemanticMediaWiki/src/MediaWiki/ManualEntryLogger.php:69

Since this happens right after its completion I suspect that something goes wrong when trying to add the logging information to the wikis log. I wonder why this did not happen on sandbox when it was using MW 1.27.x

@kghbln kghbln added the bug label Nov 5, 2016

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2016

Argument 1 passed to ManualLogEntry::setPerformer() must be an instance of User, boolean given,

Interesting, we do a [0]:

        if ( is_string( $performer) ) {
            $performer = User::newFromName( $performer );
        }

For now, I'm not sure why User::newFromName( 'RebuildPropertyStatisticsLogger' ) would return with a boolean instead of a user object. Maybe some extension blocks the creation of a user!?

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/MediaWiki/ManualEntryLogger.php#L65-L67

@kghbln

This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2016

Maybe some extension blocks the creation of a user!?

Up to yesterday I had ConfirmAccount installed but I kicked this since I think ReCAPTCHA v2 is good enough for the moment. All other extension are also present on sandbox. Hmm ... I wonder why this does not happen to "rebuildConceptCache.php".

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2016

Hmm ... I wonder why this does not happen to "rebuildConceptCache.php".

Exactly, the code in use is the same except for the name invoked.

$maintenanceLogger = $maintenanceFactory->newMaintenanceLogger( 'RebuildPropertyStatisticsLogger' );
$maintenanceLogger->log( $maintenanceHelper->transformRuntimeValuesForOutput() );
$maintenanceLogger = $maintenanceFactory->newMaintenanceLogger( 'RebuildConceptCacheLogger' );
$maintenanceLogger->log( $maintenanceHelper->transformRuntimeValuesForOutput() )
@kghbln

This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2016

Exactly, the code in use is the same except for the name invoked.

Indeed. Let's see what "rebuildData.php" is doing. About another 40 minutes to go...

@kghbln

This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2016

OMG, I found the cause in "LocalSettings.php":

$wgMaxNameChars = 30;

"RebuildPropertyStatisticsLogger" is 31 chars.

I am sorry for the confusion.

@kghbln kghbln closed this Nov 5, 2016

@mwjames

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2016

"RebuildPropertyStatisticsLogger" is 31 chars.

Nice.

@kghbln

This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2016

So we need a minimum of "32" due to #1781!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.