{"id":2215,"date":"2011-12-22T09:40:34","date_gmt":"2011-12-22T09:40:34","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=2215"},"modified":"2024-04-12T09:55:14","modified_gmt":"2024-04-12T09:55:14","slug":"rbs-external-provider-invalid-reference","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/rbs-external-provider-invalid-reference\/","title":{"rendered":"RBS external provider invalid reference"},"content":{"rendered":"<p>Inside every Content Database is a key table called AllDocs; when configured for RBS there is a field called DocFlags that can provide insights into the configuration.\u00a0 If the value is 65868, it indicates to the RBS Provider to leverage the deprecated Farm ExternalBinaryStoreClassId, which was used as part of EBS in SP2007.\u00a0 You can see whether this is set for your farm by running these two PowerShell commands. For my farm, it gives a zeroed out GUID:<\/p>\n<pre lang=\"php\">\r\nPS C:\\Users\\SP2013Farm> $farm = Get-SPFarm\r\nPS C:\\Users\\SP2013Farm> $farm.ExternalBinaryStoreClassId\r\nGuid\r\n----\r\n00000000-0000-0000-0000-000000000000\r\n<\/pre>\n<p>The following SQL run in the context of your content database provides a count of this DocFlag:<\/p>\n<pre lang=\"php\">\r\nselectCOUNT(*)\r\nfrom AllDocs where DocFlags = 65868\r\n<\/pre>\n<p>The following SQL run in the context of your content database provides a count of this DocFlag:<\/p>\n<pre lanh=\"php\">\r\nselectCOUNT(*)\r\nfrom AllDocs where DocFlags = 65868 \r\n<\/pre>\n<p>This situation prevents the PowerShell Migrate() cmdlet from running.  As a refresher, here\u2019s the full PowerShell set of commands to set the minBlobSize and call Migrate():<\/p>\n<pre lang=\"php\">\r\n$cdb=Get-SPContentDatabase -identity \"[replace with your content db]\"\r\n$blobstoragesettings=$cdb.remoteblobstoragesettings\r\n$rbs = $cdb.RemoteBlobStorageSettings\r\n$rbs.MinimumBlobStorageSize\r\n$rbs.GetProviderNames()\r\n$rbs.Installed()\r\n$rbs.Enable()\r\n$rbs.MinimumBlobStorageSize =1mb\r\n$rbs.update\r\n$cdb.update()\r\n$rbs.Migrate()\r\n<\/pre>\n<p>For me, I get a hideous \u201cObject Variable Not Set\u201d for the migrate() command.  Oddly, the underlying AllDocs records with this one 65868 flag all predate my installation of SP1 with June CU, hinting that this Service Pack may have fixed a condition going forward\u2026<\/p>\n<p>What occurs for DocFlags is the highest order bit (0x10000, or 65536) is set to indicate an external provider (EBS) is utilized; this value should be zero for the typical SharePoint 2010 out-of-box RBS configuration.<\/p>\n<p>The simple solution is to fix the offending bit.  However this violates Microsoft\u2019s rules telling us users not to muck in their database internals.  We would never do that of course, but \u201chypothetically\u201d here is how you can fix it.   Take your hypothetical backup before hypothetically running this SQL:<\/p>\n<pre lang=\"php\">\r\nupdate AllDocs\r\nset DocFlags = DocFlags & 0xFFFEFFFF\r\nwhere\r\n( DocFlags & 0x10000 ) = 0x10000\r\n<\/pre>\n<p>What this does it clear the 65536 (0x10000) bit.  This SQL would run (hypothetically speaking) in a fraction of a second.<\/p>\n<p>We can then (again, of course hypothetically) enable RBS and do a Migrate() of content back into FILESTREAM.<\/p>\n<p>Ciao, and happy Blobbing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Inside every Content Database is a key table called AllDocs; when configured for RBS there is a field called DocFlags that can provide insights into the configuration.\u00a0 If the value is 65868, it indicates to the RBS Provider to leverage the deprecated Farm ExternalBinaryStoreClassId, which was used as part of EBS in SP2007.\u00a0 You can [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2216,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[40],"tags":[],"class_list":["post-2215","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rbs"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=2215"}],"version-history":[{"count":1,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2215\/revisions"}],"predecessor-version":[{"id":2223,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/2215\/revisions\/2223"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/2216"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=2215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=2215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=2215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}