5

I am using Magento 1.9.1.0 and tried to install the new patch SUPEE-6788 through SSH but getting ERROR below. I am not able to understand what's wrong and where exactly the error lies

I have installed all the previous patches. Please help me as my website is live and don't want anything to happen because of this patch.

ERROR: Patch can't be applied/reverted successfully.
patching file .htaccess
Hunk #1 succeeded at 228 (offset 21 lines).
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git .htaccess.sample .htaccess.sample
|index b8821af..383313a 100644
|--- .htaccess.sample
|+++ .htaccess.sample
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
patching file app/code/core/Mage/Admin/Model/Block.php
patching file app/code/core/Mage/Admin/Model/Resource/Block.php
patching file app/code/core/Mage/Admin/Model/Resource/Block/Collection.php
patching file app/code/core/Mage/Admin/Model/Resource/Variable.php
patching file app/code/core/Mage/Admin/Model/Resource/Variable/Collection.php
patching file app/code/core/Mage/Admin/Model/Variable.php
patching file app/code/core/Mage/Admin/etc/config.xml
patching file app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block/Edit.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block/Edit/Form.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block/Grid.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Edit.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Edit/Form.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Grid.php
patching file app/code/core/Mage/Adminhtml/controllers/Permissions/BlockController.php
patching file app/code/core/Mage/Adminhtml/controllers/Permissions/VariableController.php
patching file app/code/core/Mage/Adminhtml/etc/adminhtml.xml
patching file app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php
patching file app/code/core/Mage/Core/Controller/Request/Http.php
patching file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
patching file app/code/core/Mage/Core/Helper/UnserializeArray.php
patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php
patching file app/code/core/Mage/Core/Model/Resource/Setup.php
patching file app/code/core/Mage/Core/etc/config.xml
patching file app/code/core/Mage/Core/etc/system.xml
patching file app/code/core/Mage/Customer/Block/Account/Changeforgotten.php
patching file app/code/core/Mage/Customer/Block/Account/Resetpassword.php
patching file app/code/core/Mage/Customer/controllers/AccountController.php
patching file app/code/core/Mage/Downloadable/Model/Product/Type.php
patching file app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php
patching file app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php
patching file app/code/core/Mage/Sales/controllers/DownloadController.php
patching file app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php
patching file app/code/core/Zend/XmlRpc/Request.php
patching file app/code/core/Zend/XmlRpc/Response.php
patching file app/design/adminhtml/default/default/layout/admin.xml
patching file app/design/frontend/base/default/layout/customer.xml
patching file app/design/frontend/base/default/template/customer/form/register.phtml
patching file app/design/frontend/base/default/template/customer/form/resetforgottenpassword.phtml
patching file app/design/frontend/base/default/template/page/js/cookie.phtml
patching file app/design/frontend/base/default/template/persistent/customer/form/register.phtml
patching file app/design/frontend/default/iphone/layout/customer.xml
patching file app/design/frontend/default/modern/layout/customer.xml
patching file app/design/frontend/rwd/default/layout/customer.xml
patching file app/design/frontend/rwd/default/template/customer/form/resetforgottenpassword.phtml
patching file app/design/frontend/rwd/default/template/persistent/customer/form/register.phtml
patching file cron.php
Hunk #1 succeeded at 60 (offset 1 line).
patching file errors/processor.php
patching file lib/Unserialize/Parser.php
patching file lib/Unserialize/Reader/Arr.php
patching file lib/Unserialize/Reader/ArrKey.php
patching file lib/Unserialize/Reader/ArrValue.php
patching file lib/Unserialize/Reader/Bool.php
patching file lib/Unserialize/Reader/Dbl.php
patching file lib/Unserialize/Reader/Int.php
patching file lib/Unserialize/Reader/Str.php
patching file lib/Varien/Data/Collection/Db.php
patching file lib/Zend/Xml/Security.php
4

.htaccess.sample was removed on this installation and therefore cannot be patched.

Download the manual download archive from the Magento downloads page, extract .htaccess.sample and rerun the patch.

