javascript - ASP Web API call to /Token intermittent -


since have deployed app test environment, calls /token (to log in , token) playing up. problem won't work @ few calls (takes 30 seconds , returns 500 error), of sudden start working (and working flawlessly, reply in <50ms).

on localhost on dev machine, has never skipped beat.

my dev setup on localhost; test setup has 3 servers - 1 html/js , iis rewrite points second server hosts apis , third db server.

same response via following javascript:

        var logindata = {         grant_type: 'password',         username: self.loginemail(),         password: self.loginpassword()     };      $.ajax({         type: 'post',         url: url + '/token',         data: logindata     }).done(function (data) {         self.loggedinusername(data.username);         // cache access token in session storage.         sessionstorage.setitem(tokenkey, data.access_token); 

or if use postman same response.

web.config:

  <system.webserver> <httperrors errormode="detailed" /> <validation validateintegratedmodeconfiguration="false" /> <modules runallmanagedmodulesforallrequests="true">   <remove name="webdavmodule"/> </modules> <httpprotocol>   <customheaders>     <add name="access-control-allow-headers" value="content-type" />     <add name="access-control-allow-methods" value="get, post, put, delete, options" />   </customheaders> </httpprotocol> 

also have put following:

            globalconfiguration.configuration.includeerrordetailpolicy         = includeerrordetailpolicy.always; 

in global.asax file error messages still aren't showing (wonder if iis rewrite hiding them?)

edit: calls /api work flawlessly, it's /token that's playing up.

ah silly problem.

detailed errors not working going via iis rewrite. started hitting api directly , errors showing "network path not found".

turns out had dns of db server connecting wrong ip (the non-domain joined one). still think it's strange intermittent seems working now.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -