Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AEMaaCS Dispatcher Validator Include Error

bmccurdy
Level 1
Level 1

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?

 

1 Reply
bmccurdy
Level 1
Level 1

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.

shelly-goel
Community Advisor
Community 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

bmccurdy
Level 1
Level 1
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.
TB3dock
Level 8
Level 8

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.