Weird request from source map to MVC - asp.net

I am getting the following error messages in my logging after a recent release:
The controller for path '/cspuat/node_modules/angular/angular.min.js.map' was not found or does not implement IController.
It would appear that somehow a request is being made to the server from the source map file.
I have tried adding the folling IngoreRoute
routes.IgnoreRoute("{resource}.map/{*pathInfo}");
But the error is still happening.

Related

Why does an actionlink in _Layout.cshtml that leads to nowhere report 500 Error instead of 404 File Not Found?

When deploying a website via Azure web apps. I created an empty action link in _Layout.cshtml as such:<li>#Html.ActionLink("Crash", "Crash", "Home")</li>.
In Views/Home which is where all the cshtml files are stored, I did not create a specific cshtml file for Crash.
After finishing my deployment, I went to the website and clicked on Crash as it's one of the available tabs. This led to a 500.0 Internal Server Error.
I am unfamiliar with the error codes and what they represent. So I was confused as to why it threw a 500 instead of 404 File Not Found. My thought process was that if the action link leads to nowhere, then the server cannot find that corresponding file that can be served, hence it should prompt File Not Found.
Here is the detailed error information
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler System.Web.Mvc.MvcHandler
Error Code 0x00000000
Requested URL https://testurltesturlfake:80/Home/Crash
Physical Path C:\home\site\wwwroot\Home\Crash
Logon Method Anonymous
Logon User Anonymous
But it's giving a 500, why?

The route is truncated on my Symfony application getting a 404 error

I have two differents pages getting the same error in my symfony3.4 application.
It is a detail page of an entity, it is working most of the time but sometimes and I don't know what is triggering the error, I get a 404 error and I can see my route truncated in the error.
The route is : {base_url}/app_dev.php/stock/model/{id}/detail
On some of my resources, the error message is :
It seems to happend on specific entities but I have no clues about what could possibly trigger that kinds of error.
Any idea of what I could investigate to debug ?
-- EDIT --
It seems that the route is working fine using {base_url}/web/app_dev.php , the problem appears when the route has no /web in dev mode ({base_url}/app_dev.php)
Sometimes Symfony3 throught a 404 error in dev mode without the /web . It is a server configuration matter. Check https://symfony.com/doc/3.4/setup/web_server_configuration.html for more informations

How to disable fatal error in symfony

When my app couldn't connect to the database it throws a Fatal Error message :
so how to show a custom error page for this error like 404 page error ?
is there any configuration to do in symfony config.yml ?
thank you !
You can display custom 404, 403, 500 errors if you will override your default Twig-based template. For this purpose you should create folder "TwigBundle" in your app/Resources directory and emulate the following structure:
That should help. The mechanism is the same as for 404 page. This also can help you to extend my answer: Symfony documentation
You can also create Service and mark it as exception listener. In this service you can log your exception and display any response you like. You can actually do anything that can be done within Symfony Service.
More details:
Symfony documentation
My previous answer on this topic

i18n translations do not work when error page is inluded by ACS commons error page handler

The i18n part of error page does not work when response from the error page designated by the errorPages property is included by the error page handler.
The translations work fine when the error page is requested directly . However it fails to pick up any values and falls back to the key when the response of the error page is included by includeUsingGET method
Example :
com.day.cq.i18n.I18n i18n = new com.day.cq.i18n.I18n(slingRequest.getResourceBundle(currentPage.getLanguage(false)));
String translatedValue = i18n.get("key");
out.write(translatedValue);
Output when error page is accessed directly with a get request -> translatedValue
Output when the error page is included by errorpagehandler on a 404
-> key
The value of currentPage.getLanguage(false).getLanguage() is same in both the cases.
NOTE : I have already created an issue on github regarding this, asking a question here as stackoverflow has larger audience.
Please, try add config /apps/sling/config/org.apache.sling.i18n.impl.I18NFilter.xml.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
service.ranking="-10000"
sling.filter.scope="[REQUEST,ERROR]"/>
Also you can do this config in the "Adobe Experience Manager Web Console
Configuration" (http://example.com:4502/system/console/configMgr).
At least in version 5.5 we encountered this problem for any page that resulted in an error page getting loaded. We did not find a good solution. This goes beyond the ACS commons error page and seems to be an issue internal to CQ5.
You are likely going to have to write your own code to load the bundle OUTSIDE of the sling request. I would suggest writing your own OSGI service for this and calling that instead of the the slingRequest.getResourceBundle() approach.
Just edit your org.apache.sling.i18n.impl.I18NFilter.config, adding the following line (without spaces):
sling.filter.scope=["REQUEST","ERROR"]
As Rampant says , it is a Bug with the application and has nothing to do with ACS-commons error page handler. The bug was in Sling (link) , i18n filter which loads the correct resourceBundle was not firing for error scope. The issue has been corrected in r1430633. Looks like this fix hasn't made its way to 5.6.1 yet. A workaround for dealing with it can be found at https://forums.adobe.com/message/5012581.

404:signalr/hubs for signalR chat application

I am trying to create a chat application using signalR using VS2012 web in a website.
But its showing me error like this:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:50780/WebApplication1/WebApplication1/signalr/hubs
Uncaught TypeError: Cannot read property 'client' of undefined
I have added RouteTable.Routes.MapHubs(); to Global.asax
But why should its showing me this error when its opening for other's system.
On the page where you're including signalr/hubs:
Change your script tag to look like this:
<script src="~/signalr/hubs"></script>
#drch's answer is also correct (if you're making that mistake) but the more common issue I see is people just doing "signalr/hubs" in their script tag and then the hubs url is then incorrect (in some circumstances).
Ultimately the hubs url resides off of the SignalR endpoint so doing a "~/signalr/hubs" makes the path app relative which should ensure that it retrieves the hubs.js from the correct url.
I know, that I'm late, but for smbd who will finding answers:
I've resolved the problem by registrate .Net frame work to IIS.
Do next steps into console (Win+R):
cd %windir%\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe –i
Source

Resources