1

Showing given below error, While I am installing the patch file in my Magento version 1.4.2.0. Please help me to find out the reason for the error!

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

checking file app/code/core/Mage/Admin/Model/Observer.php
Hunk #1 FAILED at 37 (different line endings).
Hunk #2 FAILED at 44 (different line endings).
Hunk #3 FAILED at 55 (different line endings).
3 out of 3 hunks FAILED
checking file app/code/core/Mage/Core/Controller/Request/Http.php
Hunk #1 FAILED at 37 (different line endings).
Hunk #2 FAILED at 459 (different line endings).
2 out of 2 hunks FAILED
checking file lib/Varien/Data/Collection/Db.php
Hunk #1 FAILED at 421 (different line endings).
1 out of 1 hunk FAILED
1

There are modifications in core files ('app/code/core/Mage/Admin/Model/Observer.php' for example and so on), these files are saved with different line endings. The solution is to compare your current files with original files from Magento 1.4.2.0 distribution and understand why your files got changed. If you believe there should be no any changes in core files, you can simply replace 'app/code/core/Mage/Admin/Model/Observer.php', 'app/code/core/Mage/Core/Controller/Request/Http.php' and so on with original files from Magento 1.4.2.0 distribution and re-run the patch.

If it is just line-endings and you have tofrodos installed or are familar with perl or sed inline replacements, converting line endings may be faster than re-uploading files from distro.

  • Al As per your comment I updated it in my Magento successfully. Thanks for the same @Alex Grin. – MPchan Apr 21 '15 at 7:20
1

Source: Hunk #1 FAILED at 1. What's that mean?

It is an error generated by patch. If you would open the .patch file, you'd see that it's organized in a bunch of segments, so-called "hunks". Every hunk identifies corresponding pieces of code (by line numbers) in the old and new version, the differences between those pieces of code, and similarities between them (the "context").

A hunk might fail if the similarities of a hunk don't match what's in the original file. When you see this error, it is almost always because you're using a patch for the wrong version of the code you're patching. There are a few ways to work around this:

  • Get an updated version of libdvdnav that already includes the patch (best option).
  • Get a .patch file for the version of libdvdnav you're patching.
  • Patch manually. For every hunk in the patch, try to locate the corresponding file and lines in libdvdnav, and correct them according to the instructions in the patch.
  • Take the version of libdvdnav that's closer to whatever version the .patch file was intended for (probably a bad idea).

    1. Are you sure you are using the version for CE 1.4.0.0 - 1.5.0.1 (the last download option)?
    2. Have you made core modifications to these files?

The files should match those of the correct version, unmodified.

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