function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eric BowdenEric Bowden 

Content cannot be displayed: More than 20 connections opened to server

The message "Content cannot be displayed: More than 20 connections opened to server" appears for a Visualforce page that is making one web request, using a Named Credential.  I've tried logging in as a different user, same result.  I have also confirmed that I'm making only one web request per render of the Visualforce page.

This Visualforce page and the associated web request has worked well for several days.  So, I'm fairly confident that the issue is not with coding of the calls.  I'm using Http and HttpRequest for the call in Apex.

Does anyone know the specific limit that I'm hitting?  It looks to me as though my connections are somehow hung open.

Any ideas for how I can understand this error message, the related limit, and suggested workarounds appreciated.
Best Answer chosen by Eric Bowden
Eric BowdenEric Bowden
Shashank,

The issue occurred in a developer org, and I was the only user.

I created a fresh DE in an attempt to workaround the issue, so that I could continue app dev.  However, the issue occurred in the new DE also!  It appears that this was a defect beneath the "org" infrastructure in Salesforce, since it had spanned multiple orgs.

Of course, you might be inclined to suspect a code defect, but again, this was a Visualforce page making just one callout.

I resolved the issue, in both orgs, by changing the URL for the callout to use another host name, pointing to the same server.  For example, the callout was originally to https://services.contoso.com/restapi and I changed it to https://services-alt.contoso.com/restapi, though both host names point to the same server/ip.  After a few days, I directed both orgs back to the original host name and have not seen the issue since.

My theory is that connections to the original host name were hung open, in the Salesforce infrastructure at a level that is deeper than the org since the issue spanned across two orgs.  I'm curious as to the root cause/solution, and how to repair this if it occurs again, but it's not an issue for me at the moment.

Thanks for taking a look.

Cheers,
Eric

All Answers

ShashankShashank (Salesforce Developers) 
It could be possible that there were other calls being made to the org since this is an org-wide limit. Could you please let me know if you are still facing this issue regularly?
Eric BowdenEric Bowden
Shashank,

The issue occurred in a developer org, and I was the only user.

I created a fresh DE in an attempt to workaround the issue, so that I could continue app dev.  However, the issue occurred in the new DE also!  It appears that this was a defect beneath the "org" infrastructure in Salesforce, since it had spanned multiple orgs.

Of course, you might be inclined to suspect a code defect, but again, this was a Visualforce page making just one callout.

I resolved the issue, in both orgs, by changing the URL for the callout to use another host name, pointing to the same server.  For example, the callout was originally to https://services.contoso.com/restapi and I changed it to https://services-alt.contoso.com/restapi, though both host names point to the same server/ip.  After a few days, I directed both orgs back to the original host name and have not seen the issue since.

My theory is that connections to the original host name were hung open, in the Salesforce infrastructure at a level that is deeper than the org since the issue spanned across two orgs.  I'm curious as to the root cause/solution, and how to repair this if it occurs again, but it's not an issue for me at the moment.

Thanks for taking a look.

Cheers,
Eric
This was selected as the best answer