receiving a random script in case of 404 error | Community
Skip to main content
New Participant
Aug 25, 2020 10:01 PM UTC
Solved

receiving a random script in case of 404 error

Hello everyone,

I am facing a strange issue for the website(sorry, can't share the URL) - receiving a random script on pages in case of 404 error - which is not configured.

What could be the possible reason causing it? Any idea?

I am using AEM6.2 as instance..

 

Appreciate your help!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Ravi_Pampana
Ravi_PampanaAccepted solution
New Participant
Aug 25, 2020 10:47 PM UTC

Hi,

 

Are you seeing the script in view source ? If so it is being added via code. 

 

If you don't see it in view source, search in the javascript files being included, the file might be getting added from a js file. you need to check all the 3rd party javascript files, one of them may be adding that if the page is 404.

 

In chrome we can search within static files by going to "Sources" tab 

 

 

Hope this helps!

7 replies

BrianKasingli
New Participant
Aug 26, 2020 8:38 PM UTC

Check your 404.jsp, basePage.jsp or basePage.html scripts, there might be code unwanted code there.

Translate
Nikhil-Kumar
New Participant
Aug 26, 2020 4:07 AM UTC

@riten 

Can you share the error that you are getting and where exactly it comes up ?

Thanks,
Nikhil Kumar

Translate
Vaibhavi_J
Level 7
Aug 26, 2020 3:56 AM UTC

Hi @riten ,

You can view a script in devtools where you can get the complete path of it. This gives clear idea on from where the script is being loaded. 

If you are still facing the issue to recognize,please share the screen shot of script

Translate
Level 2
Aug 26, 2020 3:41 AM UTC

Also check, if the script is included externally through Tag Managers(DTM, Launch, or GTM) at runtime.

Regards

Albin I

www.albinsblog.com

Translate
SundeepKatepally
New Participant
Aug 26, 2020 2:58 AM UTC

404 can occur at one of the 3 levels

1) CDN

2) Apache(Dispatcher)

3) AEM Publish

 

Do check , first at which level it is occurring and then it would be easy to debug. In case of AEM , you need to check for custom 404 handling.

Translate
Level 2
Aug 26, 2020 2:49 AM UTC

hi @riten - Hope you have done this, please check the customization you have done on 404.jsp page. That might be one of the possible reasons. Do you see this script on 404 pages in direct publish instances ?

Translate
Ravi_Pampana
Ravi_PampanaAccepted solution
New Participant
Aug 25, 2020 10:47 PM UTC

Hi,

 

Are you seeing the script in view source ? If so it is being added via code. 

 

If you don't see it in view source, search in the javascript files being included, the file might be getting added from a js file. you need to check all the 3rd party javascript files, one of them may be adding that if the page is 404.

 

In chrome we can search within static files by going to "Sources" tab 

 

 

Hope this helps!

Translate