+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / When going to Content->Images in Sitefinity admin ELMAH logs an error for every thumbnail displayed.

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

7 posts, 1 answered
  1. Jody
    Jody avatar
    9 posts
    Registered:
    05 Dec 2012
    02 May 2013
    Link to this post
    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?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    03 May 2013
    Link to this post
    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
  3. Jody
    Jody avatar
    9 posts
    Registered:
    05 Dec 2012
    03 May 2013 in reply to Ivan Dimitrov
    Link to this post
    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)
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    06 May 2013
    Link to this post
    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
    Answered
  5. Jody
    Jody avatar
    9 posts
    Registered:
    05 Dec 2012
    07 May 2013 in reply to Ivan Dimitrov
    Link to this post
    That worked. We did have this value set to "*" and I removed the entry entirely and the error has disappeared from our ELMAH logs
  6. Bishoy
    Bishoy avatar
    27 posts
    Registered:
    15 Aug 2013
    25 Feb 2015
    Link to this post

    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 ?

  7. Bishoy
    Bishoy avatar
    27 posts
    Registered:
    15 Aug 2013
    25 Feb 2015
    Link to this post

    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>

7 posts, 1 answered