Resolve "conflicts detected" while applying patch through CLI command JBoss EAP 6/7

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6.2 or later

Issue

Command line returns the following errors when trying to update via JBoss EAP CLI:

[disconnected /] patch apply /path-up-to/jboss-eap-patch.zip
Conflicts detected: bin/standalone.sh
Use the --override or --preserve arguments in order to resolve the conflict.
[domain@localhost:9999 /] patch apply /path/to/patch.zip --host=<jboss-host>
{"host-failure-descriptions" => [("<jboss-host>" => {
    "message" => "Conflicts detected",
    "conflicts" => {"modules" => ["org.apache.cxf.impl:main"]}
})]}
[disconnected /] patch apply /path/to/patch.zip --preserve=[bin/standalone.bat,bin/standalone.conf.bat]
Conflicts detected: sun.jdk:main
Use the --override-all, --override=[] or --preserve=[] arguments in order to resolve the conflict.

Resolution

Using --preserve | --override

To keep changes made to a file, use the --preserve option:

[disconnected /] patch apply /path-up-to/jboss-eap-x.y.z-patch.zip --preserve=bin/standalone.sh
{
    "outcome" : "success",
    "result" : {}
}
[disconnected /] 

Override changes to a single file with --override=

[disconnected /] patch apply /path-up-to/jboss-eap-x.y.z-patch.zip --override=bin/standalone.sh
{
    "outcome" : "success",
    "result" : {}
}
[disconnected /] 

NOTE: If using non-interactive mode of JBoss EAP CLI and using multiple files/modules in --preserve or --override, make sure to add double quotes ( " ) to wrap the content. See an example below:

    ~~~
    ./jboss-cli.sh 'patch apply ../../patch.zip --preserve="bin/standalone.sh,bin/standalone.conf"'
    {
        "outcome" : "success",
        "result" : {}
    }
    ~~~

Using --override-modules | --override-all

In case of a module, it is not possible to use --preserve or --override options. See solution Install different version of jars as a module inside JBoss EAP for more information on how to deal with multiple module versions. Once followed the instructions, then use --override-modules or --override-all

    [disconnected /] patch apply /path-up-to/jboss-eap-x.y.z-patch.zip --override-modules
    {
        "outcome" : "success",
        "result" : {}
    }
    [disconnected /]

If the files that are in the init.d directory were deleted, patch updater would still report that as a conflict. Use --override-all flag to proceed with the installation.

Root Cause

This Conflicts detected error occurs if there is a difference detected in any of the JBoss EAP configuration file with respect to the default configuration which is shipped by Red Hat. The patch process performs a checksum of files before replacing them, and if there is a checksum mismatch it knows that you have modified that file. Since we cannot know the original purpose of your modification or whether you still need the modification, the patch process will abort and prompt the user to indicate by using the preserve/override flags whether it is OK to overwrite your modified file.

In the case that you need to merge your customizations with the new patch version for a human-readable file type, a good process is to backup your modified file, perform the patch with --override, then execute a diff between your modified file and the updated one to obtain a list of differences. Then you can modify the updated file by hand to port over any modifications you need to keep.

For example, in above example this error is coming from "bin/standalone.sh","bin/standalone.bat"file and sun.jdk:main, which means user has edited these bin/standalone.sh , "bin/standalone.bat" file or made changes in sun.jdk:main module .

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments