here is the command output, seems not applied, anyone know what is the problem?

[root@uat-web html]# sh PATCH_SUPEE-7405_EE_1.14.0.0_to_1.14.0.1_v1-2016-01-19-05-36-52.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Enterprise/Checkout/Block/Adminhtml/Manage/Form/Coupon.php
patching file app/code/core/Enterprise/PageCache/etc/config.xml
patching file app/code/core/Enterprise/Pbridge/etc/config.xml
patching file app/code/core/Enterprise/Pci/Model/Observer.php
patching file app/code/core/Enterprise/Pci/Model/Resource/Admin/User.php
patching file app/code/core/Enterprise/Pci/etc/config.xml
patching file app/code/core/Enterprise/Persistent/etc/config.xml
patching file app/code/core/Enterprise/SalesArchive/etc/config.xml
patching file app/code/core/Enterprise/WebsiteRestriction/etc/config.xml
patching file app/code/core/Mage/Admin/Model/Observer.php
patching file app/code/core/Mage/Admin/Model/Redirectpolicy.php
patching file app/code/core/Mage/Admin/Model/Resource/User.php
patching file app/code/core/Mage/Admin/Model/User.php
patching file app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php
patching file app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
patching file app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php
patching file app/code/core/Mage/Adminhtml/controllers/IndexController.php
patching file app/code/core/Mage/Authorizenet/Helper/Admin.php
patching file app/code/core/Mage/Authorizenet/Helper/Data.php
patching file app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php
patching file app/code/core/Mage/Captcha/etc/config.xml
patching file app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php
patching file app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php
patching file app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php
patching file app/code/core/Mage/CatalogIndex/etc/config.xml
patching file app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php
patching file app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php
patching file app/code/core/Mage/Checkout/controllers/CartController.php
patching file app/code/core/Mage/Checkout/controllers/OnepageController.php
patching file app/code/core/Mage/Core/Helper/Data.php
patching file app/code/core/Mage/Core/Model/App.php
patching file app/code/core/Mage/Core/Model/Config.php
patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php
patching file app/code/core/Mage/Core/Model/File/Validator/Image.php
patching file app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php
patching file app/code/core/Mage/Core/Model/Session.php
Hunk #2 FAILED at 50.
1 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Core/Model/Session.php.rej
patching file app/code/core/Mage/Customer/controllers/AccountController.php
patching file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
patching file app/code/core/Mage/Downloadable/controllers/CustomerController.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php
patching file app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
patching file app/code/core/Mage/ImportExport/etc/config.xml
patching file app/code/core/Mage/ImportExport/etc/system.xml
patching file app/code/core/Mage/Newsletter/Model/Observer.php
patching file app/code/core/Mage/Newsletter/Model/Queue.php
patching file app/code/core/Mage/Page/etc/system.xml
patching file app/code/core/Mage/Paypal/controllers/PayflowController.php
patching file app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php
patching file app/code/core/Mage/Paypal/etc/config.xml
patching file app/code/core/Mage/Persistent/etc/config.xml
patching file app/code/core/Mage/Review/controllers/ProductController.php
patching file app/code/core/Mage/Rss/Block/Catalog/Salesrule.php
patching file app/code/core/Mage/Rss/Helper/Order.php
patching file app/code/core/Mage/Sales/Helper/Guest.php
patching file app/code/core/Mage/Sales/Model/Quote/Address.php
patching file app/code/core/Mage/Sales/Model/Quote/Item.php
patching file app/code/core/Zend/Xml/Security.php
patching file app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml
patching file app/design/adminhtml/default/default/template/enterprise/checkout/form/coupon.phtml
patching file app/design/adminhtml/default/default/template/sales/items/column/name.phtml
patching file app/design/adminhtml/default/default/template/sales/items/renderer/default.phtml
patching file app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml
patching file app/design/adminhtml/default/default/template/sales/order/view/info.phtml
patching file app/design/frontend/base/default/template/catalog/product/view/options/type/file.phtml
patching file app/design/frontend/base/default/template/rss/order/details.phtml
patching file lib/Varien/File/Uploader.php
patching file lib/Varien/Io/File.php

