Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Failed to retrieve headers. #37

Closed
stephenegriffin opened this issue Feb 27, 2018 · 16 comments · Fixed by #50
Closed

ERROR: Failed to retrieve headers. #37

stephenegriffin opened this issue Feb 27, 2018 · 16 comments · Fixed by #50
Assignees

Comments

@stephenegriffin
Copy link
Member

(ported from #18 for @luisjmoreno)
Hi Stephen,
Bad news, I noticed a new change on the MHA version. Unfortunately, this new version broke everywhere in all my devices Mac, Windows and Internet Browsers. MHA doesn't work on any browser or email client such as Outlook for Windows or Mac.
Before this new version / change, MHC was working only on Outlook for Windows. Now, when I run MHA on an email on Windows, I get a message that says "Failed to retrieve headers". I have removed and re-added the app and still does not work.
Screen shot in Outlook for Mac

Screen shot in Outlook for Windows

Screen shot within OWA using Google Chrome (same results within other browsers, including IE)

We are running Exchange 2013 CU18 on premises. I have a different email on Outlook.com where I use MHA too and it works there. Please help!!

@stephenegriffin
Copy link
Member Author

Could you open the gear icon and click diagnostics, then paste the output here?
My working theory here is that REST or EWS (likely REST) isn't working in your environment.

@luisjmoreno
Copy link

Hi,

Thank you for replying. I apologize about post #18. Everything was working before and no major updates have been applied to our environment. How can I diagnose the REST or EWS?

Outlook for Mac uses EWS and everything seems to be working.

Let me know if you need anything else. Once again, thank you for looking into this.

  • Outlook for Windows Diagnostics
    User Agent = Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; InfoPath.3; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; rv:11.0) like Gecko
    Requirement set = 1.4
    hostname = Outlook
    hostVersion = 15.0.5007.1000
    itemType = message
    itemClass = IPM.Note
    contentLanguage = en-US
    displayLanguage = en-US
    touchEnabled = undefined
    ERROR: Failed to retrieve headers.

  • Outlook for Mac
    User Agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko)
    Requirement set = 1.5
    hostname = Outlook
    hostVersion = 16.9 (180116.02)
    itemType = message
    itemClass = IPM.Note
    contentLanguage = en-US
    displayLanguage = en-US
    touchEnabled = false
    ERROR: Unable to obtain callback token.

  • IE on Windows 10
    User Agent = Mozilla/5.0 ( compatible; MSIE 10.0; Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C;..NET4.0E; InfoPath.3; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729)
    Requirement set = 1.3
    hostname = OutlookWebApp
    hostVersion = 15.0.1347.3
    OWAView = ThreeColumns
    itemType = message
    itemClass = IPM.Note
    contentLanguage =
    displayLanguage = en-US
    touchEnabled = undefined
    ERROR: Failed to retrieve headers.

  • Google Chrome on Mac
    User Agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
    Requirement set = 1.3
    hostname = OutlookWebApp
    hostVersion = 15.0.1347.3
    OWAView = ThreeColumns
    itemType = message
    itemClass = IPM.Note
    contentLanguage =
    displayLanguage = en-US
    touchEnabled = undefined
    ERROR: Failed to retrieve headers.

@stephenegriffin
Copy link
Member Author

I think I need to put some more breadcrumbs in my error code. But ultimately, I think this is gonna be a server issue. Fiddler will show the traffic of requests. As I note in #18 (comment), you should see one of them failing.

@luisjmoreno
Copy link

Hi Stephen,
I am scratching my head on this one. I can't figure it out. I need additional guidance. I have installed other apps and these work without no issues.
Using IE (F12) and Fiddler. I see the traffic to this website https://mha.azurewebsites.net/ and not https://outlook.office365.com.

@stephenegriffin
Copy link
Member Author

I’m on vacation for a week, but when I get back I’d love to look at the fiddler output.

@stephenegriffin
Copy link
Member Author

Updated error logging should get us an error message+stack now

@skipdog77
Copy link

I've also been getting this -- immediate error is "Failed to Retrieve Headers"

Diags:

