Expand my Community achievements bar.

Accessing /services giving 404

Avatar

Level 4

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. 

18 Replies

Avatar

Employee Advisor

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.

Avatar

Level 4
There is nothing under /etc/map and also when i try the servlet path which starts with /services , it is resolving as expected.

Avatar

Level 4
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/

Avatar

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

 

 

Avatar

Level 4
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.

Avatar

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

Avatar

Level 4
I should have mention. This is Author instance. We do not have any dispatcher in front of it.

Avatar

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

Avatar

Level 4
Yes, i have checked that. It is present in the execution paths.

Avatar

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.  

 

Avatar

Level 4
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 .

Avatar

Level 4
As this is author, there is no disptacher and there is nothing in front of our author instance. I am accessing the instance directly.

Avatar

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?

Avatar

Level 4
Yes, it is active and it is even resolving as expected when tried in /system/console/servletresolver .

Avatar

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

Avatar

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

Avatar

Level 2

Hi @trc41594544 ,

did you get any solution for this, even i am getting the same issue