[root@uat-web html]# sh PATCH_SUPEE-7616_EE_1.14.0.1_v1-2016-01-14-05-59-12.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php
Hunk #1 FAILED at 544.
Hunk #2 succeeded at 575 (offset -4 lines).
Hunk #3 succeeded at 606 (offset -4 lines).
Hunk #4 succeeded at 617 (offset -4 lines).
Hunk #5 succeeded at 652 (offset -4 lines).
Hunk #6 succeeded at 683 (offset -4 lines).
Hunk #7 succeeded at 732 (offset -4 lines).
Hunk #8 succeeded at 771 (offset -4 lines).
Hunk #9 succeeded at 822 (offset -4 lines).
Hunk #10 succeeded at 845 (offset -4 lines).
Hunk #11 succeeded at 1411 (offset -4 lines).
1 out of 11 hunks FAILED -- saving rejects to file app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php.rej

Regarding the 7616 patch, I had the same error (Hunk #1 FAILED at 544.) and I had to install the 4291 and 6237 patches in order to make it work.

Updated answer:

Regarding the 7405 patch, I noticed that you receive the following error: patching file app/code/core/Mage/Core/Model/Session.php Hunk #2 FAILED at 50. 1 out of 2 hunks FAILED -- saving rejects to file app/code/core/Mage/Core/Model/Session.php.rej

In most cases, this means that the app/code/core/Mage/Core/Model/Session file was modified. You could download your Magento version again (https://www.magentocommerce.com/download - release archives), compare the default file with yours, replace it if it's different and try to apply the patch again.

If you use Varnish and Turpentine, you'll have to add the renewFormKey() and validateFormKey() methods to the app/code/local/Mage/Core/Model/Session.php class (the admin login will not work otherwise).

Screenshot for admin order details page, If showing this type issue, Please follow below instruction its working for me !!enter image description here

Solution

Change line 124 in app/code/core/Mage/Adminhtml/Helper/Sales.php from $links = []; to $links = array();

First you should check if these failed file exist in your directory.

If they then, I strongly believe this is because of your previous patches not applied.

I also have similar issue and I have contacted Magento team and they suggested exact same thing.

I will have to check what patch have I missed before and apply accordingly.

Hope this helps.

  • how to check all previous available pataches were applied? – hkguile Jan 21 '16 at 6:06
  • Go to app/etc and you will see a file called something like applied patches. And then compare with magneto site available patches. – Adarsh Khatri Jan 21 '16 at 6:08
  • the last patch i see is 6788, i think all the patch was applied. – hkguile Jan 21 '16 at 6:11
  • You have to check all of them. The new one are dependent to old ones. – Adarsh Khatri Jan 21 '16 at 22:15

If error occurred, pls Find Hunk #1 FAILED files like patching file app/code/core/Mage/Core/Model/Session.php Hunk #2 FAILED at 50. Compare this file in your project and magento fresh downloaded file. If it is not same add the patch code manually into the file.

Find app/code/core/Mage/Core/Model/Session.php in patch file and remove the code starting diff to before next diff(not this diff) line. Then Apply Patch it will work.

Can't comment yet :( Hope this gonna help someone.

We on Mage CE 1.9.0.1, all patches applied almost instantly after published. Hook #1 failed problem with PATCH_SUPEE-7616_CE_1.9.2.2-CE_1.8.0.0_v1-2016-01-20-03-08-56.sh was solved by:

  1. Check if you have app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php
  2. If file is there, go ahead and modify your patch around line 167 replace simmilar code block with provided:
@@ -534,7 +534,7 @@ class Mage_Usa_Model_Shipping_Carrier_Usps
                  '1'      => Mage::helper('usa')->__('Priority Mail'),
                  '2'      => Mage::helper('usa')->__('Priority Mail Express Hold For Pickup'),
                  '3'      => Mage::helper('usa')->__('Priority Mail Express'),
-                 '4'      => Mage::helper('usa')->__('Standard Post'),
+                 '4'      => Mage::helper('usa')->__('Retail Ground'),
                  '6'      => Mage::helper('usa')->__('Media Mail'),
                  '7'      => Mage::helper('usa')->__('Library Mail'),
                  '13'     => Mage::helper('usa')->__('Priority Mail Express Flat Rate Envelope'),

If this wont work, you can try this:

  1. Open Usps.php,
  2. Find public function getCode($type, $code = '')
  3. Find line starting from '1', note its number
  4. Adjust line number (534 in my case) in patch replacement eg. @@ -534,7 +534,7.
  5. Still no go? Copy whole block (array indexes 1 to 7) from Usps.php file and tweek your patch script.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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