2015-08-03 102 views
3

我目前正在將一個新的支付系統(可靠地)整合到我的網站中。這涉及將一個jsonstring發送給Trustlys服務器。此代碼在本地完美運行,但在Azure的測試環境中,我得到了502錯誤的網關錯誤。什麼奇怪的是應用程序似乎打破try塊內,但以下catch塊不會觸發。考慮以下代碼:502 Azure網站上的錯誤網關錯誤

 var postData = PrepJsonForTrustly(someSecretData); 

     try 
     { 
      _logger.Info("attempting Deposit to trustly"); //this shows up in my logs 
      var res = _client.Deposit(postData); 
      _logger.Info("TrustlyDeposit successful"); //this doesn't 
      return res; 
     } 
     catch (Exception ex) 
     { 
      _logger.Info("Failed Deposit to Trustly"); //and, oddly, neither does this! 
      throw ex; 
     } 

Googleing我發現這個http://blog.wouldbetheologian.com/2014/07/502-bad-gateway-error-on-azure-websites.html

這似乎是描述大部分相同symtoms的,除了我的代碼工作完全在本地主機上的問題,他所描述的stackoverflowexception會崩潰我的本地服務器太。

任何想法可能導致這種情況?或者爲什麼我的catch-block沒有開火?

回答

6

丟失日誌的一種可能的解釋是如果進程崩潰。您是否檢查過eventlog.xml文件(位於logFiles文件夾中) - 這是編寫應用程序事件日誌的文件。

+1

yup,顯然這個過程在從文件系統中讀取.pfx時崩潰了......應該已經有一個加載到certificatestore顯然=)奇怪的是整個過程只是在azure中死掉, ! –