{"id":8733,"date":"2016-02-05T21:02:38","date_gmt":"2016-02-05T21:02:38","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/fixing-the-the-operation-took-too-long-error-in-o365\/"},"modified":"2016-07-28T10:57:45","modified_gmt":"2016-07-28T10:57:45","slug":"fixing-the-the-operation-took-too-long-error-in-o365","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/fixing-the-the-operation-took-too-long-error-in-o365\/","title":{"rendered":"Fixing the &quot;The operation took too long&quot; Error in O365"},"content":{"rendered":"<p>I was attempting to deploy a provider-hosted application to my O365 instance and it was failing with an extremely helpful message reading &#8220;The operation took too long&#8221;.&#160; In the past, we&#8217;ve seen situations where a remote event receiver took too long to execute, but the message that comes back says something about the remote event receiver not returning a successful status.&#160; Plus, my remote event receiver was never getting hit, so the error was occurring somewhere during the package deployment process, long before ever trying to call out to the remote event receivers.<\/p>\n<p>In an attempt to figure out what was wrong, I took out the remote event receiver calls from the app manifest to verify those were not the issue.&#160; When that solved nothing I started removing features from the package until I was left with, essentially, an empty app package.&#160; Still didn&#8217;t work. <\/p>\n<p>So I decided to clear my site collection (it&#8217;s a dev environment) and start from scratch.&#160; One thing I like to do is delete the app principal entirely from O365 to make sure it&#8217;s fresh, but when I went to remove the app principal it was nowhere to be seen.&#160; <\/p>\n<p>Now, the thing that makes this especially odd is that I distinctly remember heading on over to the AppInv.aspx page, typing in my app&#8217;s client ID, and it successfully looked up that app principal.&#160; And to confirm, I headed back over to that AppInv.aspx page and tried again.&#160; Sure enough, even though there was no App Principal defined according to O365, that page pulled up my App Principal registration information without any problem. <\/p>\n<p>One of the annoying things is that if this scenario played out in an on-premise SharePoint environment, the error that comes back is actually fairly helpful.&#160; It essentially outright informs you that your app principal does not exist, but in O365 all you get is &#8220;The operation took too long&#8221;.&#160; Technically, the error is accurate because it takes forever before it actually fails, but it&#8217;s far from helpful.<\/p>\n<p>So the fix, at least in this specific scenario, is to register your App Principal again using AppRegNew.aspx, and then deploy the application again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was attempting to deploy a provider-hosted application to my O365 instance and it was failing with an extremely helpful message reading &#8220;The operation took too long&#8221;.&#160; In the past, we&#8217;ve seen situations where a remote event receiver took too long to execute, but the message that comes back says something about the remote event&#8230;&hellip;<\/p>\n","protected":false},"author":46738,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-8733","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/8733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/46738"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=8733"}],"version-history":[{"count":3,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/8733\/revisions"}],"predecessor-version":[{"id":42533,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/8733\/revisions\/42533"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=8733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=8733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=8733"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=8733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}