I've zonked my v4.master page by putting a bad link in a ScriptLink tag. All my pages, including the Settings pages, produce only "Cannot make a cache safe URL for..." error messages. I can fix the error, I just can't get to anywhere that will let me reset the file.

I have no access to the server, no permissions to the parent site, and can't overwrite v4.master via WebDAV because it is "ghosted"(?) (see http://social.msdn.microsoft.com/Forums/hi-IN/sharepointgeneralprevious/thread/c5952364-c375-48c4-82bd-394d3b7e3c46) SharePoint designer is disallowed on the server (and I only have SPD2007 anyway)

Anybody got any bright ideas or tricks on how to reset or overwrite the v4.master file to fix my mistake? (besides getting a sysadmin to do it, which will take forever around here)

Edit: AAAH I am so close. I can get the list of master pages to come up again by uploading my repaired .master, then changing (via WebDAV)
/sites/sitename/_catalogs/masterpage/Forms/AllItems.aspx and EditForm.aspx to point to that repaired master page (by changing MasterPageUrl in the files), but when I try to upload a new file or access the version history to rollback, I keep getting bounced to /sites/sitename/_layouts/Upload.aspx or Versions.aspx, which I don't think I have access to change. I see a /sites/sitename/_catalogs/masterpage/Forms/Upload.aspx, but apparently that is not used from the master pages interface, which is mind-meltingly frustrating.

  • How did you put it there to begin with? SharePoint Designer or?
    – user2536
    Dec 18, 2012 at 13:15
  • I got it there by using the regular Upload function in the Master pages interaface, which is now broken
    – Andy
    Dec 18, 2012 at 14:05
  • How about write a .Net client to use /sitename/_vti_bin/versions.asmx's RestoreVersion? Anybody think of that? It didn't work because the service is locked down to only local requests, but that was the kind of answer that I was looking for. This is getting me nowhere.
    – Andy
    Dec 19, 2012 at 12:58
  • Do you know the version # of the most recent broken version? Maybe you could call DeleteVersion
    – Kit Menke
    Dec 19, 2012 at 14:51
  • If I can't call RestoreVersion, I can't call DeleteVersion. It's an 401 authentication error when calling the service.
    – Andy
    Dec 19, 2012 at 14:53

5 Answers 5


Since your master page is now unghosted (= customized = not anymore retrieved from the file system), you'll have a newer version. You can roll back to a previous edition (v1.0 as provisionned by MS) to put you back in a working state.

Go to {Your-Site-Collection-Url}/_catalogs/masterpage/Forms/AllItems.aspx, select the v4.master, history and roll back to a previous version


Otherwise, you could replace the current master page to something else (night & day or minimal ?) by going straight to the relevant page through {Your-Site-Collection-Url}/_Layouts/ChangeSiteMasterPage.aspx

  • Yeah the problem is that when I visit /_catalogs/masterpage/Forms/AllItems.aspx, I get the error message because (I guess) even the site settings pages use the v4.master page for their layout.
    – Andy
    Dec 18, 2012 at 14:08
  • When I tried /_Layouts/ChangeSiteMasterPage.aspx, I get a generic error message - I don't see that page anywhere when navigating via WebDAV, so maybe I got the URL wrong, but I can't guess what it should be.
    – Andy
    Dec 18, 2012 at 14:11
  • You won't see it through WebDav as it's an application page, loaded from the 14 hive. Did you try connecting with someone else ? The master page library has versioning on it by default meaning that you'll need to publish your master page for it to be available to everyone. Might be a good idea to connect as someone else with less privileges to ensure your version is pending approval Dec 18, 2012 at 14:22
  • I didn't have to publish anything before for my changes to take effect. In any case, I'm not sure how this helps - the URL you mentioned returns a generic "An unexpected error has occurred" message.
    – Andy
    Dec 18, 2012 at 15:14
  • Apparently, I don't have 'SharePoint Server Publishing Infrastructure' turned on: youdhbir.blogspot.com/2012/04/…
    – Andy
    Dec 18, 2012 at 17:35

Since you cannot access the site's normal, web-based UI: Use SharePoint Designer 2010 and in the Site Objects navigation menu on the left, select Master Pages. Right click your v4.master and either reset to a specific version or edit it to make the required changes.

Something is going to have to give. There is no magic spell that can fix the issue. You will either need physical access to the server to run a script, or use Designer.

enter image description here

  • AAAAAAH "SharePoint designer is disallowed on the server (and I only have SPD2007 anyway)"!
    – Andy
    Dec 18, 2012 at 19:41
  • 1
    You can download 2010 for free. Like I said in my answer, something has to give. You either need to roll back the version via the web UI (which you physically cannot do because of the error), access the server and install a solution to change the master page to a new one (then roll back the broken on), use Designer, or write something in C#/VB.net using the Managed Client Object Model. Dec 19, 2012 at 2:36
  • And that's if you even can change the master page using the client object model... Dec 19, 2012 at 2:41
  • Saying "get SP 2010 Designer" when I can't doesn't really help.
    – Andy
    Dec 19, 2012 at 12:04
  • If you've hosed the web UI and can't do anything there, your ONLY option will be PowerShell, managed code, or SharePoint Designer.
    – webdes03
    Dec 19, 2012 at 13:08

I recently had this same issue and the same restrictions and addressed it using a web folder. A co-worker found that you can create a web folder mapped to "{site}/_catalogs/masterpage/". You then gain direct access via Windows Explorer and can download/upload the new master page.

  • Now THAT saved my day (didn't have SPD just like the OP), I managed to edit the line I broke directly from there. Thanks (should be voted as THE answer)
    – Aureliink
    May 30, 2016 at 13:33

I believe the main issue you are experiencing is actually the ScriptLink which is not able to located the script int the _layouts path you mentioned. In order to fix that make sure you copy the actual .js file as specified in your ScriptLink to the appropiate Folder, using as basis _layouts, so that if you mentioned /scripts/myscript.js is actually pointing to the a location in your 14-hive under TEMPLATES/LAYOUTS/SCRIPTS (this assumes you have not specified EnableScriptGlobalization which actually is trying by default to find a folder for the En-US which is using 1033 as the basis)!

If you still want to recover it (depending on what you try to achieve) - every single site collection has a copy of the v4.master -just copy/paste the content.

  • Again, no server access to copy files onto the file system
    – Andy
    Dec 18, 2012 at 14:09
  • Very well, then you should NOT use ScriptLink in that case, but rather, either the clasical script tags or even more, you could use a custom action with the ScriptSrc attribute which loads then the script Dec 18, 2012 at 18:03
  • yes of course I should. I have the v4.master ready with the classic script tags. The question is how do I edit/overwrite the v4.master file given my situation?
    – Andy
    Dec 18, 2012 at 19:16
  • 1
    Open the site with SharePoint Designer 2010 (the site collection where you changed the master page), chose another one, and use the ribbon buttons to set it. Dec 20, 2012 at 21:58

Ok if you blow up your v4.master this is the fix! If you are having the same issue I was having, no access to the site because of a corrupted v4.master file. This means that you cannot access the "back end" of the site because those pages call v4.master as well. If I had access to SharePoint Designer it would have been a 3 second fix but that is a no go at my company right now.

So, the fix is this. Go to your site URL /_layouts/settings.aspx

for whatever reason, this page doesn't use v4.master and you can then reset the site definition from there. This will bring everything back to normal. I spent half a day looking for a way to fix my site and found some really good workarounds in the process but this was killing me!!!!!! But once I found this solution I was elated!!!! So, I hope this helps someone else some day! I can imagine it will. Best of luck!!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.