User Agent = Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; wbx 1.0.0; rv:11.0) like Gecko
Requirement set = 1.4
hostname = Outlook
hostVersion = 16.0.4654.1000
itemType = message
itemClass = IPM.Note
contentLanguage = en-US
displayLanguage = en-US
touchEnabled = undefined
ERROR: Failed to retrieve headers.
Sys.ArgumentNullException: Value cannot be null.
Parameter name: callback
r.CommonParameters.parse()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.01.js:17:205756,u.DDA.OutlookAppOm.prototype.makeEwsRequestAsync()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.01.js:17:132920,sendHeadersRequestEWS()@https://mha.azurewebsites.net/Scripts/GetHeadersEWS.js:25:9,sendHeadersRequest()@https://mha.azurewebsites.net/Scripts/GetHeaders.js:13:13,Anonymous function()@https://mha.azurewebsites.net/Scripts/Default.js:15:5,j()@https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js:2:26668,k.fireWith()@https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js:2:27425,ready()@https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js:2:29281,I()@https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js:2:29451

@stephenegriffin
Copy link
Member Author

On the hunch that namespaces are an issue, I renamed my callback - if this fixes this issue I need to do real work to clean up namespaces.

@stephenegriffin stephenegriffin self-assigned this Mar 12, 2018
@luisjmoreno
Copy link

luisjmoreno commented Mar 12, 2018

Hi Stephen,
Thank you for checking this. The new diagnostic displays the same error as Skipdog77.
Not sure what is causing the error. Last week, I used Fiddler and IE dev tools and noticed some weird messages right after I click the MHA button. I hope these help, let me know if I can do something to help more.

**** The results below were obtained using Fiddler and the IE developer tools **
<EDIT: @stephenegriffin removed a list of string constants not relevant to this issue>

@stephenegriffin
Copy link
Member Author

Dunno if I've fixed this one, but I think the error should change. Please speak up if you're still getting "Sys.ArgumentNullException: Value cannot be null. Parameter name: callback" or if the error has morphed. Also let me know if that was your error and now it works. Thanks!

@stephenegriffin
Copy link
Member Author

I've got a repro of this now...

stephenegriffin added a commit that referenced this issue Mar 14, 2018
@stephenegriffin
Copy link
Member Author

Ok - so here's the bug:
Outlook 2016 MSI uses an older version of outlook-win32-16.00.js than Outlook 2016 C2R. In the older version of this file, there is some code to check that a callback function is indeed a function. This code looks like this:

            if(Function.isInstanceOfType(args[0]))
                callback = args[0];

However, this returns false for our callback function. Over in C2R, this same check now looks like this:

            if($h.CommonParameters._argIsFunction$p(args[0]))
                callback = args[0];

Where argIsFunction is defined like so:

    $h.CommonParameters._argIsFunction$p = function(arg)
    {
        return typeof arg === "function"
    };

So in 2016 MSI, makeEwsRequestAsync thinks we didn't pass a callback, but in 2016 C2R, it correctly concludes we did.

Action plan: Report this back to Office dev, and also continue to hack to see if I can force something past the isInstanceOfType check.

@stephenegriffin
Copy link
Member Author

Didn't mean to close this without verification - anyone still getting Failed to retrieve headers? If you were getting it and it's now fixed, please report that. If you're still getting it, please report updated diagnostics output, including the stack. Thanks!

@luisjmoreno
Copy link

Hi Stephen,
Sorry, still partially broken. Here is my feedback. Thank you for working on this.

Outlook for Windows

  • Both Classic and New work great.

Still broken on these browsers and clients. Neither Classic or New view worked:

  • IE Firefox and Google Chrome Mac and Windows.
  • Broken for Outlook for Mac

