Skip Navigation

Files

pewtwxsjsp

mfypzjfgrb

kdrgqckozc

Sign Up

If you sign up for an account on this web site you can customise elements of this site and subscribe to an email newsletter.

If you have an account on this web site you may login.

If you have an account on this site but have forgotten your user name and / or your password then you can request an account reminder email.

Internal link domain mixing

A patch for this bug from Sam has been committed to CVS: https://lists.webarch.co.uk/pipermail/mkdoc-commit/2006-June/001121.html

And regarding the creation of corrupted documents he said:

I never encountered the bug where cross-linked documents can't be edited, but I think I see how it could happen. I think it's likely that documents in this state will need to be fixed, either by hand or by a script. Depending on how many there are it might be easier to delete and recreate them.

This patch does seem to resolve the problem of links pointing to other sites but on one test server there is still the document corruption problem…

Document Corruption

This is the problem that occurs on one server after the new Link.pm has been installed.

The reproduce this problem:

  1. Create a new document, say /new-test/

  2. Add a link component with the URI set to /news/

  3. Save the document and view it.

  4. Go to edit it and there is a 500 internal server error, details of this follow…

The following is written to the apache error log:

  SOFTWARE_ERROR
  $VAR1 = {
  'SCRIPT_NAME' => '',
  'MKD__CACHE_DIR' => '/usr/local/mkdoc-sites/xen-fc5.webarchitects.co.uk/cache',
  'PATH_INFO' => '/new-test/.admin.content',
  'REQUEST_METHOD' => 'GET',
  'HTTP_ACCEPT' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
  'SCRIPT_FILENAME' => '/usr/local/mkdoc-1-6/cgi/mkdoc.cgi',
  'SERVER_SOFTWARE' => 'Apache/1.3.34 (Unix) mod_perl/1.29',
  'MKD__PLUGIN_LIST' => '/usr/local/mkdoc-1-6/conf/users.conf',
  'AUTH_TYPE' => 'Basic',
  'QUERY_STRING' => '',
  'REMOTE_PORT' => '37579',
  'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060501 Fedora/1.7.13-1.1.fc5',
  'SERVER_SIGNATURE' => '<ADDRESS>Apache/1.3.34 Server at users.xen-fc5.webarchitects.co.uk Port 8080</ADDRESS>',
  'HTTP_CACHE_CONTROL' => 'max-age=0',
  'HTTP_ACCEPT_LANGUAGE' => 'en',
  'SITE_DIR' => '/usr/local/mkdoc-sites/xen-fc5.webarchitects.co.uk',
  'PERL5LIB' => '/usr/local/mkdoc-1-6',
  'PATH' => '/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mkdoc-1-6/tools:/usr/local/mkdoc-1-6/tools/cron',
  'GATEWAY_INTERFACE' => 'CGI-Perl/1.1',
  'MKDOC_DIR' => '/usr/local/mkdoc-1-6',
  'DOCUMENT_ROOT' => '/usr/local/apache/htdocs',
  'PATH_TRANSLATED' => '/usr/local/mkdoc-1-6/cgi/mkdoc.cgi/new-test/.admin.content',
  'SERVER_NAME' => 'users.xen-fc5.webarchitects.co.uk',
  'HTTP_REFERER' => 'http://users.xen-fc5.webarchitects.co.uk/new-test/',
  'SERVER_ADMIN' => '[email protected]',
  'PERL_SEND_HEADER' => 'On',
  'HTTP_ACCEPT_ENCODING' => 'gzip,deflate',
  'HTTP_X_FORWARDED_SERVER' => 'www.xen-fc5.webarchitects.co.uk',
  'USER_DOMAIN' => 'http://users.xen-fc5.webarchitects.co.uk/',
  'HTTP_ACCEPT_CHARSET' => 'UTF-8,*',
  'REMOTE_USER' => 'chris',
  'HTTP_MAX_FORWARDS' => '10',
  'SERVER_PORT' => '8080',
  'PUBLIC_DOMAIN' => 'http://www.xen-fc5.webarchitects.co.uk/',
  'REMOTE_ADDR' => '192.168.1.12',
  'SERVER_PROTOCOL' => 'HTTP/1.1',
  'HTTP_X_FORWARDED_HOST' => 'users.xen-fc5.webarchitects.co.uk',
  'MKD__TIDY' => '/usr/local/mkdoc-1-6/tools/whitelist.sh',
  'HTTP_X_FORWARDED_FOR' => '192.168.1.2',
  'REQUEST_URI' => '/new-test/.admin.content',
  'SERVER_ADDR' => '192.168.1.12',
  'HTTP_HOST' => 'users.xen-fc5.webarchitects.co.uk:8080',
  'MOD_PERL' => 'mod_perl/1.29'
};
  [PETAL ERROR] [PETAL ERROR] Can't use string ("HASH(0xa950588)") as a HASH ref while "strict refs" in use at ../MKDoc/Util/Link Parser.pm line 454.
  . Debug info written in /tmp/petal_debug.1422.1149682698.pewtwxsjsp at /usr/lib/perl5/site_perl/5.8.8/Petal.pm line 473.
  . Debug info written in /tmp/petal_debug.1422.1149682698.mfypzjfgrb at /usr/lib/perl5/site_perl/5.8.8/Petal.pm line 473.
  

And the petal debug files are here:

If you then try to view the content of /new-test/ it is fine, it has just one component, a link component pointing to the right place — but when you go to edit it you have the error document above.

If you select the data at a MySQL level using this command:

mysql> select Body from Document where Full_Path="/new-test/";

You get this data:

  <block id="flo_block_1" type="link">
    <hash id="163570052" bless="flo::editor::Link">
      <item key="internal_link">
<hash id="175876424">
    <item key="file_name">
        <litteral undef="true" />
    </item>
    <item key="fragment">
        <litteral undef="true" />
    </item>
    <item key="query">
        <litteral undef="true" />
    </item>
    <item key="document_id">
        <litteral>5</litteral>
    </item>
    <item key="scheme">
        <litteral>http</litteral>
    </item>
    <item key="operation">
        <litteral undef="true" />
    </item>
    <item key="is_internal">
        <litteral>1</litteral>
    </item>
    <item key="authority">
        <litteral>www.xen-fc5.webarchitects.co.uk</litteral>
    </item>
</hash>
      </item>
      <item key="url">
<litteral>http://www.xen-fc5.webarchitects.co.uk/news/</litteral>
      </item>
      <item key="title">
<litteral>News</litteral>
      </item>
      <item key="description">
<litteral>News</litteral>
      </item>
      <item key="uri_name">
<litteral>news.link</litteral>
      </item>
    </hash>
  </block>

This problem however only happens with one development server and not the other…

History

This bug was first reported by Jamie in Feb 2006: http://www.burngreave.net/pipermail/bndfc-web-tech/2006-February/000284.html

Bruno has since confirmed that it also happens on another server.

The symptoms are that sometime internal links are pointed to other sites on the server — the domain name used is the wrong one.

The only work around to this bug at the moment is to only have one MKDoc instance per Apache / mod_perl instance.

To reproduce this bug all you need is two sites on one server both with a document at, for example, /news/ and if you then create a new document, say /test/ on both sites and add a link component to both /test/ pages pointing at /news/ then one of the sites will end up linking to the other.

