Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10651 closed defect (fixed)

ParseError: malformed start tag: line 299, column 45

Reported by: alex Owned by: falkb
Priority: highest Component: SimpleMultiProjectPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.12

Description

How to Reproduce

While doing a GET operation on /roadmap, Trac issued an internal error.

Just installed the plugin. as far as i can see, the plugin works and i have made projects. i also have made project mapping.

  • i can not choose any milestones when creating a new ticket but the default milestone.
  • i can access the milestone view direct.
  • i have no project drop down in the milestone edit view

Request parameters:

{}

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0

System Information

Trac 0.12.3
Babel 0.9.5
Genshi 0.6
mod_wsgi 3.3 (WSGIProcessGroup WSGIApplicationGroup %{GLOBAL})
Python 2.6.5 (r265:79063, Oct 1 2012, 22:16:31)
[GCC 4.4.3]
setuptools 0.6
jQuery 1.4.4

Enabled Plugins

ComponentDependencyPlugin 0.1
graphviz 0.7.5
SimpleMultiProject 0.0.3dev
TicketSidebarProvider 0.0
TracAccountManager 0.3.2
TracHoursPlugin 0.5.2
TracMasterTickets 3.0.2

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 264, in dispatch
    content_type)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/web/chrome.py", line 838, in render_template
    stream |= self._filter_stream(req, method, filename, stream, data)
  File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 132, in __or__
    return Stream(_ensure(function(self)), serializer=self.serializer)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/web/chrome.py", line 994, in inner
    data)
  File "build/bdist.linux-x86_64/egg/simplemultiproject/roadmap.py", line 183, in filter_stream
    stream_roadmap = HTML(to_unicode(stream))
  File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/input.py", line 425, in HTML
    return Stream(list(HTMLParser(StringIO(text), encoding=encoding)))
  File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/input.py", line 432, in _coalesce
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/local/lib/python2.6/dist-packages/Genshi-0.6-py2.6.egg/genshi/input.py", line 339, in _generate
    raise ParseError(msg, self.filename, e.lineno, e.offset)
ParseError: malformed start tag: line 299, column 45

Attachments (0)

Change History (13)

comment:1 Changed 11 years ago by falkb

Owner: changed from Christopher Paredes to falkb
Status: newassigned
Trac Release: 0.12

Can you find out which character on your roadmap page causes this error? The whole HTML page is filtered through stream_roadmap = HTML(to_unicode(stream)) and it seems some characters disturb that function. I haven't experienced it here, but it seems to happen for several people, but quite rarely.

comment:2 Changed 11 years ago by anonymous

Hi,

thx for help. I have german language and characters like ä ö ü ß but i removed them in the milestones.

However when i change to english language, the error goes to

ParseError: malformed start tag: line 321, column 55

Dont know how to debug this further.

comment:3 Changed 11 years ago by falkb

I think line and column numbers are of your specific roadmap.html. Could you check what is at your [321,55], please? Umlauts are not the problem.

comment:4 Changed 11 years ago by alex

The only file i have found is

/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/ticket/templates/roadmap.html

(i had to change the href's and url's for this comment)

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "***xhtml1-strict.dtd">
<html xmlns="***/xhtml"
      xmlns:py="***edgewall/"
      xmlns:i18n="***/i18n"
      xmlns:xi="***/XInclude">
  <xi:include href="layout.html" />
  <head>
    <title>Roadmap</title>
  </head>

  <body>
    <div id="content" class="roadmap">
      <h1>Roadmap</h1>

      <form id="prefs" method="get" action="">
        <div>
          <input type="checkbox" id="showcompleted" name="show" value="completed"
                 checked="${'completed' in show or None}" />
          <label for="showcompleted">Show completed milestones</label>
        </div>
        <div>
          <input type="checkbox" id="hidenoduedate" name="show" value="noduedate"
                 checked="${'noduedate' in show or None}" />
          <label for="hidenoduedate">Hide milestones with no due date</label>
        </div>
        <div class="buttons">
          <input type="submit" value="${_('Update')}" />
        </div>
      </form>

      <div class="milestones">
        <div py:for="idx, milestone in enumerate(milestones)" class="milestone">

          <div class="info" py:with="mstats = milestone_stats[idx]">
            <h2>*** href="${href.milestone(milestone.name)}">
              Milestone: <em>${milestone.name}</em>
            </a></h2>
            <py:choose>
              <p py:when="milestone.completed" class="date">
                <i18n:msg params="duration, date">
                  Completed ${dateinfo(milestone.completed)} ago (${format_datetime(milestone.completed)})
                </i18n:msg>
              </p>
              <p py:when="milestone.is_late" class="date">
                <i18n:msg params="duration, date">
                  <strong>${dateinfo(milestone.due)} late</strong> (${format_datetime(milestone.due)})
                </i18n:msg>
              </p>
              <p py:when="milestone.due" class="date">
                <i18n:msg params="duration, date">
                  Due in ${dateinfo(milestone.due)} (${format_datetime(milestone.due)})
                </i18n:msg>
              </p>
              <p py:otherwise="" class="date">
                No date set
              </p>
            </py:choose>
            <xi:include href="progress_bar.html" py:if="mstats.stats.count"
                        py:with="stats = mstats.stats; interval_hrefs = mstats.interval_hrefs;
                                 stats_href = mstats.stats_href"/>
          </div>

          <div class="description" xml:space="preserve">
            ${wiki_to_html(context(milestone.resource), milestone.description)}
          </div>

        </div>
      </div>

      <div py:if="'MILESTONE_CREATE' in perm" class="buttons">
       <form method="get" action="${href.milestone()}"><div>
        <input type="hidden" name="action" value="new" />
        <input type="submit" value="${_('Add new milestone')}" />
       </div></form>
      </div>

      <div id="help" i18n:msg=""><strong>Note:</strong> See
        *** href="${href.wiki('TracRoadmap')}">TracRoadmap</a> for help on using
        the roadmap.
      </div>

    </div>
  </body>
</html>

do you see any error there?

comment:5 in reply to:  4 ; Changed 11 years ago by falkb

Replying to alex:

The only file i have found is

/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/ticket/templates/roadmap.html

No, I don't mean the template in Trac's sources but instead what Trac generates from this template for you. Please, temporarily disable the plugin SimpleMultiProjectPlugin on your Admin web page, and then click 'Roadmap' (or 'Projektplan') in your main menu and look in that sources of your concrete roadmap.hmtl which Trac displays for you. If the plugin was enabled, it would stumble on page position [line=321,column=55]. I suspect you have HTML tags our used filter function HTML() cannot stand.

comment:6 in reply to:  5 Changed 11 years ago by falkb

Replying to falkb:

... and look in that sources of your concrete roadmap.hmtl which Trac displays for you...

e.g. via Firefox main menu: Extras-->WebDeveloper-->PageSourceCode (or Extras-->WebEntwickler-->Seitenquelltext_anzeigen)

comment:7 Changed 11 years ago by alex

I see.

here is the output http://pastebin.mozilla.org/1960468

but i think the position 321 is in some other code file that parse the html output. So tracking down the error in the html output is not nice.

Could it be a problem with some other plugin i use? Just thinking that the other plugins add content to the html.

ill try to disable the other plugins one by one and test it.

comment:8 Changed 11 years ago by falkb

Someone has a similar error here at http://genshi.edgewall.org/ticket/375, and you see in comment 4 of that ticket that line and column report you the error location in your HTML output of your specifically generated roadmap.html page. I see in your sent pastebin you don't have 321 lines. Did you cut some text? E.g. I see string "blah" in milestone "Lieferzeit Verkuerzung", is this the real text?

comment:9 Changed 11 years ago by anonymous

it is the real text. was just for testing puproses. I did not cut any html.

i have just put this in html validator and i am getting errors from the footer. in the last <p> tag there are two "html-tags" that break the <p> tag.

I try to get rid of them.

comment:10 in reply to:  9 Changed 11 years ago by falkb

Replying to anonymous:

in the last <p> tag there are two "html-tags" that break the <p> tag.

I wonder how this could happen since it's all generated HTML code. And I wish Genshi was more robust, skip it instead of giving up with Parse Error. I filed a comment on their ticket 375.

comment:11 Changed 11 years ago by alex

Resolution: fixed
Status: assignedclosed

yah got it.

solution: put this into your project/templates/site.html

<div py:match="div[@id='footer']">
</div>

afaik the < > chars are not written as &lt; &gt; in the footer, so the parser gets real tags out of

Last-Translator: Felix Schwarz <felix.schwarz@…> Language-Team: de_DE <trac-dev@…>

Thanks for your support falkb

comment:12 in reply to:  11 ; Changed 11 years ago by falkb

Replying to alex:

yah got it.

Glad to read this.

solution: put this into your project/templates/site.html

Do you mean this as demand for me? Or is it just a hint for anybody who has such problems also?

<div py:match="div[@id='footer']">
</div>

What is the difference to your old broken version?

comment:13 in reply to:  12 Changed 11 years ago by alex

Replying to falkb:

Replying to alex:

yah got it.

Glad to read this.

solution: put this into your project/templates/site.html

Do you mean this as demand for me? Or is it just a hint for anybody who has such problems also?

Just a hint

<div py:match="div[@id='footer']">
</div>

What is the difference to your old broken version?

well i just do not write any footer content at all anymore. the default footer should be the code out of the trac/templates/theme.html file

so in my case it is just the content of ${chrome.footer} that is wrong. but i do not know where this is set.

in this variable you find the broken output (especially the brackets):

Project-Id-Version: Trac 0.12
Report-Msgid-Bugs-To: trac-dev@googlegroups.com
POT-Creation-Date: 2012-01-29 14:04+0100
PO-Revision-Date: 2012-05-08 13:52+0200
Last-Translator: Felix Schwarz '''<'''felix.schwarz@oss.schwarz.eu'''>'''
Language-Team: de_DE '''<'''trac-dev@googlegroups.com'''>'''
Plural-Forms: nplurals=2; plural=(n != 1)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Generated-By: Babel 0.9.5

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain falkb.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.