New Matrix install getting a getSpecialPage() Fatal Error


(Nic Hubbard) #1

I have new client site that I built, and they are getting fatal errors when trying to do things like, create new files under a design, or add a new user to a user group. Here is the error when creating a user:

    Fatal error: Call to undefined method User_Group::getSpecialPage() in /home/websites/squiz_matrix/core/include/asset_manager.inc on line 7984


And when creating a file under a design:

    Fatal error: Call to undefined method Design::getSpecialPage() in /home/websites/squiz_matrix/core/include/asset_manager.inc on line 7984


Any ideas why this would be happening? I have never seen this occur before on any of my installs. This is on 4.8.0.

(Edison Wang) #2

That error happens when getLineageFromURL() function in asset manager is given a URL to find all assets in lineages.
e.g

given url:

site.com/page1/page2

the function will return assets that matches URLs

site.com/page1/page2, site.com/page1, site.com



When it only finds one single lineage for a given URL, it will assume it as a root Site asset.

And then it will call getSpecialPage() fucntion to get more info, which is a particular function for Site asset.



But it appears that in this case, instead of a Site asset, it incorrectly found the User Group asset, Design asset as the matching lineage.

It shouldn't do that, because user group and design asset shouldn't have url at all.



Can you do a bit debugging for me?

In asset_manager.inc around line 7949, add 4 log dump calls for me. and then try replicate the error.

and then paste me the data it dumps to error log(data/private/logs/error.log). and then you can revert the log dump change.



That should tell me more about the scenario that leads to the error.


    
    
    try {
    			$query = MatrixDAL::preparePdoQuery($sql);
    			$result = MatrixDAL::executePdoAll($query);
    log_dump($url);
    log_dump($sql);
    log_dump($result);
    log_dump(get_backtrace());
    		} catch (Exception $e) {

(Nic Hubbard) #3

Thanks. Here is what it produces:

    [22-Mar-2012 10:04:08] 
    0: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7955): 
    173.255.208.95
    [22-Mar-2012 10:04:08] 
    1: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7956): 
    SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type
    				FROM sq_ast_lookup l
    				  INNER JOIN sq_ast a ON l.assetid = a.assetid
    				  INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
    				 WHERE  l.root_urlid = 5
    				  AND l.url IN (
    								'173.255.208.95'
    							)
    				GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
    				ORDER BY l.url ASC
    [22-Mar-2012 10:04:08] 
    2: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7957): 
    Array
    (
    [0] => Array
        (
            [url] => 173.255.208.95
            [0] => 173.255.208.95
            [assetid] => 71
            [1] => 71
            [name] => goodspace
            [2] => goodspace
            [short_name] => goodspace
            [3] => goodspace
            [type_code] => site
            [4] => site
            [status] => 16
            [5] => 16
            [protocol] => http
            [6] => http
            [link_type] => 1
            [7] => 1
        )
    
    )
    
    [22-Mar-2012 10:04:08] 
    3: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7958): 
    Array
    (
    [0] => function getLineageFromURL(line=177 class=asset_map object=Asset_Manager)
    [1] => function _getInitialLineageSelection(line=460 class=asset_map object=Asset_Map)
    [2] => function embedAssetMap(line=1279 class=backend object=Asset_Map)
    [3] => function _printSideNav(line=189 class=backend object=Backend)
    [4] => function paint(line=565 class=mysource object=Backend)
    [5] => function start(line=30 class=index object=MySource)
    )
    
    [22-Mar-2012 10:04:34] 
    0: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7955): 
    /_designs/vanilla-design
    [22-Mar-2012 10:04:34] 
    1: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7956): 
    SELECT l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, CASE WHEN l.http = '1' THEN 'http' ELSE 'https' END as protocol, MIN(al.link_type) AS link_type
    				FROM sq_ast_lookup l
    				  INNER JOIN sq_ast a ON l.assetid = a.assetid
    				  INNER JOIN sq_ast_lnk al ON a.assetid = al.minorid
    				 WHERE  l.root_urlid = 1
    				  AND l.url IN (
    								'/_designs/vanilla-design'
    							)
    				GROUP BY l.url, l.assetid, a.name, a.short_name, a.type_code, a.status, protocol
    				ORDER BY l.url ASC
    [22-Mar-2012 10:04:34] 
    2: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7957): 
    Array
    (
    [0] => Array
        (
            [url] => /_designs/vanilla-design
            [0] => /_designs/vanilla-design
            [assetid] => 152
            [1] => 152
            [name] => Vanilla design
            [2] => Vanilla design
            [short_name] => Vanilla design
            [3] => Vanilla design
            [type_code] => design
            [4] => design
            [status] => 2
            [5] => 2
            [protocol] => http
            [6] => http
            [link_type] => 1
            [7] => 1
        )
    
    )
    
    [22-Mar-2012 10:04:34] 
    3: Asset_Manager::getLineageFromURL (/home/websites/squiz_matrix/core/include/asset_manager.inc line 7958): 
    Array
    (
    [0] => function getLineageFromURL(line=5969 class=asset object=Asset_Manager)
    [1] => function updateLookups(line=767 class=file object=Asset)
    [2] => function updateLookups(line=5361 class=asset object=File)
    [3] => function saveWebPaths(line=376 class=file_edit_fns object=Asset)
    [4] => function processFileUpload(line=189 class=file object=File_Edit_Fns)
    [5] => function _createAdditional(line=475 class=asset object=File)
    [6] => function create(line=153 class=file object=Asset)
    [7] => function create(line=137 class=js_file object=File)
    [8] => function create(line=915 class=file object=JS_File)
    [9] => function processBackend(line=120 class=asset_manager_edit_fns object=File)
    [10] => function paintBackend(line=8854 class=asset_manager object=Asset_Manager_Edit_Fns)
    [11] => function paintBackend(line=1492 class=backend object=Asset_Manager)
    [12] => function _printMain(line=193 class=backend object=Backend)
    [13] => function paint(line=565 class=mysource object=Backend)
    [14] => function start(line=30 class=index object=MySource)
    )
    
    [22-Mar-2012 10:04:34] PHP Fatal error:  Call to undefined method Design::getSpecialPage() in /home/websites/squiz_matrix/core/include/asset_manager.inc on line 7991
     

(Edison Wang) #4

The problem is because of the design asset has a URL as '/_designs/vanilla-design'. It should really be SYSTEM_ROOT_URL + '/_designs/vanilla-design'.


You can check out the Designs Folder, and Users Folder where those problematic assets are linked to. The web path screen should tell you the URLs they have right now.

Make sure those system folders should have correct URLs. e.g Designs Folder should be SYSTEM_ROOT_URL + '/_designs'. e.g site.com/_designs.

After you update the path, it should automatically fix the URLs of children assets, and thus fix the error.



Those URLs of system assets should be set by Matrix during installation (step 3). I guess there was problem for Matrix to use SYSTEM_ROOT_URL in the main.inc when installing those system assets and populate its url.


(Nic Hubbard) #5

[quote]
The problem is because of the design asset has a URL as '/_designs/vanilla-design'. It should really be SYSTEM_ROOT_URL + '/_designs/vanilla-design'.



You can check out the Designs Folder, and Users Folder where those problematic assets are linked to. The web path screen should tell you the URLs they have right now.

Make sure those system folders should have correct URLs. e.g Designs Folder should be SYSTEM_ROOT_URL + '/_designs'. e.g site.com/_designs.

After you update the path, it should automatically fix the URLs of children assets, and thus fix the error.



Those URLs of system assets should be set by Matrix during installation (step 3). I guess there was problem for Matrix to use SYSTEM_ROOT_URL in the main.inc when installing those system assets and populate its url.

[/quote]



Thanks so much, that fixed the problem. I didn't even think to check before, but yes, it was missing the root url. :slight_smile:



Thanks again!