When going to Content->Images in Sitefinity admin ELMAH l

Posted by Community Admin on 04-Aug-2018 14:45

When going to Content->Images in Sitefinity admin ELMAH logs an error for every thumbnail displayed.

All Replies

Posted by Community Admin on 02-May-2013 00:00

Error: "System.Web.HttpExceptionServer cannot append header after HTTP headers have been sent."

When going to Content->Images in Sitefinity admin ELMAH logs an error for every thumbnail displayed.  If you then go to Administration->Error Log, you can see a new set of errors that are marked with the same time step for what looks like every thumbnail that the page displayed.  I have attached the xml of one of these errors.  Any ideas what is causing it, and if there is something I should be doing to fix it?

Posted by Community Admin on 03-May-2013 00:00

Hello,

I wasn't able to replicate this issue on a website that uses Sitefinity 6.0.4100. We set some headers to the response inside LibraryHttpHandler (SetHeaders method), but I did'n find a place where duplicate header is added. I was using the default storage for images - the database.

  • Could you tell me if you use a different version that the latest one?
  • Do you use file system storage or DropboxLibraries ?
  • Is there a stack trace that you could send, so we can track from where the issue might come from.


All the best,
Ivan Dimitrov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 03-May-2013 00:00

We are using file system storage for all our images in Sitefinity 5.4.

This is further information that it is the ELMAH error shows:
System.Web.HttpException (0x80004005): Server cannot append header after HTTP headers have been sent.
at System.Web.HttpResponse.AppendHeader(String name, String value)
at Telerik.Sitefinity.Security.Claims.SitefinityClaimsAuthenticationModule.OnEndRequest(Object sender, EventArgs args)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Posted by Community Admin on 06-May-2013 00:00

Hello,

Do you have some other code that ends the response or adds headers upon a request? This error is thrown when you try to add a header after the request has been ended or you try to duplicate the header. 
I set a project that uses Sitefinity 5.4.4040. Uploaded several images and the log is still empty. Set Elmah an still the same here.

Have you set AccessControlAllowOrigin property in SecurityConfig? The only header added to this method is when AccessControlAllowOrigin is set

if (!string.IsNullOrWhiteSpace(this.AccessControlAllowOrigin))
               
                    application.Context.Response.AddHeader("Access-Control-Allow-Origin", this.AccessControlAllowOrigin);
               

If you install a new project and upload a single image do you have something in sitefinity's log?
Can you check if there is a difference if you use Sitefinity's project manager to browse the website and if yu host the website in IIS.

Kind regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 07-May-2013 00:00

That worked. We did have this value set to "*" and I removed the entry entirely and the error has disappeared from our ELMAH logs

Posted by Community Admin on 25-Feb-2015 00:00

Hi, I think I have the same problem in my app, because its the only sitefinity app we release having this problem.

However, I need this * as we have API calls to the webapp and wanted to allow the cross domain calls, How can it be fixed now ?

Posted by Community Admin on 25-Feb-2015 00:00

I found a fix, 

Just removed it from sitefinity security config and added it to the web config as below

<add name="Access-Control-Allow-Headers" value="accept, content-type" />
        <add name="Access-Control-Allow-Methods" value="OPTIONS,POST,PUT,DELETE,GET" />
        <add name="Access-Control-Allow-Origin" value="*" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>

This thread is closed