Attached diagnostics output below.
----- ------- --Firefox on Windows
User Agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Requirement set = 1.3
hostname = OutlookWebApp
hostVersion = 15.0.1347.5
OWAView = ThreeColumns
itemType = message
itemClass = IPM.Note
contentLanguage =
displayLanguage = en-US
touchEnabled = undefined
ERROR: Cannot parse given Error object
parse@https://cdnjs.cloudflare.com/ajax/libs/stacktrace.js/2.0.0/stacktrace-with-promises-and-json-polyfills.min.js:1:1299
fromError/<@https://cdnjs.cloudflare.com/ajax/libs/stacktrace.js/2.0.0/stacktrace-with-promises-and-json-polyfills.min.js:2:14676
fromError@https://cdnjs.cloudflare.com/ajax/libs/stacktrace.js/2.0.0/stacktrace-with-promises-and-json-polyfills.min.js:2:14644
LogError@https://mha.azurewebsites.net/Scripts/uiToggle.js:117:9
ShowError@https://mha.azurewebsites.net/Scripts/uiToggle.js:93:5
callbackEWS@https://mha.azurewebsites.net/Scripts/GetHeadersEWS.js:60:9
sendHeadersRequestEWS/<@https://mha.azurewebsites.net/Scripts/GetHeadersEWS.js:18:13
makeEwsRequestAsync/i.onreadystatechange@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlookwebapp-15.01.js:17:5497
$2P_1@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlookwebapp-15.01.js:17:55509
$m_1/<@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlookwebapp-15.01.js:17:59912

-------- Outlook for Mac

User Agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko)
Requirement set = 1.5
hostname = Outlook
hostVersion = 16.9 (180116.02)
itemType = message
itemClass = IPM.Note
contentLanguage = en-US
displayLanguage = en-US
touchEnabled = false
ERROR: Unable to obtain callback token.
[object Object]
ShowError()@https://mha.azurewebsites.net/Scripts/uiToggle.js:93:13
{anonymous}()@https://mha.azurewebsites.net/Scripts/GetHeadersRest.js:21:22
{anonymous}()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-mac-16.00.js:9:165814
{anonymous}()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-mac-16.00.js:9:158350
agaveResponseCallback()@user-script:9:1:9847
agaveHostCallback()@user-script:9:1:5046
agaveHostCallback()@user-script:9:1:2578
{anonymous}()@https://mha.azurewebsites.net/pages/default.html?_host_Info=Outlook$Mac$16.02$en-US:1:60
global code()@https://mha.azurewebsites.net/pages/default.html?_host_Info=Outlook$Mac$16.02$en-US:1:135
ERROR: Unable to obtain callback token.
[object Object]
ShowError()@https://mha.azurewebsites.net/Scripts/uiToggle.js:95:23
{anonymous}()@https://mha.azurewebsites.net/Scripts/GetHeadersRest.js:21:22
{anonymous}()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-mac-16.00.js:9:165814
{anonymous}()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-mac-16.00.js:9:158350
agaveResponseCallback()@user-script:9:1:9847
agaveHostCallback()@user-script:9:1:5046
agaveHostCallback()@user-script:9:1:2578
{anonymous}()@https://mha.azurewebsites.net/pages/default.html?_host_Info=Outlook$Mac$16.02$en-US:1:60
global code()@https://mha.azurewebsites.net/pages/default.html?_host_Info=Outlook$Mac$16.02$en-US:1:135

User Agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko)
Requirement set = 1.5
hostname = Outlook
hostVersion = 16.9 (180116.02)
itemType = message
itemClass = IPM.Note
contentLanguage = en-US
displayLanguage = en-US
touchEnabled = false
ERROR: Unable to obtain callback token.
[object Object]
ShowError()@https://mha.azurewebsites.net/Scripts/uiToggle.js:93:13
{anonymous}()@https://mha.azurewebsites.net/Scripts/GetHeadersRest.js:21:22
{anonymous}()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-mac-16.00.js:9:165814
{anonymous}()@https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-mac-16.00.js:9:158350
agaveResponseCallback()@user-script:13:1:9847
agaveHostCallback()@user-script:13:1:5046
agaveHostCallback()@user-script:13:1:2578
{anonymous}()@https://mha.azurewebsites.net/pages/default.html?_host_Info=Outlook$Mac$16.02$en-US:1:60
global code()@https://mha.azurewebsites.net/pages/default.html?_host_Info=Outlook$Mac$16.02$en-US:1:13

@stephenegriffin
Copy link
Member Author

@luisjmoreno It looks like neither of those errors/stacks match the "Failed to retrieve headers" issue, so I'm gonna declare this one as fixed. I'll open new bugs to track these issues.

@stephenegriffin stephenegriffin changed the title Failed to retrieve Headers ERROR: Failed to retrieve headers. Mar 19, 2018
@stephenegriffin
Copy link
Member Author

This was caused by issuing our requests from an iFrame. Fixed by #50 which moved the calls back to the main frame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants