{"id":2149,"date":"2020-01-02T23:04:55","date_gmt":"2020-01-03T04:04:55","guid":{"rendered":"http:\/\/3.209.169.194\/blogs\/jonathan\/?p=2149"},"modified":"2020-01-02T23:04:55","modified_gmt":"2020-01-03T04:04:55","slug":"fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/","title":{"rendered":"Fixing A previous restore operation was interrupted and did not complete processing"},"content":{"rendered":"<p>I recently was working on a customer system where a myriad of bad things had occurred simultaneously that left them in a scenario where their primary database server had corruption of an important database and their DR Log Shipped Secondary server couldn&#8217;t be rolled forward due to the Restore job failing with the following type of error:<\/p>\n<p>RESTORE LOG AdventureWorks2014<br \/>\nFROM DISK = &#8216;D:\\SQLBackups\\Logs\\AdventureWorks2014_LOG_202001021250.trn&#8217;<br \/>\nWITH FILE = 1,NORECOVERY, STATS = 10<\/p>\n<p style=\"padding-left: 40px;\">14 percent processed.<br \/>\n31 percent processed.<br \/>\n49 percent processed.<br \/>\n66 percent processed.<\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #ff0000;\">Msg 3203, Level 16, State 1, Procedure s_res_translog_for_database, Line 70<\/span><br \/>\n<span style=\"color: #ff0000;\">Read on &#8220;D:\\SQLBackups\\Logs\\AdventureWorks2014_LOG_202001021250.trn&#8221; failed: 38(Reached the end of the file.)<\/span><br \/>\n<span style=\"color: #ff0000;\">Msg 3013, Level 16, State 1, Procedure s_res_translog_for_database, Line 70<\/span><br \/>\n<span style=\"color: #ff0000;\">RESTORE LOG is terminating abnormally.<\/span><\/p>\n<p>Further log restores on the log shipped secondary, even manually would also get this error:<\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #ff0000;\">Msg 4319, Level 16, State 3, Line 1<\/span><br \/>\n<span style=\"color: #ff0000;\">A previous restore operation was interrupted and did not complete processing on file &#8216;AdventureWorks2014log&#8217;. Either restore the backup set that was interrupted or restart the restore sequence.<\/span><br \/>\n<span style=\"color: #ff0000;\">Msg 3013, Level 16, State 1, Line 1<\/span><br \/>\n<span style=\"color: #ff0000;\">RESTORE LOG is terminating abnormally.<\/span><\/p>\n<p>Since the log shipped database was multi-terabytes in size, reinitializing it from backup wasn&#8217;t an ideal situation, but what other options are there?\u00a0 The key lies in the original error message from log shipping, the file restore of the log reached the end of the file and wasn&#8217;t expecting it to be the end of the file.\u00a0 This means one of two things happened:<\/p>\n<ol>\n<li>Either the log backup file was in flight when the main server crashed and restarted and only a partial backup file was written and then copied over to the log shipped secondary and the restore job tried to restore this broken file <strong>(NOTE: This was a theory that I have proven to not be possible as the header would have prevented the restore)<\/strong><\/li>\n<li>The backup had already completed and the copy file job was running when the server crashed and the file wasn&#8217;t fully copied over to the log shipped secondary and it tried to restore it when the restore job ran, generating the first exception<\/li>\n<\/ol>\n<p>Comparing the file on the source server to the file on the log shipped secondary revealed that the sizes were in fact different, which means that scenario two from above is most likely what occurred.\u00a0 The backup file on the log shipped secondary was deleted and then the full file was manually copied over to the secondary server. However, when the Restore Job would run, it would still fail with error 4319. Manually applying the file with restore log would also result in:<\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #ff0000;\">Msg 4319, Level 16, State 3, Line 1<\/span><br \/>\n<span style=\"color: #ff0000;\">A previous restore operation was interrupted and did not complete processing on file &#8216;AdventureWorks2014log&#8217;. Either restore the backup set that was interrupted or restart the restore sequence.<\/span><br \/>\n<span style=\"color: #ff0000;\">Msg 3013, Level 16, State 1, Line 1<\/span><br \/>\n<span style=\"color: #ff0000;\">RESTORE LOG is terminating abnormally.<\/span><\/p>\n<p>It seems totally broken, and then I tried the same file but specifying CONTINUE_AFTER_ERROR since at this point there wasn&#8217;t really much risk of doing more harm.\u00a0 I was maybe 50\/50 that this might work, but if it didn&#8217;t we were going to have to reinitialize from a full backup either way, so it was worth trying as it stood.<\/p>\n<p>RESTORE LOG AdventureWorks2014<br \/>\nFROM DISK = &#8216;D:\\SQLBackups\\Logs\\AdventureWorks2014_LOG_202001021250.trn&#8217;<br \/>\nWITH FILE = 1,NORECOVERY, STATS = 10, <strong>CONTINUE_AFTER_ERROR<\/strong>;<\/p>\n<p>The file restored and then the Log Shipping Restore Job immediately resumed normal restore operations of the subsequent files without errors.\u00a0 Since the file was not damaged, this worked and allowed the restore log operation to complete and clear the previous end of file encountered error bit successfully so further restore operations could be applied without errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently was working on a customer system where a myriad of bad things had occurred simultaneously that left them in a scenario where their primary database server had corruption of an important database and their DR Log Shipped Secondary server couldn&#8217;t be rolled forward due to the Restore job failing with the following type [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,55],"tags":[],"class_list":["post-2149","post","type-post","status-publish","format-standard","hentry","category-backup","category-log-shipping"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fixing A previous restore operation was interrupted and did not complete processing - Jonathan Kehayias<\/title>\n<meta name=\"description\" content=\"Fixing &quot;A previous restore operation was interrupted and did not complete processing&quot; errors % on restore to a log shipped secondary database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fixing A previous restore operation was interrupted and did not complete processing - Jonathan Kehayias\" \/>\n<meta property=\"og:description\" content=\"Fixing &quot;A previous restore operation was interrupted and did not complete processing&quot; errors % on restore to a log shipped secondary database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/\" \/>\n<meta property=\"og:site_name\" content=\"Jonathan Kehayias\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-03T04:04:55+00:00\" \/>\n<meta name=\"author\" content=\"Jonathan Kehayias\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jonathan Kehayias\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/\"},\"author\":{\"name\":\"Jonathan Kehayias\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"headline\":\"Fixing A previous restore operation was interrupted and did not complete processing\",\"datePublished\":\"2020-01-03T04:04:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/\"},\"wordCount\":623,\"commentCount\":1,\"articleSection\":[\"Backup\",\"Log Shipping\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/\",\"name\":\"Fixing A previous restore operation was interrupted and did not complete processing - Jonathan Kehayias\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\"},\"datePublished\":\"2020-01-03T04:04:55+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\"},\"description\":\"Fixing \\\"A previous restore operation was interrupted and did not complete processing\\\" errors % on restore to a log shipped secondary database.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Log Shipping\",\"item\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/category\\\/log-shipping\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Fixing A previous restore operation was interrupted and did not complete processing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/\",\"name\":\"Jonathan Kehayias - The Rambling DBA\",\"description\":\"The Rambling DBA\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sqlskills.com\\\/blogs\\\/jonathan\\\/#\\\/schema\\\/person\\\/01c10d94f3648654ef706d5e6305f69c\",\"name\":\"Jonathan Kehayias\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g\",\"caption\":\"Jonathan Kehayias\"},\"sameAs\":[\"http:\\\/\\\/3.209.169.194\\\/blogs\\\/jonathan\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fixing A previous restore operation was interrupted and did not complete processing - Jonathan Kehayias","description":"Fixing \"A previous restore operation was interrupted and did not complete processing\" errors % on restore to a log shipped secondary database.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/","og_locale":"en_US","og_type":"article","og_title":"Fixing A previous restore operation was interrupted and did not complete processing - Jonathan Kehayias","og_description":"Fixing \"A previous restore operation was interrupted and did not complete processing\" errors % on restore to a log shipped secondary database.","og_url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/","og_site_name":"Jonathan Kehayias","article_published_time":"2020-01-03T04:04:55+00:00","author":"Jonathan Kehayias","twitter_misc":{"Written by":"Jonathan Kehayias","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/#article","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/"},"author":{"name":"Jonathan Kehayias","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"headline":"Fixing A previous restore operation was interrupted and did not complete processing","datePublished":"2020-01-03T04:04:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/"},"wordCount":623,"commentCount":1,"articleSection":["Backup","Log Shipping"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/","name":"Fixing A previous restore operation was interrupted and did not complete processing - Jonathan Kehayias","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website"},"datePublished":"2020-01-03T04:04:55+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c"},"description":"Fixing \"A previous restore operation was interrupted and did not complete processing\" errors % on restore to a log shipped secondary database.","breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/fixing-a-previous-restore-operation-was-interrupted-and-did-not-complete-processing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/"},{"@type":"ListItem","position":2,"name":"Log Shipping","item":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/category\/log-shipping\/"},{"@type":"ListItem","position":3,"name":"Fixing A previous restore operation was interrupted and did not complete processing"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/","name":"Jonathan Kehayias - The Rambling DBA","description":"The Rambling DBA","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/#\/schema\/person\/01c10d94f3648654ef706d5e6305f69c","name":"Jonathan Kehayias","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86630e27f5deecc5c393ea57fc7c3b6a068949f4fd6b5309f81de5a276f12855?s=96&d=mm&r=g","caption":"Jonathan Kehayias"},"sameAs":["http:\/\/3.209.169.194\/blogs\/jonathan"]}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/2149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/comments?post=2149"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/posts\/2149\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/media?parent=2149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/categories?post=2149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/jonathan\/wp-json\/wp\/v2\/tags?post=2149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}