patching file .htaccess           <=== THIS WAS PATCHED SUCCESSFULLY
Hunk #1 succeeded at 228 (offset 21 lines).
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git .htaccess.sample .htaccess.sample      <=== MISSING FILE
|index b8821af..383313a 100644
|--- .htaccess.sample
|+++ .htaccess.sample
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
  • you dont have to do this, you need only to download .htaccess file... see my answer – MagenX Oct 29 '15 at 8:01
  • 1
    @MagenX no, the patch needs to patch .htaccess.sample as well, actually judging by the output in the question, this is the only problem here. But your answer is still valuable for others, where .htaccess has been modified – Fabian Schmengler Oct 29 '15 at 8:10
  • yes, sample as well... next version patch needs to get to dev/tests/functional/.htaccess , this folder on many magento servers just removed completely... – MagenX Oct 29 '15 at 8:14
  • @MagenX I have upload fresh copy of .htaccess and .htaccess.sample but still getting ERROR. – kanand304 Oct 29 '15 at 9:59
4

NB! after you applied this patch get ready to do some more work: http://magento.com/security/patches/supee-6788-technical-details

patching multiple magento installations (fixSUPEE6788 tool included):

https://gist.github.com/magenx/18669dfa81444bcf4ddf

This is well known issue, they need to patch .htaccess file as well its sample file, so if you use a modified .htaccess file you have to run something like this (htaccess file is the same for all versions before 1.9.2.2):

mv .htaccess .htaccess_original
wget -qO .htaccess http://svn.magentocommerce.com/source/branches/1.7/.htaccess
wget -qO  .htaccess.sample http://svn.magentocommerce.com/source/branches/1.7/.htaccess.sample
sh PATCH_SUPEE-6788_CE_1.9.1.0_v1-2015-10-27-09-06-11.sh
mv .htaccess .htaccess_patched
mv .htaccess_original .htaccess

and this is the change:

+
+###########################################
+## Deny access to cron.php
+    <Files cron.php>
+
+############################################
+## uncomment next lines to enable cron access with base HTTP authorization
+## http://httpd.apache.org/docs/2.2/howto/auth.html
+##
+## Warning: .htpasswd file should be placed somewhere not accessible from the web.
+## This is so that folks cannot download the password file.
+## For example, if your documents are served out of /usr/local/apache/htdocs
+## you might want to put the password file(s) in /usr/local/apache/.
+
+        #AuthName "Cron auth"
+        #AuthUserFile ../.htpasswd
+        #AuthType basic
+        #Require valid-user
+
+############################################
+
+        Order allow,deny
+        Deny from all
+
+    </Files>

This means after running the code above, you need to add the following to your .htaccess file manually:

<Files cron.php>
    Order allow,deny
    Deny from all
</Files>
  • 1
    I executed the above code through SSH and yes the patch got applied but it has broken some blocks on my homepage. There is a slider on my homepage which is now not showing. Please help me fix this or tell me how can i revert the patch. – kanand304 Oct 29 '15 at 10:47
  • you have to follow magento.com/security/patches/supee-6788-technical-details – MagenX Oct 29 '15 at 11:02
  • I went through the above link but where exactly I have to make these changes. – kanand304 Oct 29 '15 at 11:30
  • @kanand304 check out this toolbox from rhoerr github.com/rhoerr/supee-6788-toolbox it will fix your whitelist problem – Robin Nov 2 '15 at 9:55
  • forgot about this tool, now it is included – MagenX Nov 3 '15 at 8:59
0

This happens mainly because

1. applying wrong version of the patch 
2. The file the system trying to patch is modified 

Make sure you are applying the correct patch and the replace the file that is causing the error with a stock magento installation file and then try again

0

The error indicates that it failed to patch .htaccess.sample:

patching file .htaccess
Hunk #1 succeeded at 228 (offset 21 lines).
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git .htaccess.sample .htaccess.sample
|index b8821af..383313a 100644
|--- .htaccess.sample
|+++ .htaccess.sample
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

With this error the patch is fully rolled back; no changes have been applied. It's most likely the case that your .htaccess.sample file has been removed—although edits to it could cause this error as well.

To successfully apply the patch you will need to restore a stock copy of the .htaccess.sample file. If you have modified your version then copy it to a backup location (or change it's filename). Download the 1.9.1.0 version of Magento from http://magentocommerce.com/download and then copy it's unmodified .htaccess.sample to your site. Re-apply the patch and you should see much less output (only a few lines) indicating the patch was successful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.