modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

xPDOObject::load passed with modX, not xPDO #10369

Open ReSpawN opened 10 years ago

ReSpawN commented 10 years ago

ReSpawN created Redmine issue ID 10369

I've got the following start up error:


string(91) "Argument 1 passed to xPDOObject::load() must be an instance of xPDO, instance of modX given"

Fatal error: Class 'xPDO' not found (...)/core/model/modx/error/moderrorhandler.class.php on line 112

It happens somewhere along the first loads of MODX, somewhere within the loading of the user or the retrieval of the session. These 3 queries are executed before this error occurs. Yes, while this is a recoverable error, modX is undefined within the log function, thus it's can't recover from the error. modX::LOG_LEVEL_ERROR isn't defined yet, (as the error occurs in the __construct of modX), but xPDO is, however, errors aren't logged via xPDO.

Note: This is perfectly debuggable.

Create a Plugin

Enter the code as it's snippet content:
<?php exit(); 

Only fire it "OnWebPageInit"

Refresh the front-end of MODX

Tadaa, error.

These 3 queries are performed in boot-up.


 [2013-12-09 13:09:29] (ERROR @ /connectors/system/errorlog.php) Array
(
    [command] => SELECT
    [distinct] => 
    [columns] => Array
        (
            [0] => `modSession`.`id` AS `modSession_id`
            [1] => `modSession`.`access` AS `modSession_access`
            [2] => `modSession`.`data` AS `modSession_data`
        )

    [from] => Array
        (
            [tables] => Array
                (
                    [0] => Array
                        (
                            [table] => `modx_session`
                            [alias] => modSession
                        )

                )

            [joins] => Array
                (
                )

        )

    [set] => Array
        (
        )

    [where] => Array
        (
            [0] => Array
                (
                    [0] => xPDOQueryCondition Object
                        (
                            [sql] => `modSession`.`id` = ?
                            [binding] => Array
                                (
                                    [value] => 1541tf5pphu9hmqcii42bu8vr5
                                    [type] => 2
                                    [length] => 0
                                )

                            [conjunction] => AND
                        )

                )

        )

    [groupby] => Array
        (
        )

    [having] => Array
        (
        )

    [orderby] => Array
        (
        )

    [offset] => 
    [limit] => 
    [priority] => 
)

SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = '1541tf5pphu9hmqcii42bu8vr5' 

[2013-12-09 13:09:30] (ERROR @ /connectors/system/errorlog.php) Array
(
    [command] => SELECT
    [distinct] => 
    [columns] => Array
        (
            [0] => `modSession`.`id` AS `modSession_id`
            [1] => `modSession`.`access` AS `modSession_access`
            [2] => `modSession`.`data` AS `modSession_data`
        )

    [from] => Array
        (
            [tables] => Array
                (
                    [0] => Array
                        (
                            [table] => `modx_session`
                            [alias] => modSession
                        )

                )

            [joins] => Array
                (
                )

        )

    [set] => Array
        (
        )

    [where] => Array
        (
            [0] => Array
                (
                    [0] => xPDOQueryCondition Object
                        (
                            [sql] => `modSession`.`id` = ?
                            [binding] => Array
                                (
                                    [value] => 1541tf5pphu9hmqcii42bu8vr5
                                    [type] => 2
                                    [length] => 0
                                )

                            [conjunction] => AND
                        )

                )

        )

    [groupby] => Array
        (
        )

    [having] => Array
        (
        )

    [orderby] => Array
        (
        )

    [offset] => 
    [limit] => 
    [priority] => 
)

SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = '1541tf5pphu9hmqcii42bu8vr5' 

[2013-12-09 13:09:30] (ERROR @ /connectors/system/errorlog.php) Array
(
    [command] => SELECT
    [distinct] => 
    [columns] => Array
        (
            [0] => `modUser`.`id` AS `modUser_id`
            [1] => `modUser`.`username` AS `modUser_username`
            [2] => `modUser`.`password` AS `modUser_password`
            [3] => `modUser`.`cachepwd` AS `modUser_cachepwd`
            [4] => `modUser`.`class_key` AS `modUser_class_key`
            [5] => `modUser`.`active` AS `modUser_active`
            [6] => `modUser`.`remote_key` AS `modUser_remote_key`
            [7] => `modUser`.`remote_data` AS `modUser_remote_data`
            [8] => `modUser`.`hash_class` AS `modUser_hash_class`
            [9] => `modUser`.`salt` AS `modUser_salt`
            [10] => `modUser`.`primary_group` AS `modUser_primary_group`
            [11] => `modUser`.`session_stale` AS `modUser_session_stale`
            [12] => `modUser`.`sudo` AS `modUser_sudo`
        )

    [from] => Array
        (
            [tables] => Array
                (
                    [0] => Array
                        (
                            [table] => `modx_users`
                            [alias] => modUser
                        )

                )

            [joins] => Array
                (
                )

        )

    [set] => Array
        (
        )

    [where] => Array
        (
            [0] => Array
                (
                    [0] => xPDOQueryCondition Object
                        (
                            [sql] => `modUser`.`id` = ?
                            [binding] => Array
                                (
                                    [value] => 1
                                    [type] => 1
                                    [length] => 0
                                )

                            [conjunction] => AND
                        )

                )

        )

    [groupby] => Array
        (
        )

    [having] => Array
        (
        )

    [orderby] => Array
        (
        )

    [offset] => 
    [limit] => 
    [priority] => 
)

SELECT `modUser`.`id` AS `modUser_id`, `modUser`.`username` AS `modUser_username`, `modUser`.`password` AS `modUser_password`, `modUser`.`cachepwd` AS `modUser_cachepwd`, `modUser`.`class_key` AS `modUser_class_key`, `modUser`.`active` AS `modUser_active`, `modUser`.`remote_key` AS `modUser_remote_key`, `modUser`.`remote_data` AS `modUser_remote_data`, `modUser`.`hash_class` AS `modUser_hash_class`, `modUser`.`salt` AS `modUser_salt`, `modUser`.`primary_group` AS `modUser_primary_group`, `modUser`.`session_stale` AS `modUser_session_stale`, `modUser`.`sudo` AS `modUser_sudo` FROM `modx_users` AS `modUser` WHERE `modUser`.`id` = 1
ReSpawN commented 10 years ago

ReSpawN submitted:

In addition, while these errors are generated out of the errorlog.php, I've traced the error further back to modsessionhandler.class.php, perhaps a good starting point for debugging.

ReSpawN commented 10 years ago

ReSpawN submitted:

Update...

I've read a couple of posts concerning this problem, but almost all didn't seem to work. Clearing the cache, reuploading core files -- nothing did the trick... until I disabled APC in the php.ini. Not really a decent solution if you ask me, but it works -- for now.

Idea's came from this post: http://forums.modx.com/thread/75601/catchable-fatal-error-xpdoobject-load#dis-post-418871

;extension=apc.so Dat epix fiks.

Thank god for our FGCI PHP per-user php.ini.