AEMaaCS Dispatcher Validator Include Error

Avatar

Avatar
Boost 1
Level 1
bmccurdy
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
bmccurdy
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
bmccurdy
Level 1

14-06-2021

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?

 

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Boost 250
MVP
shelly-goel
MVP

Likes

250 likes

Total Posts

410 posts

Correct reply

107 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
Ignite 3
Give Back 10
View profile

Avatar
Boost 250
MVP
shelly-goel
MVP

Likes

250 likes

Total Posts

410 posts

Correct reply

107 solutions
Top badges earned
Boost 250
Affirm 100
Give Back 25
Ignite 3
Give Back 10
View profile
shelly-goel
MVP

15-06-2021

@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

Avatar
Boost 1
Level 1
bmccurdy
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
bmccurdy
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
bmccurdy
Level 1

14-06-2021

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.