Expand my Community achievements bar.

SOLVED

Build script generated virtual hosts and farm files not deployed in the Cloud Manager Build & Unit Testing Phase

Avatar

Community Advisor

Hi All,

 

I have the below scenario -

We are using a build script to generate the Virtual hosts and Farm files in our dispatcher folder.

STEP 1 - 

When running this deployment on cloud the virtual host and farm files are not listed in the CREATE_DISPATCHER_CONFIGURATION_ZIP phase as shown below - 

 

Begin stage: CREATE_DISPATCHER_CONFIGURATION_ZIP

adding: conf.d/enabled_vhosts/ (stored 0%)
adding: conf.d/enabled_vhosts/README (deflated 11%)

 

adding: conf.d/available_vhosts/ (stored 0%)
adding: conf.d/available_vhosts/default.vhost (deflated 48%)

 

adding: conf.dispatcher.d/available_farms/ (stored 0%)
adding: conf.dispatcher.d/available_farms/default.farm (deflated 58%)

 

adding: conf.dispatcher.d/enabled_farms/ (stored 0%)
adding: conf.dispatcher.d/enabled_farms/default.farm (stored 0%)
adding: conf.dispatcher.d/enabled_farms/README (deflated 7%)

STEP 2 -

When committing the files in the repo and deploying the below results are seen - 

Begin stage: CREATE_DISPATCHER_CONFIGURATION_ZIP

adding: conf.d/enabled_vhosts/ (stored 0%)
adding: conf.d/enabled_vhosts/brandA.vhost (stored 0%)
adding: conf.d/enabled_vhosts/README (deflated 11%)

 

adding: conf.d/available_vhosts/ (stored 0%)
adding: conf.d/available_vhosts/brandA.vhost (deflated 68%)
adding: conf.d/available_vhosts/default.vhost (deflated 48%)

 

adding: conf.dispatcher.d/available_farms/ (stored 0%)
adding: conf.dispatcher.d/available_farms/default.farm (deflated 58%)
adding: conf.dispatcher.d/available_farms/brandA.farm (deflated 63%)

 

adding: conf.dispatcher.d/enabled_farms/ (stored 0%)
adding: conf.dispatcher.d/enabled_farms/default.farm (stored 0%)
adding: conf.dispatcher.d/enabled_farms/README (deflated 7%)
adding: conf.dispatcher.d/enabled_farms/brandA.farm (stored 0%)

 

As seen the custom brandA farm file and virtual hosts files are picked and working as expected.

 

Why is this behavior so ?

I read a note on the link https://experienceleague.adobe.com/docs/experience-manager-cloud-manager/content/using/code-deployme...

Rohan_Garg_0-1660836500431.png

Is it because the Cloud Manager expects the file to be committed in the repo ?

If so, then is it not possible to have script generated vhosts, farms, mappings deployed on the cloud ?

 

@arunpatidar , @Sachin_Arora_@lukasz-m , @SantoshSai , @DEBAL_DAS , @Mohit_KBansal , @Jörg_Hoh , @kautuk_sahni 

 

Update - 

The Adobe Enterprise Support Team has the below response for this whole problem - 

The only way to update dispatcher configs is in code [1].
You first commit the code to the CMGR repo, then when you run a pipeline CMGR executes the maven commands and implements the code. If it isn't in the CMGR repo then it won't be in the code that CMGR builds

[1] https://github.com/adobe/aem-guides-wknd/tree/main/dispatcher

 

Thanks,

Rohan Garg

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi All,

 

Based on the Adobe Enterprise Support Team response below, I think on-deploy-scripts are not supported on AEMaaCS.

The only way to update dispatcher configs is in code [1].
You first commit the code to the CMGR repo, then when you run a pipeline CMGR executes the maven commands and implements the code.
If it isn't in the CMGR repo then it won't be in the code that CMGR builds
[1] https://github.com/adobe/aem-guides-wknd/tree/main/dispatcher

 

Also checking ACS AEM Commons repo for below URL, I see that Jörg_Hoh has updated the below  - 

https://github.com/joerghoh/acs-aem-commons/commit/77daf60657ba91b8959cbe694b4a8530035e86ee

 

Rohan_Garg_0-1661173194636.png

View solution in original post

10 Replies

Avatar

Community Advisor

Hi Arun, Here's the result of the cloud validator  -

 

