8

I'm currently trying to create a custom maintenance page in salesforce. I've actually created a custom page for each type of salesforce error. All the pages are created and in my site. All the pages can be viewed by targeting them specifically with the URL. All the other pages other than the in maintenance page work correctly when force triggering their respective error.

Things I've done:

  • Ensured pages are enabled under sites.
  • Made sure the maintenance page lookup points to my custom maintenance page.
  • Made sure the inactive site default page also points to my maintenance page.
  • Ensured page is enabled for each profile.
  • Tried just over writing default maintenance page with my own html.
  • Tried deleting default maintenance page.

No matter what I do, when the site is in maintenance mode, it still shows the default maintenance page (which is especially confusing seeing as I have deleted the page). When the site is active, I can go to [siteurl].com/[maintenancePagename] just fine. Everything works at that point. But when inactive, it's always the default maintenance page.

If it's required info, the page is created using API 28. This is currently being tested on a sandbox, not production. If any more information is required, I will post beyond this point in edits.

3

I know this is an older post, but for others taking too much time to figure this out, here's what I have found. For sites (and communities) go to Setup | Develop | Sites and click on the site label for the site (or the community; you can click the Site Label column even if it doesn't show anything in the Action column). The setting for Inactive Site Home Page is what will be used when the site is Inactive. NOT the Maintenance Page. In fact, I don't know when the "Maintenance Page" is used....not well documented. As others have already posted above, there is a static "Service Not Available" page you can set up for SFDC servers being down (very rare). And the Inactive Site Home page is shown when you deactivate the site.

| improve this answer | |
  • oh, and btw, make sure your page has been made available to the Site and that its been added to the Site Guest user profile or you'll still get the default page. – Dave Jan 18 '16 at 21:57
3

I was just experiencing this same issue: After deactivating my site, I wasn't able to view our custom maintenance page; a standard Visualforce error page showed up instead.

After running a debug log on the site guest user, I noticed this error (Ids changed for privacy):

System.LicenseException: Inactive User, orgId: 00D22000XXXXXXX userId: 005E0000XXXXXXX

The user Id in the error was the Id of the Site Guest User for my site. Deactivating the site caused the site guest user to be automatically deactivated as well. Reactivating the site guest user fixed the issue - the site remained inactive, but now the custom maintenance page was displayed.

Steps to reactivate the site guest user after deactivating your site:

  1. From the site detail page, click the Public Access Settings button at the top.
  2. Click the Assigned Users button.
  3. Use the Edit link to reactivate the user.
| improve this answer | |
  • I just noticed a quirk that's worth mentioning: the site guest user seems to get deactivated any time the inactive site is edited. For example, I just updated my inactive site to have a new page selected in the "Inactive Site Home Page" field, and doing this caused the user to be deactivated as well. – Martha Seneta Sep 16 '16 at 4:31
2

I strongly suspect the problem may be related to not having put your pages into a public static resource made public in the form of a zip file that's less than 1MB in size of the structure as specified in the document I've quoted from below.

From the Force.com Sites Implementation Guide:

Assigning Force.com Site Error Pages

To set the error pages for your site:

  1. From Setup, click Develop > Sites.

  2. Click the name of the site you want to modify.

  3. Click Page Assignment on the Error Pages related list.

  4. Using the lookup fields, assign a Visualforce page or static resource for each of the standard error conditions listed:

• Authorization Required Page—The page users see when trying to access pages for which they do not have authorization.

• Limit Exceeded Page—The page users see when your site has exceeded its bandwidth limits.

• Maintenance Page—The page users see when your site is down for maintenance.

• Service Not Available Page—The page users see when Salesforce servers are unavailable. This custom page is rendered from a static resource that you choose. The static resource is uploaded to the cache server when assigned as the Service Not Available page, and when updated after assignment. The custom page is shown for HTTP requests only; caching is not used for HTTPS. Not available for Developer Edition or sandbox organizations.

If you haven't set a custom page for a site that uses a site prefix, the custom page for the root site is used when servers are unavailable. For example, if http://mycompany.force.com/sales doesn't have a custom page, but http://mycompany.force.com does, that custom page is used. Otherwise, the Maintenance page is shown by default

Note: The static resource:

◊ Must be a public zip file 1 MB or smaller.

◊ Must contain a page named maintenance.html at the root level of the zip file. Other resources in the zip file, such as images or CSS files, can follow any directory structure.

◊ Must contain only files that have file extensions.

• Page Not Found Page—The page users see when trying to access a page that cannot be found. You can use the action attribute on an component to redirect the Page Not Found error page. Using this kind of redirect on any other error pages will redirect users to the Maintenance page.**

• Generic Error Page—The page users see when encountering generic exceptions.

Note: When using static resources in a custom error page—such as a large image file or a large CSS file contained in a static resource .zip file—each individual resource must be no larger than 50KB. Otherwise, a 404 not found error is returned for that resource.

(5. Click Save.

(6. On the Site Details page, click Preview to view the associated page as it would appear in a browser.

Tip: Add the component right before the closing tag in your custom Visualforce error pages to view detailed site error messages in administrator preview mode.

| improve this answer | |
  • I've thought about that, and I actually did play around with that as well. But if you read through it, the section of the documentation is explicitly referring to the "Service Not Available Page." If all error pages needed to be handled in such a a way, then the rest of my custom error pages wouldn't function either. – user3712957 Aug 20 '14 at 20:48
  • Note that it also says the custom Service Not Available page isn't cached for DE or Sandbox orgs. I think that answers your question. Also make notice of the site prefix note which may apply to your situation as well. – crmprogdev Aug 20 '14 at 20:52
  • But I'm not triggering the Service Not Available page at all. I'm triggering the Site Maintenance page. The Service Not Available page is for when the Salesforce servers themselves aren't available. Site Maintenance is when I set the site to maintenance mode. That, as far as I can tell, is 100% available to sandbox orgs and does not rely on a static resource page. – user3712957 Aug 20 '14 at 20:57
  • I recommend you try putting it all in a zip file in the directory structure specified and see what your results are. Note that each resource needs to be less than 50k in size. – crmprogdev Aug 20 '14 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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