avatria / ydeploy

A hybris build and deployment framework
https://avatria.github.io/ydeploy/
Apache License 2.0
19 stars 4 forks source link

deployrelease failing as extension path gets change automatically #3

Closed tripathihsr closed 7 years ago

tripathihsr commented 7 years ago

Hi Zmcmahon,

Thanks for providing the custom build framework.

I was trying to utilize this for my research but it is failing at an specific point.

I am able to successfully execute 'ant build' and 'ant genrelease' but it fails while executing 'any deployrelease'

while troubleshooting i find that some additional paths are added in 'localextension.xml' after 'ant genrelease' but didn't get any clue how to fix it

Please take a look at screnshot

  1. This is path of custom extensions which i can in the package 'hybrisServer-Release-0.zip' generated after 'ant genrelease' image

  2. snippets after 'ant deployrelease' filure image

Please share some pointers to fix it

tripathihsr commented 7 years ago

Please share your comment

zmcmahon-avatria commented 7 years ago

Hi @tripathihsr -

It's hard for me to make out the screenshots above as the resolution is poor. A few things would help me understand better.

  1. What version of hybris are you using?
  2. Can you post the full output for the command that is failing as plain text?
  3. You mention that new localextensions.xml entries are added after genrelease. ydeploy doesn't modify this file, but the hybris build process may. I'm wondering if the paths are setup correctly as hybris may generate new config files from 'templates' if it doesn't see the files in the config location. Check to make sure you have the localextensions.xml and other files in the 'config' directory and that 'ydeploy' exists in the config directory as described here: https://github.com/avatria/ydeploy#checking-ydeploy-into-source-control

Thanks, Zach

tripathihsr commented 7 years ago

uff..i dont know why couldn't see your reply, sorry

Please find response below..

  1. Hybris-commmerce-6.3
  2. image ..

deployrelease: [echo] Initializing ydeploy [echo] ydeploy yenv: [echo] ydeploy yserverid: [echo] ydeploy yreleaseid: 0

-init:

server-stop: [exec] Stopping hybrisPlatform on Tomcat... [exec] Waiting for hybrisPlatform on Tomcat to exit... [exec] Stopped hybrisPlatform on Tomcat. [mkdir] Created dir: /app/deploy/releases/0 [copy] Copying 31 files to /app/deploy/releases/0 [unzip] Expanding: /app/deploy/releases/0/hybrisServer-AllExtensions.zip into /app/deploy/releases/0 [unzip] Expanding: /app/deploy/releases/0/hybrisServer-Config.zip into /app/deploy/releases/0 [unzip] Expanding: /app/deploy/releases/0/hybrisServer-Licence.zip into /app/deploy/releases/0 [unzip] Expanding: /app/deploy/releases/0/hybrisServer-Platform.zip into /app/deploy/releases/0 [symlink] Removing symlink: /app/deploy/current [exec] Buildfile: /app/deploy/releases/0/hybris/bin/platform/build.xml [exec] [echo] deploylocalproperties starting... [exec] [echo] ydeploy yenv: [exec] [echo] ydeploy yserverid: [exec] [propertyfile] Updating property file: /app/deploy/releases/0/hybris/temp/hybris/ydeploy/local.properties [exec] [copy] Copying 1 file to /app/deploy/releases/0/hybris/config [exec] [echo] deploylocalproperties complete [exec] [mkdir] Created dir: /app/deploy/releases/0/hybris/roles [exec] [exec] BUILD FAILED [exec] /app/deploy/releases/0/hybris/bin/platform/build.xml:16: The following error occurred while executing this line:[ysetplatformproperties] Error while evaluating file '/app/deploy/releases/0/hybris/config/localextensions.xml'. ExtensionInfo file '/app/deploy/releases/0/hybris/bin/../../../../../custom/teststorefulfilmentprocess/extensioninfo.xml' could not be found! Check the extensions paths specified in your '/app/deploy/releases/0/hybris/config/localextensions.xml' ! [exec] [exec] [ysetplatformproperties] java.lang.RuntimeException: Error while evaluating file '/app/deploy/releases/0/hybris/config/localextensions.xml'. ExtensionInfo file '/app/deploy/releases/0/hybris/bin/../../../../../custom/teststorefulfilmentprocess/extensioninfo.xml' could not be found! Check the extensions paths specified in your '/app/deploy/releases/0/hybris/config/localextensions.xml' ! [exec] /app/deploy/releases/0/hybris/bin/platform/resources/ant/antmacros.xml:155: java.lang.RuntimeException: Error while evaluating file '/app/deploy/releases/0/hybris/config/localextensions.xml'. ExtensionInfo file '/app/deploy/releases/0/hybris/bin/../../../../../custom/teststorefulfilmentprocess/extensioninfo.xml' could not be found! Check the extensions paths specified in your '/app/deploy/releases/0/hybris/config/localextensions.xml' ! [exec] [ysetplatformproperties] at de.hybris.bootstrap.config.PlatformConfig.readConfiguredExtensionsFromXMLFile(PlatformConfig.java:1219) [exec] at de.hybris.bootstrap.config.PlatformConfig.readConfiguredExtensionsFromXMLFile(PlatformConfig.java:1219) [exec] [ysetplatformproperties] at de.hybris.bootstrap.config.PlatformConfig.collectConfiguredExtensionsFromXMLConfig(PlatformConfig.java:1041) [exec] at de.hybris.bootstrap.config.PlatformConfig.collectConfiguredExtensionsFromXMLConfig(PlatformConfig.java:1041) [exec] [ysetplatformproperties] at de.hybris.bootstrap.config.PlatformConfig.collectConfiguredExtensions(PlatformConfig.java:953) at de.hybris.bootstrap.config.PlatformConfig.collectConfiguredExtensions(PlatformConfig.java:953) [exec] [exec] at de.hybris.bootstrap.config.PlatformConfig.(PlatformConfig.java:139)[ysetplatformproperties] at de.hybris.bootstrap.config.PlatformConfig.(PlatformConfig.java:139) [exec] [exec] at de.hybris.bootstrap.config.PlatformConfig.getInstance(PlatformConfig.java:128)[ysetplatformproperties] at de.hybris.bootstrap.config.PlatformConfig.getInstance(PlatformConfig.java:128)

image

  1. yes i have config directory at /config but additional path are getting added as highlighted in yellow in above screenshot
tripathihsr commented 7 years ago

Hi Zmcmahon, do you think you can help here?

Regards!

zmcmahon-avatria commented 7 years ago

@tripathihsr -

  1. What are the contents of the localextensions.xml before running the build (i.e. before deploy)? Can you please post the full contents before & after for comparison?
  2. The following reference in the localextensions.xml "/app/deploy/releases/0/hybris/bin/../../../../../custom/teststorefulfilmentprocess/extensioninfo.xml" will resolve to /app/deploy/custom/teststorefulfilmentprocess/extensioninfo.xml. I assume that file/path doesn't exist, correct? What is the actual path of the teststorefulfilmentprocess module under the "deploy/releases/0" directory? Typically it would be located under deploy/releases/0/hybris/custom/teststorefulfilmentprocess. If not, you would have to configure the yd.hybris.custom.ext.dir property to point the custom location.
  3. What OS are you using?
  4. Can you confirm that after the failure, symbolic links exist pointing /app/deploy/current => /app/deploy/releases/0?
  5. Please post any customizations made to any of the yd.* properties files via ydeploy.properties, core.properties, or similar config files.
  6. What is the structure and relative relationships between your hybris bin, config, custom, and ydeploy directories? Typically it would be something like hybris/bin, hybris/config, hybris/custom, and hybris/ydeploy, respectively.

As mentioned previously, ydeploy does not modify the localextensions.xml file, but the core hybris build process may. You may want to try just modifying the localextensions.xml in the expanded releases/0 directory to point to the correct path, and then invoke the hybris build process directly just to make sure everything is working and building. To me it sounds like some step is failing quietly (such as the symbolic link creation), the ydeploy configurations are incorrect based upon the actual directory layout you are using, or perhaps there is a fully qualified path somewhere in your configuration (possibly localextensions.xml) during build time. Will need more details regarding your configuration & layout to know.

