Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

PHP Fatal error:  Call to a member function getDbVersion() on a non-object in
 
pgoetzin
Jr. Member
 
Total Posts:  28
Joined:  2009-04-24
 

Hello Everyone,
i’m a bit lost. Did a update to 1.7 some time ago and everythink looks well but its not.
Yesterday i cleared my cache and my magento break suddenly. The following error shows up when trying to access my index.php.

[Sat Apr 20 12:53:42 2013] [error] [client 85.216.78.85] PHP Fatal error:  Call to a member function getDbVersion() on a non-object in /var/www/vhosts/tarnava.de/httpdocs/includes/src/Mage_Core_Model_Resource_Setup.php on line 301

I figured out that when i add the call

Mage::init($mageRunCode, $mageRunType, array());

befor

Mage::run($mageRunCode, $mageRunType);

in index.php i can open the main page again.
But i think this is a bad fix and dosent solve the root cause.

I search the web and some people say the app/etc/config.xml is maybee broken but i can’t find a problem. The only thing is that locale us/ los angele is not correct, was the file maybee resetted ?

/app/etc/config.xml

<config>
    <global>
        <
install>
            <
date/>
        </
install>
        <
resources>
            <
default_setup>
                <
connection>
                    <
host>localhost</host>
                    <
username/>
                    <
password/>
                    <
dbname>magento</dbname>
                    <
model>mysql4</model>
                    <
initStatements>SET NAMES utf8</initStatements>
                    <
type>pdo_mysql</type>
                    <
active>0</active>
                </
connection>
            </
default_setup>
            <
default_write>
                <
connection>
                    <use>
default_setup</use>
                </
connection>
            </
default_write>
            <
default_read>
                <
connection>
                    <use>
default_setup</use>
                </
connection>
            </
default_read>
            <
core_setup>
                <
setup>
                    <
module>Mage_Core</module>
                </
setup>
                <
connection>
                    <use>
default_setup</use>
                </
connection>
            </
core_setup>
            <
core_write>
                <
connection>
                    <use>
default_write</use>
                </
connection>
            </
core_write>
            <
core_read>
                <
connection>
                    <use>
default_read</use>
                </
connection>
            </
core_read>
        </
resources>
        <
resource>
            <
connection>
                <
types>
                    <
pdo_mysql>
                        <
adapter>Varien_Db_Adapter_Pdo_Mysql</adapter>
                        <class>
Mage_Core_Model_Resource_Type_Db_Pdo_Mysql</class>
                        <
compatibleMode>1</compatibleMode>
                    </
pdo_mysql>
                </
types>
            </
connection>
        </
resource>
        <
models>
            <
varien>
                <class>
Varien</class>
            </
varien>
            <
core>
                <class>
Mage_Core_Model</class>
                <
resourceModel>core_resource</resourceModel>
            </
core>
            <
core_resource>
                <class>
Mage_Core_Model_Resource</class>
                <
deprecatedNode>core_mysql4</deprecatedNode>
                <
entities>
                    <
config_data>
                        <
table>core_config_data</table>
                    </
config_data>
                    <
website>
                        <
table>core_website</table>
                    </
website>
                    <
store>
                        <
table>core_store</table>
                    </
store>
                    <
resource>
                        <
table>core_resource</table>
                    </
resource>
                    <
cache>
                        <
table>core_cache</table>
                    </
cache>
                    <
cache_tag>
                        <
table>core_cache_tag</table>
                    </
cache_tag>
                    <
cache_option>
                        <
table>core_cache_option</table>
                    </
cache_option>
                </
entities>
            </
core_resource>
        </
models>
    </global>
    <default>
        <
system>
            <
filesystem>
                <
base>{{root_dir}}</base>
                <
app>{{root_dir}}/app</app>
                <
code>{{app_dir}}/code</code>
                <
design>{{app_dir}}/design</design>
                <
locale>{{app_dir}}/locale</locale>
                <
etc>{{app_dir}}/etc</etc>
                <
media>{{root_dir}}/media</media>
                <
upload>{{root_dir}}/media/upload</upload>
                <
skin>{{root_dir}}/skin</skin>
                <var>
{{var_dir}}</var>
                <
cache>{{var_dir}}/cache</cache>
                <
session>{{var_dir}}/session</session>
                <
tmp>{{var_dir}}/tmp</tmp>
                <
pear>{{var_dir}}/pear</pear>
                <
export>{{var_dir}}/export</export>
            </
filesystem>
        </
system>
        <
general>
            <
locale>
                <
code>en_US</code>
                <
timezone>America/Los_Angeles</timezone>
            </
locale>
        </
general>
    </default>
    <
varien>
        <class>
Varien</class>
    </
varien>
</
config>

when i enabled debug mode i also got some wired varien autoload errors.

Warning: include(/var/www/vhosts/tarnava.de/httpdocs/includes/src/Mage_Core_Model_Resource_Resource.php): failed to open stream: No such file or directory in /var/www/vhosts/tarnava.de/httpdocs/includes/src/Varien_Autoload.php on line 93

#0 /var/www/vhosts/tarnava.de/httpdocs/includes/src/Varien_Autoload.php(93): mageCoreErrorHandler(2, ‘include(/var/ww...’, ‘/var/www/vhosts...’, 93, Array)
#1 /var/www/vhosts/tarnava.de/httpdocs/includes/src/Varien_Autoload.php(93): Varien_Autoload::autoload()
#2 [internal function]: Varien_Autoload->autoload(’Mage_Core_Model...’)
#3 [internal function]: spl_autoload_call(’Mage_Core_Model...’)
#4 /var/www/vhosts/tarnava.de/httpdocs/includes/src/__default.php(23435): class_exists(’Mage_Core_Model...’)
#5 /var/www/vhosts/tarnava.de/httpdocs/includes/src/__default.php(23469): Mage_Core_Model_Config->getModelInstance(’core_resource/r...’, Array)
#6 /var/www/vhosts/tarnava.de/httpdocs/app/Mage.php(490): Mage_Core_Model_Config->getResourceModelInstance(’core/resource’, Array)
#7 /var/www/vhosts/tarnava.de/httpdocs/app/Mage.php(518): Mage::getResourceModel(’core/resource’, Array)
#8 /var/www/vhosts/tarnava.de/httpdocs/includes/src/Mage_Core_Model_Resource_Setup.php(211): Mage::getResourceSingleton(’core/resource’)
#9 /var/www/vhosts/tarnava.de/httpdocs/includes/src/Mage_Core_Model_Resource_Setup.php(301): Mage_Core_Model_Resource_Setup->_getResource()
#10 /var/www/vhosts/tarnava.de/httpdocs/includes/src/Mage_Core_Model_Resource_Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#11 /var/www/vhosts/tarnava.de/httpdocs/includes/src/__default.php(20124): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#12 /var/www/vhosts/tarnava.de/httpdocs/includes/src/__default.php(20050): Mage_Core_Model_App->_initModules()
#13 /var/www/vhosts/tarnava.de/httpdocs/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#14 /var/www/vhosts/tarnava.de/httpdocs/index.php(99): Mage::run(’tarnava_de’, ‘store’)
#15 {main}

Does anyone have a idear what could be the problem ? or hint what to check ?

Thank you,

Philipp

 
Magento Community Magento Community
Magento Community
Magento Community
 
pgoetzin
Jr. Member
 
Total Posts:  28
Joined:  2009-04-24
 

Hello Everyone,
looks like a Varien/Autoload issue. when i try to reinstall any modul via magento connect i get the follwoing error.

2013-04-20T11:57:09+00:00 ERR (3): Warningcurl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set  in /var/www/vhosts/tarnava.de/httpdocs/downloader/lib/Mage/HTTP/Client/Curl.php on line 529
2013
-04-20T11:57:09+00:00 ERR (3): Warningcurl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set  in /var/www/vhosts/tarnava.de/httpdocs/downloader/lib/Mage/HTTP/Client/Curl.php on line 529
2013
-04-20T11:57:16+00:00 ERR (3): Warning: include(Mage/Core/Model/Resource/Resource.php): failed to open streamNo such file or directory  in /var/www/vhosts/tarnava.de/httpdocs/lib/Varien/Autoload.php on line 93
2013
-04-20T11:57:16+00:00 ERR (3): Warning: include(Mage/Core/Model/Resource/Resource.php): failed to open streamNo such file or directory  in /var/www/vhosts/tarnava.de/httpdocs/lib/Varien/Autoload.php on line 93
2013
-04-20T11:57:16+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Core/Model/Resource/Resource.php' for inclusion (include_path='/var/www/vhosts/tarnava.de/httpdocs/app/code/local:/var/www/vhosts/tarnava.de/httpdocs/app/code/community:/var/www/vhosts/tarnava.de/httpdocs/app/code/core:/var/www/vhosts/tarnava.de/httpdocs/lib:.:')  in /var/www/vhosts/tarnava.de/httpdocs/lib/Varien/Autoload.php on line 93

anyone a hint ?

Thanks
Philipp

 
Magento Community Magento Community
Magento Community
Magento Community
 
pgoetzin
Jr. Member
 
Total Posts:  28
Joined:  2009-04-24
 

found the root cause.
Ressource.php was mising. dont know why but it was missing

app/code/core/Mage/Core/Model/Resource#

wget http://svn.magentocommerce.com/source/branches/1.7-trunk/app/code/core/Mage/Core/Model/Resource/Resource.php

fixed the problem.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top