C\Users\rohan.garg\aem-sdk\dispatcher\aem-sdk-dispatcher-tools-2.0.91-windows\bin>validator.exe full -d ../out D:\DestPet\Branches\Dispatcher_BrandA\aemrepo\dispatcher\src
Cloud manager validator 2.0.34
2022/08/22 11:55:45 conf.d\available_vhosts\brandA.vhost:64: included file (conf.d\rewrites\brandA_rewrite.rules) does not match any known file

<IfModule mod_rewrite.c>
RewriteEngine on
Include conf.d/rewrites/rewrite.rules
Include conf.d/rewrites/brandA.rules //Line #64

As seen the cloud manager validator would gives error in this case as only 'rewrites' and 'variables' files can be specified as includes vhost configuration files.

Avatar

Community Advisor

you can't have multiple rewrite rules file.

 

Add your rules in 

conf.d/rewrites/rewrite.rules

 



Arun Patidar

Avatar

Community Advisor

Rohan_Garg_0-1661152939054.png

 

C:\Users\rohan.garg\aem-sdk\dispatcher\aem-sdk-dispatcher-tools-2.0.91-windows\bin>validator.exe full -d ../out D:\DestPet\Branches\Dispatcher_BrandA\aemrepo\dispatcher\src
Cloud manager validator 2.0.34
2022/08/22 12:51:21 conf.d\rewrites\rewrite.rules:9: included file (conf.d\rewrites\brandA.rules) does not match any known file

 

Still getting the same error! But is this the root cause why the vhost and farm files aren't picked ?
If I commit these files then even in vhost file multiple includes for rewrites are accepted and working as intended.

Avatar

Community Advisor

with AEMaaCS dispatcher, you can have only one rewrite file which is rewrite.rule except defualt_rewrite.rules that you should not change.

 

 



Arun Patidar

Avatar

Community Advisor

Understood that but then when we have a multi-tenant architecture would the rewrite rules for all sites be in one rewrite.rule file ?

 

The validator displays no issue found if I put all rewrites in rewrite.rule file.

C:\Users\rohan.garg\aem-sdk\dispatcher\aem-sdk-dispatcher-tools-2.0.91-windows\bin>validator.exe full -d ../out D:\DestPet\Branches\Dispatcher_BrandsA\aemrepo\dispatcher\src
Cloud manager validator 2.0.34
2022/08/22 14:57:48 No issues found
2022/08/22 14:57:48 Dump folder already exists and non-empty: ../out

 

Anyways, I will make this change for now as we have only 1 site and push it to deployment to see if that takes care of the script generated vhost, farm file issues as well.

Avatar

Community Advisor

@arunpatidar - I deployed the build with the suggested changes, The cloud validator has thrown no issues. However, the farm files and vhost files which are generated in repo are still not picked by the CREATE_DISPATCHER_CONFIGURATION_ZIP.

Any further ideas/tips on how to get around this issue ?


The Adobe Enterprise Support Team has the below response for this whole problem - 

The only way to update dispatcher configs is in code [1].
You first commit the code to the CMGR repo, then when you run a pipeline CMGR executes the maven commands and implements the code. If it isn't in the CMGR repo then it won't be in the code that CMGR builds

[1] https://github.com/adobe/aem-guides-wknd/tree/main/dispatcher

Avatar

Community Advisor

check your pipeline if webconfig is unchecked? There is a dedicated pipeline for dispatcher config, try with that maybe.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/using-... 



Arun Patidar

Avatar

Community Advisor

We already have a dedicated pipeline for dispatcher config as recommended.

Rohan_Garg_1-1661173826519.png

 

Do you know if any project on cloud is using the on deploy scripts as a feature ?

Even ACS Commons repo seems to have stated that on deploy scripts are not supported on AEMaaCS

Avatar

Correct answer by
Community Advisor

Hi All,

 

Based on the Adobe Enterprise Support Team response below, I think on-deploy-scripts are not supported on AEMaaCS.

The only way to update dispatcher configs is in code [1].
You first commit the code to the CMGR repo, then when you run a pipeline CMGR executes the maven commands and implements the code.
If it isn't in the CMGR repo then it won't be in the code that CMGR builds
[1] https://github.com/adobe/aem-guides-wknd/tree/main/dispatcher

 

Also checking ACS AEM Commons repo for below URL, I see that Jörg_Hoh has updated the below  - 

https://github.com/joerghoh/acs-aem-commons/commit/77daf60657ba91b8959cbe694b4a8530035e86ee

 

Rohan_Garg_0-1661173194636.png