tripathihsr commented 7 years ago
  1. What are the contents of the localextensions.xml before running the build (i.e. before deploy)? Can you please post the full contents before & after for comparison? In code repository: <?xml version="1.0" encoding="UTF-8"?>

After ‘ant build’ (no change) <?xml version="1.0" encoding="UTF-8"?>

After ‘ant genrelease’ This step creates issue by adding ‘/../../../../../’ in original path 2. The following reference in the localextensions.xml "/app/deploy/releases/0/hybris/bin/../../../../../custom/teststorefulfilmentprocess/extensioninfo.xml" will resolve to /app/deploy/custom/teststorefulfilmentprocess/extensioninfo.xml. I assume that file/path doesn't exist, correct? What is the actual path of the teststorefulfilmentprocess module under the "deploy/releases/0" directory? Typically it would be located under deploy/releases/0/hybris/custom/teststorefulfilmentprocess. If not, you would have to configure the yd.hybris.custom.ext.dir property to point the custom location. [tripathihsr]- this is the main issue , reference in ‘localextension’ are getting changed to another path with doesn’t exist (example, "/app/deploy/releases/0/hybris/bin/../../../../../custom, ) original path is "/app/deploy/releases/0/hybris/bin/custom 3. What OS are you using? [tripathihsr]- I tried both in centos7 & RHEL7 4. Can you confirm that after the failure, symbolic links exist pointing /app/deploy/current => /app/deploy/releases/0? [tripathihsr]- Yes, it does 5. Please post any customizations made to any of the yd.* properties files via ydeploy.properties, core.properties, or similar config files. [tripathihsr]-no customization in core,properties, path change in ydeploy.properties ( even tried with the default config but faced similar issue) yd.hybris.custom.ext.dir=${yd.root.dir}/../bin/custom yd.hybris.custom.config.dir=${yd.root.dir}/../config # hybris build tasks to perform when the ydeploy 'build' target is invoked yd.tasks.build.hybrisbuildtargets=customize all # hybris build tasks to perform when the ydeploy 'genrelease' target is invoked yd.tasks.genrelease.hybrisbuildtargets=customize all production yd.tasks.genrelease.output.dir=${yd.temp.dir}/genreleaseyd.tasks.genrelease.releasefileprefix=hybrisServer-Release # hybris build tasks to perform when the ydeploy 'deployrelease' target is invoked on the target server yd.tasks.deployrelease.hybrisbuildtargets=all 6. What is the structure and relative relationships between your hybris bin, config, custom, and ydeploy directories? Typically it would be something like hybris/bin, hybris/config, hybris/custom, and hybris/ydeploy, respectively. [tripathihsr]- 1st I tried default hybris-repo /config /localextensions.xml [ . . . ] /custom /custext1 /custext2 [ . . . ] /ydeploy Later I changed to below hybris-repo /hybris /bin /custom /custext1 /……. /config /localextensions.xml [ . . . ] /ydeploy Regards!
tripathihsr commented 7 years ago

some text messages are distorted see reference for #4 image

zmcmahon-avatria commented 7 years ago

@tripathihsr -

Thanks for providing all the info.

I had a chance to test your setup using 6.3 on windows & linux today, and it does look like you've run into an issue for linux setups caused by changes in the hybris 6.3 'production' build task. Specifically, they are now regenerating the config/localextensions.xml file by default (can disable with production.generate.extensionsxml=false property), but the paths are not being generated correctly when symbolic links are used for the bin/custom directory.

I've made some updates in the branch below which seemed to resolve the issue for me. Can you integrate these changes into your setup and retry? https://github.com/avatria/ydeploy/commit/37e26f0d9ea3e3aa80778bebe86f1658439afba1

You will need to run both 'build' and 'genrelease' again in a clean setup (i.e. delete anything under the ydeploy/temp directory) before running 'deployrelease'.

If all works well on your end, I will merge these changes into the master branch.

Thanks, Zach

tripathihsr commented 7 years ago

Hi Zach, glad to confirm that it is working fine. Thank you so much for quick assistance, have a great time! Regards!

zmcmahon-avatria commented 7 years ago

@tripathihsr - Glad to hear! Thanks again for reporting the issue and working through.

zmcmahon-avatria commented 7 years ago

Merged to master. Cut new release v0.1.4.