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

uninstall error #830

Closed
jaammedia opened this issue Jun 29, 2015 · 12 comments
Closed

uninstall error #830

jaammedia opened this issue Jun 29, 2015 · 12 comments
Assignees

Comments

@jaammedia
Copy link

Starting to uninstall community/Nexcessnet_Turpentine

CONNECT ERROR: Failed to delete files: /var/www/mysite.com/htdocs/downloader/.././app/code/community/Nexcessnet/Turpentine/sql
Check permissions

Permissions for downloader are fine. other extensions install and uninstall without hiccups. Just to double check I change permissions to 777 temporarily and the same error occurs.
Deleting:
app/code/community/Nexcessnet
app/etc/modules/Nexcessnet_Turpentine.xml
app/design/adminhtml/default/default/layout/turpentine.xml
app/design/adminhtml/default/default/template/turpentine/varnish_management.phtml
app/design/frontend/base/default/layout/turpentine_esi.xml
app/design/frontend/base/default/template/turpentine
manually leave the front end and backend inaccessible with the following error:

a:5:{i:0;s:69:"Mage registry key "_singleton/turpentine/observer_esi" already exists";i:1;s:1128:"#0 /var/www/mysite.com/htdocs/app/Mage.php(223): Mage::throwException('Mage registry k...')
/var/www/mysite.com/htdocs/app/Mage.php(477): Mage::register('_singleton/turp...', false)
/var/www/mysite.com/htdocs/app/code/core/Mage/Core/Model/App.php(1316): Mage::getSingleton('turpentine/obse...')
/var/www/mysite.com/htdocs/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_fron...', Array)
/var/www/mysite.com/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(128): Mage::dispatchEvent('controller_fron...', Array)
/var/www/mysite.com/htdocs/app/code/core/Mage/Core/Model/App.php(749): Mage_Core_Controller_Varien_Front->init()
/var/www/mysite.com/htdocs/app/code/core/Mage/Core/Model/App.php(1094): Mage_Core_Model_App->_initFrontController()
/var/www/mysite.com/htdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->getFrontController()
/var/www/mysite.com/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
/var/www/mysite.com/htdocs/index.php(87): Mage::run('default', 'store')
{main}";s:3:"url";s:11:"/admin/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Compiling is off and var/cache has been cleared but neither help after the failed uninstall. The only toption available is to reinstall and then the backend and frontend resume working

@miguelbalparda
Copy link
Contributor

What do you mean by reinstall? Are you reinstalling the extension or the entire Magento?

@jaammedia
Copy link
Author

Reinstalling the extension from the magento connect manager. This is the only way I have found to re enable access to the frontend and backend after a failed uninstall.

@miguelbalparda
Copy link
Contributor

After uninstalling the extension I suppose you are still using Varnish on your server. Have you tried accessing your domain directly to the apache port? Also manually removing the Magento cache and any other cache you might be using can help here.

@jaammedia
Copy link
Author

Running nginx. Varnish is no longer in the site conf file. Reloaded nginx service. no other caches being used. Disabled the native FPC in the module xml file just in case.
Ran these commands from terminal:
rm -rf var/cache/*
php -f shell/compiler.php clear
php -f shell/compiler.php disable
Just to be sure. Still got the same results. Also, I'm rather new to github. I didn't mean to tag so many issues.

@miguelbalparda
Copy link
Contributor

@jaammedia thank you for your input. I will try to reproduce this on my local env, if you think there is anything else we can use to solve this let me know please.

@miguelbalparda
Copy link
Contributor

Can you check if you have a file in app/code/local/Mage/Core/Model/Session.php? If the answer is yes, remove it manually after removing the module. See #532 #682 #258 for more info.

@jaammedia
Copy link
Author

It is there before uninstalling but after the failed uninstalled it is gone and does not need to be deleted manually. After the failed uninstall the only folder left from the extension is
app/code/community/Nexcessnet

@miguelbalparda
Copy link
Contributor

We made some changes in the extension to remove the use of the app/code/local/Mage folder. After uninstalling the new version of the extension is this still happening?

@jaammedia
Copy link
Author

I didn't see a new package in the magento connect. It might not be an issue with the extension at all. I edited the processUninstallPackage function in downloader/lib/Mage/Connect/Packager.php
Not the most practical way but the extension uninstalls without a hitch and the admin is accessible after it uninstalls. Funny thing is that the app/code/community/Nexcessnet/Turpentine/sql file still didn't get deleted. I hade to remove the app/code/community/Nexcessnet folder manually

@miguelbalparda
Copy link
Contributor

Thank you for the heads up @jaammedia! Would you mind adding your edited function here?

@jaammedia
Copy link
Author

Sure. I just rolled the code back to a previous version.
where it says:

public function processUninstallPackage($chanName, $package, $cacheObj, $configObj)
{
$package = $cacheObj->getPackageObject($chanName, $package);
$contents = $package->getContents();

    $targetPath = rtrim($configObj->magento_root, "\\/");
    $failedFiles = array();
    foreach ($contents as $file) {
        $fileName = basename($file);
        $filePath = dirname($file);
        $dest = $targetPath . DIRECTORY_SEPARATOR . $filePath . DIRECTORY_SEPARATOR . $fileName;
        if(@file_exists($dest)) {
            if (!@unlink($dest)) {
                $failedFiles[] = $dest;
            }
        }
        $this->removeEmptyDirectory(dirname($dest));
    }
    if (!empty($failedFiles)) {
        $msg = sprintf("Failed to delete files: %s \r\n Check permissions", implode("\r\n", $failedFiles));
        throw new RuntimeException($msg);
    }

    $destDir = $targetPath . DS . Mage_Connect_Package::PACKAGE_XML_DIR;
    $destFile = $package->getReleaseFilename() . '.xml';
    @unlink($destDir . DS . $destFile);
}

i replaced with a previous version of the function:

public function processUninstallPackage($chanName, $package, $cacheObj, $configObj)
{
    $package = $cacheObj->getPackageObject($chanName, $package);
    $contents = $package->getContents();

    $targetPath = rtrim($configObj->magento_root, "\\/");
    foreach ($contents as $file) {
        $fileName = basename($file);
        $filePath = dirname($file);
        $dest = $targetPath . DIRECTORY_SEPARATOR . $filePath . DIRECTORY_SEPARATOR . $fileName;
        if(@file_exists($dest)) {
            @unlink($dest);
            $this->removeEmptyDirectory(dirname($dest));
        }
    }

    $destDir = $targetPath . DS . Mage_Connect_Package::PACKAGE_XML_DIR;
    $destFile = $package->getReleaseFilename() . '.xml';
    @unlink($destDir . DS . $destFile);
}

@miguelbalparda
Copy link
Contributor

Perfect, thank you! I'll close this issue and leave it here for future reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants