Expand my Community achievements bar.

AEMaaCS Dispatcher Validator Include Error

Avatar

Level 2

I'm running into an issue with the dispatcher validator complaining that my custom rewrite file is not found and curious if anyone has had a similar issue.

 

This is a pretty basic setup so far as the project is just getting going. It is for a new AEMaaCS impl so no conversions from old Apache/Dispatcher configs.

 

We have copied the default.vhost file and renamed appropriately and created a symlink to the file in the enabled_vhosts folder.

 

In the vhost file we have the following include:

 

Include conf.d/rewrites/client_rewrite.rules

 

in the conf.d/rewrites folder created a client_rewrite.rules file and place some basic rewrites for the homepage.

 

When running the validator (Version 2.0.32) it stops and says this file cannot be found.

 

I've verified the file exists and is properly named, verified the file permissions and that the file can be read.

 

If we change the include and file name to just rewrite.rules the file is found and everything works fine. Changing the include and filename to anything else causes the file to not be found.

 

It seems like the validator simply does not like rewrite files named something other than the default rewrite.rules. Are multiple rewrite files not allowed anymore?

 

5 Replies

Avatar

Level 2

Here are some steps to reproduce this issue:

 

  1. Create a new AEM project using latest archtype:

 

mvn -B archetype:generate \
 -D archetypeGroupId=com.adobe.aem \
 -D archetypeArtifactId=aem-project-archetype \
 -D archetypeVersion=27 \
 -D appTitle="My Site" \
 -D appId="mysite" \
 -D groupId="com.mysite" \
 -D aemVersion=cloud

 

  • Copy the rewrite.rules file to a new file for custom rewrites

 

cp mysite/dispatcher.cloud/src/conf.d/rewrites/rewrite.rules mysite/dispatcher.cloud/src/conf.d/rewrites/my_rewrite.rules

 

  • Update the rewrite.rules file to include the new my_rewrite.rules file and remove duplicate rewrites

 

#
# This file contains the rewrite rules, and can be customized.
#
# By default, it includes just the rewrite rules. You can
# add rewrite rules to this file but you should still include
# the default rewrite rules.

Include conf.d/rewrites/default_rewrite.rules
Include conf.d/rewrites/my_rewrite.rules

 

  • Run the dispatcher validate script that comes with the AEMaaCS dispatcher tools so that we can test our configs locally

 

./bin/validate.sh ~/projects/test-site/mysite/dispatcher.cloud/src

 

  • Notice output of above command does not find my_rewrite.rules file

 

Phase 1: Dispatcher validator
Cloud manager validator 2.0.32
2021/06/14 14:59:22 conf.d/rewrites/rewrite.rules:9: included file (conf.d/rewrites/my_rewrite.rules) does not match any known file

 

 

Many clients have multiple vhosts and different rewrites/redirects that need to be implemented on a per vhost basis. Either there is something I'm doing wrong or this seems like a giant misstep.

Avatar

Employee Advisor

@bmccurdy  As per the documentation.

"Currently, a single rewrite file must be used rather than files that are site-specific. As a rule, the sum of the contents of the customizable files must be less than 1MB."

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

 

Also search for "included file (…) does not match any known file" to find the error related to your issue

Avatar

Level 2
Thanks I must have missed that when reviewing the docs. IMHO that is going to be a huge problem for clients with multiple subdomains or just from a rewrite management point of view. I guess this also means you can no longer use a map file on Apache to get better performance out of your rewrites.

Avatar

Level 9

This limitation is both arbitrary and crippling. We just wasted days on the same issue.  Its going to make maintenance of our vhost specific and shared rewrite rules a nightmare.  

Avatar

Level 2

Hi @bmccurdy 

My guess is that the restrictions you mentioned are inherent with the "Legacy mode" of Dispatcher configurations.

With AEM archetype 28 Adobe has released a "Flexible mode" of Dispatcher configurations which doesn't have these limitations.

Customers can activate this mode by adding the folder and file opt-in/USE_SOURCES_DIRECTLY

By using this more flexible mode, there are no limitations in the file structure under the rewrites folder that in legacy mode required a single rewrite.rules file. Also, there is no limitation on the number of rules you can add.

 

Adobe Docs Ref -

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

 

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

 

Regards,

Amber