In addition is seem that there is another bug that prevents pages that have their links mixed up from being edited, this is the error in the apache logs:

  SOFTWARE_ERROR
  $VAR1 = {
  'SCRIPT_NAME' => '',
  'MKD__CACHE_DIR' => '/usr/local/mkdoc-sites/linktest.webarchitects.co.uk/cache',
  'PATH_INFO' => '/test/',
  'REQUEST_METHOD' => 'GET',
  'HTTP_ACCEPT' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/ png,*/*;q=0.5',
  'SCRIPT_FILENAME' => '/usr/local/mkdoc-1-6/cgi/mkdoc.cgi',
  'SERVER_SOFTWARE' => 'Apache/1.3.34 (Unix) mod_perl/1.29',
  'MKD__PLUGIN_LIST' => '/usr/local/mkdoc-1-6/conf/users.conf',
  'AUTH_TYPE' => 'Basic',
  'QUERY_STRING' => '',
  'REMOTE_PORT' => '51609',
  'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060501 Fedora/1.7.13-1.1.fc5',
  'SERVER_SIGNATURE' => '<ADDRESS>Apache/1.3.34 Server at users.linktest.webarchitects.co.uk Port 8080</ADDRESS>',
  'HTTP_CACHE_CONTROL' => 'max-age=0',
  'HTTP_ACCEPT_LANGUAGE' => 'en',
  'SITE_DIR' => '/usr/local/mkdoc-sites/linktest.webarchitects.co.uk',
  'PERL5LIB' => '/usr/local/mkdoc-1-6',
  'PATH' => '/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/mkdoc-1-6/tools:/usr/local/mkdoc-1-6/tools/cron',
  'GATEWAY_INTERFACE' => 'CGI-Perl/1.1',
  'MKDOC_DIR' => '/usr/local/mkdoc-1-6',
  'DOCUMENT_ROOT' => '/usr/local/apache/htdocs',
  'PATH_TRANSLATED' => '/usr/local/mkdoc-1-6/cgi/mkdoc.cgi/test/',
  'SERVER_NAME' => 'users.linktest.webarchitects.co.uk',
  'SERVER_ADMIN' => '[email protected]',
  'PERL_SEND_HEADER' => 'On',
  'HTTP_ACCEPT_ENCODING' => 'gzip,deflate',
  'HTTP_X_FORWARDED_SERVER' => 'www.linktest.webarchitects.co.uk',
  'USER_DOMAIN' => 'http://users.linktest.webarchitects.co.uk/',
  'HTTP_ACCEPT_CHARSET' => 'UTF-8,*',
  'REMOTE_USER' => 'chris',
  'HTTP_MAX_FORWARDS' => '10',
  'SERVER_PORT' => '8080',
  'PUBLIC_DOMAIN' => 'http://www.linktest.webarchitects.co.uk/',
  'REMOTE_ADDR' => '192.168.1.12',
  'SERVER_PROTOCOL' => 'HTTP/1.1',
  'HTTP_X_FORWARDED_HOST' => 'users.linktest.webarchitects.co.uk',
  'MKD__TIDY' => '/usr/local/mkdoc-1-6/tools/whitelist.sh',
  'HTTP_X_FORWARDED_FOR' => '192.168.1.2',
  'REQUEST_URI' => '/test/',
  'SERVER_ADDR' => '192.168.1.12',
  'HTTP_HOST' => 'users.linktest.webarchitects.co.uk:8080',
  'MOD_PERL' => 'mod_perl/1.29'
};
  [PETAL ERROR] Can't use string ("HASH(0xaffd610)") as a HASH ref while "strict refs" in use at ../MKDoc/Util/LinkParser.pm line 362.
  . Debug info written in /tmp/petal_debug.12691.1149518491.kdrgqckozc at /usr/lib/perl5/site_perl/5.8.8/Petal.pm line 473.
  

And the debug message are attached:

And if you look at this document in the database this is the link component causing the problem:

  <block id="flo_block_2" type="link">
  <hash id="189876688" bless="flo::editor::Link">
      <item key="internal_link">
<hash id="186546984">
    <item key="fragment">
        <litteral undef="true" />
    </item>
    <item key="query">
        <litteral undef="true" />
    </item>
    <item key="document_id">
        <litteral>2</litteral>
    </item>
    <item key="scheme">
        <litteral>http</litteral>
    </item>
    <item key="operation">
        <litteral undef="true" />
    </item>
    <item key="is_internal">
        <litteral>1</litteral>
    </item>
    <item key="authority">
        <litteral>www.xen-fc5.webarchitects.co.uk</litteral>
    </item>
</hash>
      </item>
      <item key="url">
<litteral>http://www.xen-fc5.webarchitects.co.uk/news/</litteral>
      </item>
      <item key="title">
<litteral>News</litteral>
      </item>
      <item key="description">
<litteral>News</litteral>
      </item>
      <item key="uri_name">
<litteral>news.link</litteral>
      </item>
  </hash>

This link was created on a site served at http://www.linktest.webarchitects.co.uk/ and the other MKDoc site on this virtual machine is at http://www.xen-fc5.webarchitects.co.uk/ and this other site does have a /news/ document — the link that generated the error had /news/ entered for the URI.

Up

This document was last modified by Chris Croome on 2006-06-07 05:45:14
MKDoc Ltd., 31 Psalter Lane, Sheffield, S11 8YL, UK.
Copyright © 2001-2006 MKDoc Ltd.