Description of problem: If an application is deployed to an AS instance's farm directory and the Update Content operation is performed, application is no longer deployed to farm. Version-Release number of selected component (if applicable): RHQ 3.0.0 JON 2.4.0 Embedded JOPR (admin-console) with EAP 5.0.0, EAP 5.0.1 How reproducible: Always Steps to Reproduce: 1. Setup a two node EAP cluster 2. Deploy an application (EAR/WAR) to node1's farm using admin-console 3. Verify application was deployed to both node1 and node2 4. Update the application using the same EAR/WAR (From admin-console, expand and select the deployed EAR/WAR and select it's Content tab and then click Update) Actual results: The updated deployed application is now only deployed to node1 in its deploy directory Expected results: The updated deployed application is deployed to node1 and node2 and appears in their farm directory Additional info: This is a result of the StandaloneManagedDeploymentComponent.deployPackages method invoking DeploymentUtils.deployArchive without a means of passing in whether to deploy farmed or not. Currently, the method appears to support a deployExploded boolean but no method of passing in whether it is farmed or not. The DeploymentUtils.deployArchive method should probably accept a deployFarmed boolean as well as the deployPackages method being updated to check to see if the updated deployment was farmed. Of course, this may be very error prone as this would be directly tied to a hard-coded path name. Maybe we should gather these options from ProfileService or Inventory before we remove the old deployment?
This issue also appears to be the direct cause of https://issues.jboss.org/browse/JBPAPP-8084
unassigning from Ian as he's focused on EAP6
http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5/html/Administration_And_Configuration_Guide/clustering-intro.chapt.html#clustering-quickstart for setting up a cluster. but... 03:05:01 PM) loleary: No need for an actual cluster... (03:06:07 PM) loleary: Basically... deploy farmed and confirm the app shows up in ${JBOSS_CONF}/farmed (03:06:29 PM) loleary: Then, re-deploy and you will see it get moved from ${JBOSS_CONF}/farmed to ${JBOSS_CONF}/deploy
A cluster is not necessary to confirm the bad behavior of WAR/EAR being deployed to farmed and then re-deployed to deploy, but for testing, an easy way to setup a two node cluster is: Install EAP 5 as normal Copy all or production configuration to server1 and server2 Be sure to enable admin account (jmx-console-users.properties) for server1 and serer2 Then start server1 as normal # Start EAP server1 # EAP 5.1.2 PRODDIST_BRANCH="origin/jboss-eap-5.1.2" pushd "${TESTENV_DIR}/$(basename ${PRODDIST_BRANCH})/jboss-as" \ && rm -rf server/server1/log \ && cd bin \ && ./run.sh -c server1 -b 0.0.0.0 & Then start server2 using a different port number and ServerPeerID # Start EAP server2 # EAP 5.1.2 PRODDIST_BRANCH="origin/jboss-eap-5.1.2" pushd "${TESTENV_DIR}/$(basename ${PRODDIST_BRANCH})/jboss-as" \ && rm -rf server/server1/log \ && cd bin \ && ./run.sh -c server2 -b 0.0.0.0 -Djboss.service.binding.set=ports-01 -Djboss.messaging.ServerPeerID=1 &
Created attachment 578137 [details] stack trace not only did I see the file get deployed to deploy/ and removed from farm/ but I also got the attached exception.
looks like we need to do the same thing that org.rhq.plugins.jbossas5.deploy.ManagedComponentDeployer.deploy(CreateResourceReport, ResourceType) does - it appears to switch to farm mode, then deploys: DeploymentManager deploymentManager = this.profileServiceConnection.getDeploymentManager(); boolean deployFarmed = deployTimeConfig.getSimple("deployFarmed").getBooleanValue(); if (deployFarmed) { Collection<ProfileKey> profileKeys = deploymentManager.getProfiles(); boolean farmSupported = false; for (ProfileKey profileKey : profileKeys) { if (profileKey.getName().equals(FARM_PROFILE_KEY.getName())) { farmSupported = true; break; } } if (!farmSupported) { throw new IllegalStateException("This application server instance is not a node in a cluster, " + "so it does not support farmed deployments. Supported deployment profiles are " + profileKeys + "."); } if (deployExploded) { throw new IllegalArgumentException( "Deploying farmed applications in exploded form is not supported by the Profile Service."); } deploymentManager.loadProfile(FARM_PROFILE_KEY); } String[] deploymentNames; try { deploymentNames = DeploymentUtils.deployArchive(deploymentManager, archiveFile, deployExploded); } finally { // Make sure to switch back to the 'applications' profile if we switched to the 'farm' profile above. if (deployFarmed) { deploymentManager.loadProfile(APPLICATIONS_PROFILE_KEY); } }
git commit to master 951ddce
Mazz, I am reassigning this to you as it fails due to package names not matching. It appears this might be related to the content version hash that is auto-generated and ends up in the file's name.
Setting Assigned To correctly
The AS5 deployer uses the file name as-is to determine the name of the app to be updated/deployed. Instead of adding the random UUID to the archive to be deployed, add the random UUID to a temp folder name and then download content there (leaving the file name unchanged). This issue has been fixed for both farmed and non-farmed deployments. Another update was to switch to the farm version of the AS5 deployer prior to stopping and deleting existing content. The switch to a farm deployer was happening too late (prior to deployment) and was not stopping and removing the farmed application prior to the new deployment. master branch commits: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=b458447208ec5207eea6f29eaafcd3ca9e5371a6 http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=c3bbd873832ec7df6d9db4b24190fabad7d1b48f
Update farmed Application Deployment (EAR/WAR) from JBoss ON GUI console was available
(4:21:56 PM) ccrouch: ips: how come you set the Target Release of https://bugzilla.redhat.com/show_bug.cgi?id=646631 to be RHQ4.3? (4:22:19 PM) ccrouch: i think it should be 4.5, given stefan_n's commits https://bugzilla.redhat.com/show_bug.cgi?id=646631#c19 (4:24:40 PM) ips: yeah, you're right, i misread the date on his commits (4:25:05 PM) ccrouch: ok, i'll reset it
Ian Springer <ian.springer> made a comment on jira EMBJOPR-366 I tried cherry-picking the three commits for bug 646631 to the AdminConsole_EAP_5_1 branch. Mazz's commit merged cleanly, but Stefan's two commits had a lot of conflicts, due to so much time passing since AdminConsole_EAP_5_1 was forked. To fix this, we'll either need to manually fix all those conflicts or upgrade the version of RHQ used by the AdminConsole_EAP_5_1 EmbJopr branch to 4.4 or 4.5.
Stefan Negrea <snegrea> made a comment on jira EMBJOPR-366 Cherry-picked the two commits to AdminConsole_EAP_5_1. I only merged changes relevant to farmed deployments. AdminConsole_EAP_5_1 branch commits: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=8a9c9cbdb14665c4a98dc2c74275a91fe4a9cf0b http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=83656e08b3fec3ffbc877e2603641af59ff24d7f
Larry O'Leary <loleary> updated the status of jira EMBJOPR-366 to Resolved
Larry O'Leary <loleary> made a comment on jira EMBJOPR-366 Committed to release branch for 1.3.4.SP6 as per https://issues.jboss.org/browse/EMBJOPR-366?focusedCommentId=12703452&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12703452
Larry O'Leary <loleary> updated the status of jira EMBJOPR-366 to Closed