Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to resolve error - 502 web server error ?

$
0
0

Hello,

Kindly consider following scenario: 

Custom control is programmatically creating site using following code. Once site get created, it redirecting to its settings.aspx page:

try

            {

               SPSecurity.RunWithElevatedPrivileges(delegate()

             {

                using (SPSite site1 = newSPSite(SPContext.Current.Site.ID))

                 {

                    SPLongOperation.BeginOperation beginOperation = null;

                    if (beginOperation ==null)

                     {

                         beginOperation =delegate(SPLongOperation longOperation)

                         {

                             site1.WebApplication.Sites.Add(site1.RootWeb.Url                   + "/manPath/site1, Site1, "", 1033,TemplateName, __userLoginName, __userName,__userEmail);

                             

                             longOperation.End(site1.RootWeb.Url+ "/manPath/site1/_layouts/settings.aspx");

                         };

                     }

                    SPLongOperation.Begin(beginOperation);

                 }

             });

            }

Same code works perfect at development machine, while in production it gives 502 web server errors.

Please check below error text:

502 - Web server received an invalid response while acting as a gateway or proxy server.

 

There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

Results in Development machine: site gets created and redirects to its site settings page as expected.

Results in Production machine: During the process it throws 502 web server errors, while site has got created successfully.

I am not sure why it happened, while previously it was working. I have feeling that may be redeployment should resolve the issue, but I want to know root cause of this issue!!

Note :  the same settings page is working well, when I open it manually in production environment!

Please let me know the approaches to resolve this issue? Also, let me know if you need any further information on same.

Thank you to look at this issue !

Kind Regards,


Dipti Chhatrapati


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>