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

Accessing /services giving 404

trc41594544
Level 3
Level 3

If i try accessing any servlet with /services i am getting the below error. I do not see the entry in access logs also. This is Author instance and it does not have any dispatcher in front of it. 

 

Screen Shot 2020-07-28 at 8.38.18 AM.png

I do not see any where in AEM that it is blocked . If i access our instance with any random text, i am seeing it in access logs but not any thing that starts with /services/ . I am not getting 404 as expected for any other URL's other than anyone with /services/

 

We have /services/ path present in the Apache Sling servlet configuration. 

Screen Shot 2020-07-28 at 8.06.20 PM.png

 

Please let me know with thoughts. 

17 Replies
jbrar
Employee
Employee

Might be something to do with redirects. Check if you have anything under /etc/map

 

Also, use JCR Resolver(/system/console/servletresolver) to check the path and Servlet resolver(/system/console/servletresolver) to check which servlet will be serving this path.

trc41594544
Level 3
Level 3
There is nothing under /etc/map and also when i try the servlet path which starts with /services , it is resolving as expected.
trc41594544
Level 3
Level 3
correction to my comment. Any servlet path with /services/ is not resolving as expected. It is giving me the above error as in screenshot and it happens only with /services/
vanegi
Employee
Employee

Are you able to access the same servlet via publish server directly but not by dispatcher? If that is the case, then its most likely related to

CSRF, Referrer Filter, Headers, dispatcher configs.

 

Can you check Referrer Filter configuration in /configMgr and the ajax call request-headers? Could you share the request/response screenshot with headers? What do you see in the dispatcher logs for the same request?

 

Apache Sling Referrer Filter:

If the servlet is invoked externally then make sure the host name of the source system is added to the Allow Hosts section of the Apache Sling Referrer Filter

 

vanegi_0-1595945083951.jpeg

 

 

trc41594544
Level 3
Level 3
This is author only. Code is not deployed in publishers. Servlet is invoked internally in AEM, it is not coming from external systems. It is happening only with /services/ and nothing else. Every other call with different paths works.
Nupur_Jain
Community Advisor
Community Advisor

Hi @trc41594544 

 

Can you check if there is any filter rule to block /services/ request in dispatcher.any file? As you mentioned that there is no entry in access.log, it is more likely that the request is not even going to publisher and 404 is being thrown by dispatcher.

 

Check /filter section of the dispatcher to check for rule which might look like this:

/0012 { /type "deny" /method "GET" /url "/services/*" }

 

Hope it helps!

Thanks!

Nupur

trc41594544
Level 3
Level 3
I should have mention. This is Author instance. We do not have any dispatcher in front of it.
Nupur_Jain
Community Advisor
Community Advisor

Hi @trc41594544 

 

can you then check if path /services/ is present "Exceutions Paths" in "Apache Sling Servlet/Script Resolver and Error Handler" configuration.

Refer the below screenshot:


Screenshot from 2020-07-28 20-05-50.png

trc41594544
Level 3
Level 3
Yes, i have checked that. It is present in the execution paths.
sunjot16
Employee
Employee

You can check how your request is being processed/forwarded in /system/console/requests console.

 

You can also check the incoming requests in request.log, access.log and the reason for failure in error.log.

 

Also try enabling DEBUG logger for your custom servlet. That may also help.

 

Hope these help. 🙂 

 

trc41594544
Level 3
Level 3
The whole problem is that it is not coming in to AEM at all. I cannot see the request coming through in access.log. I could have figured out if there is a error in error log but i dont see it in access logs it self. If i access anything else other than /services/ i can see the request in access logs .
trc41594544
Level 3
Level 3
As this is author, there is no disptacher and there is nothing in front of our author instance. I am accessing the instance directly.
sunjot16
Employee
Employee
Can you please enable DEBUG logging for error.log loggers and see whether you get any requests for custom servlet in error.log file?
trc41594544
Level 3
Level 3
Yes, it is active and it is even resolving as expected when tried in /system/console/servletresolver .
BrianKasingli
Community Advisor
Community Advisor

@trc41594544., please check the Apache Sling Servlet/Script Resolver and Error Handler configuration, /system/console/configMgr/org.apache.sling.servlets.resolver.SlingServletResolver. Ensure that the /services/ path is present. 

Note: If a configured value ends with a slash, the whole sub tree is allowed. Without a slash an exact matching script is allowed. (servletresolver.paths)

Screenshot 2020-07-28 at 21.46.21.png

trc41594544
Level 3
Level 3
Thats not the problem. i can see services in execution paths. We have /services/ present in the execution paths.