Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brendan Rice 538 posts 1102 karma points
    Nov 15, 2010 @ 17:15
    Brendan Rice
    0

    Source set-up for 4.0.2.1

    We are getting an obscure bug when we redirect from an XSLT extension in umbraco where the trace is output.  I need to set up the same version of the source that the site in question was built with, are there any guides to getting up and running with the source?

     

  • Brendan Rice 538 posts 1102 karma points
    Nov 15, 2010 @ 17:33
    Brendan Rice
    0

    Where do I even find the source for the above release?

  • Ian Smedley 97 posts 192 karma points
    Nov 15, 2010 @ 17:37
    Ian Smedley
    1

    All the source can be found at the codeplex site, http://umbraco.codeplex.com/ can you not just copy the entire web installation of the existing site over the dev machine.

    What is the trace output you're getting? Perhaps it is something simple, like missing the exclude-urns?


  • Aaron Powell 1708 posts 3046 karma points c-trib
    Nov 15, 2010 @ 17:48
    Aaron Powell
    0

    You need to download this changeset: http://umbraco.codeplex.com/SourceControl/changeset/view/67270

    The code was in the $/branches/rb404 branch

  • Brendan Rice 538 posts 1102 karma points
    Nov 15, 2010 @ 17:50
    Brendan Rice
    0

    Thanks ofor the reply Ian, I don't have the trace output at the minute until I get the site set up, but it included a lot of trace information about the site i.e. local IP that could be used to compromise it.

    Could you expand on what you mean by 'exclude-urns', my Google-Fu has let me down.

  • Brendan Rice 538 posts 1102 karma points
    Nov 15, 2010 @ 17:50
    Brendan Rice
    0

    Thanks Slace, what about setting up the database what is the best way to get that going?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Nov 15, 2010 @ 17:54
    Aaron Powell
    1

    4.0.x still supported Vista DB so you can use that if you prefer.

    If you're going to open the sln in Visual Studio is uses post-build events to change the web.config file, based on machine name (using an XSLT transform of the web.config). So if you're opening the sln you need to include a file named web.MY-PC.config.xslt (from memory, I don't have it on had at the moment). This will mean you can define custom stuff (such as a web.config ) for when you compile on your machine.

  • Ian Smedley 97 posts 192 karma points
    Nov 15, 2010 @ 17:57
    Ian Smedley
    1

    At the top of the XSLT file, where custom extensions are declared, there is another property called "exclude-result-prefixes" it will have some default information in it, add any custom DLL's in there.

    This shouldn't be outputting any local IPs though, does the url have "?umbDebugShowTrace=true" in the title?

    Might be worth just editing the web.config file and ensure the property "umbracoDebugMode" is set to false.

     

         <add key="umbracoDebugMode" value="false"/>
  • Brendan Rice 538 posts 1102 karma points
    Nov 15, 2010 @ 18:21
    Brendan Rice
    0

    Here is a bit more on the error.I have numbered each relevant bit of information below.

    In the code (2) we had to put a Redirect(..., false) in there to stop the trace from outputting, as you can see from the Fiddler output (3) that the HTML output from the page is shown below the "moved" page, from our understanding this is wrong andything below the first </html> should not be there.

    We think this is something to do with Umbraco as when you create a new solution with a redirect this doesn't happen (this happens with the latest version of the source as well).

    Any ideas would be a big help.

     

    1. XSLT File

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library"
      xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"
      xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes"
      xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
      xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions"
      xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
      xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
      xmlns:AmazeTransfer="urn:AmazeTransfer"
      exclude-result-prefixes="msxml AmazeTransfer umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets AmazeTransfer ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:param name="currentPage"/>
    <xsl:template match="/">
      <xsl:value-of select="AmazeTransfer:Redirect('http://www.nufc.com')"/>
    </xsl:template>
    </xsl:stylesheet>

    2. Code

    namespace AmazeXsltHelper
    {
    public class Transfer
    {
    public static string Redirect(string url)
    {
    System.Web.HttpContext.Current.Response.Redirect(url, false);

    return "";
    }
    }
    }

    3. Fiddler TextView when redirect is hit

    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a href="http://www.nufc.com">here</a>.</h2>
    </body></html>

    <!DOCTYPE html>
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

    <head><title>
    AEGPLAEGPL
    </title><meta http-equiv="Content
  • Brendan Rice 538 posts 1102 karma points
    Nov 15, 2010 @ 18:27
    Brendan Rice
    0

    Slace I would prefer to set up the SQL database and replicate the environment as I don't know much about vista db.

    What is the best way of doing that? I found a SQL install file in the data folder (umbraco 4.0.2.1\umbraco\datalayer\SqlHelpers\SqlServer\Sql\Total.sql) and was using this, is this the best way to set up the DB?

    Any gotcha's I should watch out for?

    Thanks for the help...

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Nov 16, 2010 @ 12:13
    Lee Kelleher
    0

    Hi Brendan,

    Curious to why are you setting the 'endResponse' to false in the Response.Redirect? Set it to true - it should perform the redirect.

    If you want the binaries for v4.0.2.1 - I've got a little "unofficial" archive here: http://code.leekelleher.com/umbraco/archive/

    (I needed them all for a mammoth upgrade from v2.1.1 to v4.5.1)

    Cheers, Lee.

  • Brendan Rice 538 posts 1102 karma points
    Nov 16, 2010 @ 12:54
    Brendan Rice
    0

    Hi Lee,

    thanks for the reply, I appreciate the help.  We have 'endReponse' set to false as when it is true trace output can be seen in the response we used fiddler to see this. As the trace exposed the internal IP of the server this failed a PCI compliance test and as a workaround we set 'endResponse' to false so the HTML is output and not the trace.

    This looks like an umbraco specific error that is happening on the latest version of code as well.

    Any ideas?

    Thanks,

    B

  • Ian Smedley 97 posts 192 karma points
    Nov 16, 2010 @ 13:55
    Ian Smedley
    2

    I found this post, which might be an interesting read, how to do 301 redirects from XSLT: http://our.umbraco.org/forum/using/ui-questions/5255-301-redirect-options

    I think that the false shouldn't be set, but likewise, that the internal IP shouldn't be exposed, I am confused how it has entered the equation.. Perhaps it's worth posting up the trace output, but blanking out sensitive information, such as the last 2 or 3 octets of the IP.

    I've only ever done redirects in c# on either a usercontrol or a masterpage, and I've never had a problem with it before, I assume your output doesn't look like the umbraco trace, such as http://our.umbraco.org/?umbDebugShowTrace=true

     


  • Brendan Rice 538 posts 1102 karma points
    Nov 16, 2010 @ 15:41
    Brendan Rice
    0

    Request Details

    Session Id: b31dtv2nnt0uwk2pdfsnbc45 Request Type: GET
    Time of Request: 16/11/2010 15:21:26 Status Code: 302
    Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)

    Trace Information

    CategoryMessageFrom First(s)From Last(s)
    aspx.page Begin PreInit    
    umbracoInit handling request 0.00371499729714251 0.003715
    request handler current url '' 0.0428529324257692 0.039138
    requestHandler Redirecting to domain: localhost, nodeId: 1044 0.0857729124791 0.042920
    umbracoRequestHandler xpath: '/node [@urlName = "home"] | /root/node [@urlName = "home"]' 0.085835769629939 0.000063
    umbracoRequestHandler Just before xPath query (False, '/node [@urlName = "home"] | /root/node [@urlName = "home"]') 0.0858659410623417 0.000030
    umbracoRequestHandler pageXPathQueryStart: '/root' 0.0858919220180218 0.000026
    umbracoRequestHandler After xPath query 0.0859869061570674 0.000095
    umbracoRequestHandler Access checking started 0.0860229442568818 0.000036
    umbracoRequestHandler Page not protected 0.0892149700590438 0.003192
    umbracoRequestHandler Access checking ended 0.0892627414936815 0.000048
    umbracoInit Done handling request 0.0892968240376919 0.000034
    umbracoPage Pagedata loaded for Home (ID: 1044, Version: 69e26186-2f63-433f-bfa6-20fdec7bfd24) 0.0954079359248173 0.006111
    default.aspx Culture changed to en-US 0.106930908816623 0.011523
    aspx.page End PreInit 1.07065143754304 0.963721
    aspx.page Begin Init 1.0707033994544 0.000052
    renderMacro Rendering started (macro: Redirect, type: 1, cacheRate: 0) 1.08687724277806 0.016174
    umbracoMacro Before adding extensions 1.12025634542938 0.033379
    umbracoXsltExtension Extension added: urn:Exslt.ExsltCommon, ExsltCommon 1.13056044832514 0.010304
    umbracoXsltExtension Extension added: urn:Exslt.ExsltDatesAndTimes, ExsltDatesAndTimes 1.1306163213481 0.000056
    umbracoXsltExtension Extension added: urn:Exslt.ExsltMath, ExsltMath 1.13064341976424 0.000027
    umbracoXsltExtension Extension added: urn:Exslt.ExsltRegularExpressions, ExsltRegularExpressions 1.13066940071992 0.000026
    umbracoXsltExtension Extension added: urn:Exslt.ExsltStrings, ExsltStrings 1.13069733723141 0.000028
    umbracoXsltExtension Extension added: urn:Exslt.ExsltSets, ExsltSets 1.13072639120335 0.000029
    umbracoXsltExtension Extension added: urn:AmazeTransfer, Transfer 1.13075125469857 0.000025
    umbracoMacro After adding extensions 1.13095938170913 0.000208
    umbracoMacro Before performing transformation 1.13142117224396 0.000462
    umbracoMacro Error loading XSLT Redirect.xslt
    Thread was being aborted.
      at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 604
    1.22377341254266 0.092352
    Template Error adding macro Redirect
    Thread was being aborted.
      at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 610
      at umbraco.macro.renderMacro(Hashtable attributes, Hashtable pageElements, Int32 pageId) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 456
      at umbraco.presentation.templateControls.Macro.CreateChildControls() in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\umbraco\templateControls\Macro.cs:line 78
    1.24174720530123 0.017974

    Control Tree

    Control UniqueIDTypeRender Size Bytes (including children)ViewState Size Bytes (excluding children)ControlState Size Bytes (excluding children)

    Session State

    Session KeyTypeValue

    Application State

    Application KeyTypeValue
    umbracoUrl System.String localhost:4021/umbraco
    umbracoNeedConfiguration System.Boolean False

    Request Cookies Collection

    NameValueSize
    updateCheck 1 13
    UserContext cd37d9a7-4ee6-4d3a-81eb-b00daa479c77 48
    ASP.NET_SessionId b31dtv2nnt0uwk2pdfsnbc45 42

    Response Cookies Collection

    NameValueSize

    Headers Collection

    NameValue
    Connection keep-alive
    Keep-Alive 115
    Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Accept-Encoding gzip,deflate
    Accept-Language en-gb,en;q=0.5
    Cookie updateCheck=1; UserContext=cd37d9a7-4ee6-4d3a-81eb-b00daa479c77; ASP.NET_SessionId=b31dtv2nnt0uwk2pdfsnbc45
    Host localhost:4021
    User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729; .NET4.0E)

    Response Headers Collection

    NameValue
    X-AspNet-Version 2.0.50727
    Cache-Control private
    Content-Type text/html

    Form Collection

    NameValue

    Querystring Collection

    NameValue

    Server Variables

    NameValue
    ALL_HTTP HTTP_CONNECTION:keep-alive HTTP_KEEP_ALIVE:115 HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_CHARSET:ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_ACCEPT_ENCODING:gzip,deflate HTTP_ACCEPT_LANGUAGE:en-gb,en;q=0.5 HTTP_COOKIE:updateCheck=1; UserContext=cd37d9a7-4ee6-4d3a-81eb-b00daa479c77; ASP.NET_SessionId=b31dtv2nnt0uwk2pdfsnbc45 HTTP_HOST:localhost:4021 HTTP_USER_AGENT:Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729; .NET4.0E)
    ALL_RAW Connection: keep-alive Keep-Alive: 115 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Encoding: gzip,deflate Accept-Language: en-gb,en;q=0.5 Cookie: updateCheck=1; UserContext=cd37d9a7-4ee6-4d3a-81eb-b00daa479c77; ASP.NET_SessionId=b31dtv2nnt0uwk2pdfsnbc45 Host: localhost:4021 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729; .NET4.0E)
    APPL_MD_PATH /LM/W3SVC/1831910923/Root
    APPL_PHYSICAL_PATH C:\Work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\
    AUTH_TYPE  
    AUTH_USER  
    AUTH_PASSWORD  
    LOGON_USER  
    REMOTE_USER  
    CERT_COOKIE  
    CERT_FLAGS  
    CERT_ISSUER  
    CERT_KEYSIZE  
    CERT_SECRETKEYSIZE  
    CERT_SERIALNUMBER  
    CERT_SERVER_ISSUER  
    CERT_SERVER_SUBJECT  
    CERT_SUBJECT  
    CONTENT_LENGTH 0
    CONTENT_TYPE  
    GATEWAY_INTERFACE CGI/1.1
    HTTPS off
    HTTPS_KEYSIZE  
    HTTPS_SECRETKEYSIZE  
    HTTPS_SERVER_ISSUER  
    HTTPS_SERVER_SUBJECT  
    INSTANCE_ID 1831910923
    INSTANCE_META_PATH /LM/W3SVC/1831910923
    LOCAL_ADDR 127.0.0.1
    PATH_INFO /
    PATH_TRANSLATED C:\Work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\
    QUERY_STRING  
    REMOTE_ADDR 127.0.0.1
    REMOTE_HOST 127.0.0.1
    REMOTE_PORT 4403
    REQUEST_METHOD GET
    SCRIPT_NAME /
    SERVER_NAME localhost
    SERVER_PORT 4021
    SERVER_PORT_SECURE 0
    SERVER_PROTOCOL HTTP/1.1
    SERVER_SOFTWARE Microsoft-IIS/6.0
    URL /
    HTTP_CONNECTION keep-alive
    HTTP_KEEP_ALIVE 115
    HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7
    HTTP_ACCEPT_ENCODING gzip,deflate
    HTTP_ACCEPT_LANGUAGE en-gb,en;q=0.5
    HTTP_COOKIE updateCheck=1; UserContext=cd37d9a7-4ee6-4d3a-81eb-b00daa479c77; ASP.NET_SessionId=b31dtv2nnt0uwk2pdfsnbc45
    HTTP_HOST localhost:4021
    HTTP_USER_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729; .NET4.0E)

    Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
  • Brendan Rice 538 posts 1102 karma points
    Nov 17, 2010 @ 13:17
    Brendan Rice
    0

    Turns out there is a trace="true" on default.aspx that was causing the issue, it should be fixed now.

     

Please Sign in or register to post replies

Write your reply to:

Draft