I have a webapi/angular website hosted on same azure appservice. so /site/api has my authentication token and other apis. and /site/app has my angular app.
Issue is, on our staging, which is not azure app service but a windows 2012 VM with IIS 7, everything works ok. I run the angular website on IE, firefox, chrome and safari, and no issues anywhere.
But then i browse my application hosted on azure website, it keeps crashing in chrome at someplaces where i have made a $http call. i get internal server 500 and i am trying but cant see more details. same angular app hosted on azure website, when browsed on IE and firefox, doesn't give me any error. I have also added verb OPTION to my web.config but not helping.
error seen in chrome :
{Message: "An error has occurred."}
Message :"An error has occurred."
thanks.
more log data :
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>3</Level>
<Opcode>16</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2016-06-21T04:25:31.841Z"/>
<Correlation ActivityID="{00000000-0000-0000-9D0F-0080000000E9}"/>
<Execution ProcessID="76" ThreadID="5400"/>
<Computer>RD0003FF853E2D</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-9D0F-0080000000E9}</Data>
<Data Name="ModuleName">__DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule, Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35_53f2659e-bb7a-4b20-8ef3-c37bb14b89e2</Data>
<Data Name="Notification">64</Data>
<Data Name="HttpStatus">500</Data>
<Data Name="HttpReason">Internal Server Error</Data>
<Data Name="HttpSubStatus">0</Data>
<Data Name="ErrorCode">0</Data>
<Data Name="ConfigExceptionInfo"></Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>MODULE_SET_RESPONSE_ERROR_STATUS</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
<freb:Description Data="Notification">PRE_EXECUTE_REQUEST_HANDLER</freb:Description>
<freb:Description Data="ErrorCode">The operation completed successfully.
(0x0)</freb:Description>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>5</Level>
<Opcode>49</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2016-06-21T04:25:31.841Z"/>
<Correlation ActivityID="{00000000-0000-0000-9D0F-0080000000E9}"/>
<Execution ProcessID="76" ThreadID="5400"/>
<Computer>RD0003FF853E2D</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-9D0F-0080000000E9}</Data>
<Data Name="Buffer">{"Message":"An error has occurred."}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>GENERAL_RESPONSE_ENTITY_BUFFER</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred.Detailed Error Information: Module __DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule, Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35_53f2659e-bb7a-4b20-8ef3-c37bb14b89e2 Notification PreExecuteRequestHandler Handler System.Web.Http.WebHost.HttpControllerHandler Error Code 0x00000000 Logon Method Bearer Logon User admin
the cors setting was bit off. updating web.config to below fixed it.
<add key="webpages:Version" value="2.0.0.0" />
<add key="CORSOrigins" value="https://domainname.net" />
<add key="CORSMethods" value="OPTIONS, GET, POST" />
<add key="Access-Control-Allow-Headers" value="Origin, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.