syntax error: mismatched tag ?!

71 views
Skip to first unread message

Sarp Erdag

unread,
May 14, 2009, 10:33:20 AM5/14/09
to django-haystack
Hello, I have been trying get haystack working with my project. Here
is the little error I am receiving. What do you think can be the
problem? Thank you

sarp@sarp-laptop:~/workspace/eventlet$ ./manage.py reindex
Loaded URLconf to initialize SearchSite...
Main site registered 1 index(es). Indexing 1 events. Traceback (most
recent call last): File "./manage.py", line 27, in

execute_from_command_line()

File "/usr/lib/python2.5/site-packages/django/core/management/
init.py", line 331, in execute_from_command_line

utility.execute()

File "/usr/lib/python2.5/site-packages/django/core/management/
init.py", line 295, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "/usr/lib/python2.5/site-packages/django/core/management/
base.py", line 77, in run_from_argv

self.execute(*args, **options.__dict__)

File "/usr/lib/python2.5/site-packages/django/core/management/
base.py", line 96, in execute

output = self.handle(*args, **options)

File "/usr/lib/python2.5/site-packages/haystack/management/commands/
reindex.py", line 34, in handle

self.handle_app(None, **options)

File "/usr/lib/python2.5/site-packages/haystack/management/commands/
reindex.py", line 81, in handle_app

index.backend.update(index, small_cache_qs[start:end])

File "/usr/lib/python2.5/site-packages/haystack/backends/
solr_backend.py", line 58, in update

self.conn.add(docs, commit=commit)

File "build/bdist.linux-i686/egg/pysolr.py", line 304, in add File
"build/bdist.linux-i686/egg/pysolr.py", line 177, in _extract_error
File "", line 45, in parse File "", line 32, in parse SyntaxError:
mismatched tag: line 1, column 1124

Daniel Lindsley

unread,
May 14, 2009, 10:48:42 AM5/14/09
to django-...@googlegroups.com
Sarp,


What version of pysolr are you using? You need either the official
pysolr (2.0.x) which can be installed off PyPi (easy_install/pip) or
the GitHub variant (http://github.com/toastdriven/pysolr).

I ask this because it looks like your pysolr is trying to send
(broken) XML, which is what the older variant of pysolr did. The new
version uses JSON and should be able to avoid this. This will also
have an impact on using the more complex aspects of Haystack, as the
old version didn't support a couple features.


Daniel

Sarp Erdag

unread,
May 14, 2009, 10:53:43 AM5/14/09
to django-haystack
I see I have pysolr 1.0 installed, now trying it with the latest
version...

On May 14, 4:48 pm, Daniel Lindsley <polarc...@gmail.com> wrote:
> Sarp,
>
>    What version of pysolr are you using? You need either the official
> pysolr (2.0.x) which can be installed off PyPi (easy_install/pip) or
> the GitHub variant (http://github.com/toastdriven/pysolr).
>
>    I ask this because it looks like your pysolr is trying to send
> (broken) XML, which is what the older variant of pysolr did. The new
> version uses JSON and should be able to avoid this. This will also
> have an impact on using the more complex aspects of Haystack, as the
> old version didn't support a couple features.
>
> Daniel
>

Sarp Erdag

unread,
May 14, 2009, 10:58:32 AM5/14/09
to django-haystack
Update pysolr, still getting the exact same error...

Sarp Erdag

unread,
May 14, 2009, 10:59:30 AM5/14/09
to django-haystack
I mean "updated"

Collin Anderson

unread,
May 14, 2009, 11:30:10 AM5/14/09
to django-...@googlegroups.com
I am also using pysolr from http://github.com/toastdriven/pysolr, and
I found that it was sending correct xml, but whenever solr sent back
an error message, the _extract_error method failed to correctly scrape
the html for the error message. It gave the same syntax error as
above.

I am using Solr 1.4-dev 767754 2009-04-23.

Daniel Lindsley

unread,
May 14, 2009, 11:36:44 AM5/14/09
to django-...@googlegroups.com
Sarp,


Are you using Solr 1.4 as well? I have not seen this issue on Solr
1.3 or below.


Daniel

Sarp Erdag

unread,
May 14, 2009, 11:59:39 AM5/14/09
to django-haystack
I am using solr 1.3, now I am gonna upgrade to 1.4

On May 14, 5:36 pm, Daniel Lindsley <polarc...@gmail.com> wrote:
> Sarp,
>
>    Are you using Solr 1.4 as well? I have not seen this issue on Solr
> 1.3 or below.
>
> Daniel
>
> On Thu, May 14, 2009 at 10:30 AM, Collin Anderson <swee...@gmail.com> wrote:
>
> > I am also using pysolr fromhttp://github.com/toastdriven/pysolr, and
> > I found that it was sending correct xml, but whenever solr sent back
> > an error message, the _extract_error method failed to correctly scrape
> > the html for the error message. It gave the same syntax error as
> > above.
>
> > I am using Solr 1.4-dev 767754 2009-04-23.
>

Sarp Erdag

unread,
May 14, 2009, 12:05:34 PM5/14/09
to django-haystack
Hmm I just saw that the latest stable version of solr is 1.3, so I do
not have to upgrade I guess

Sarp Erdag

unread,
May 15, 2009, 5:23:43 AM5/15/09
to django-haystack
Any more ideas? I still have the problem :/

Daniel Lindsley

unread,
May 15, 2009, 9:35:17 AM5/15/09
to django-...@googlegroups.com
Sarp,


Sorry, I'm not sure what to tell you. I've never encountered that
error before in the course of indexing literally hundreds of thousands
of records with data of all types ranging from Unicode strings to XML.
Without knowing what your SearchIndexes look like, what your data
consists of and what exactly is being indexed, I can't be of much
help. The error you're getting is being emitted from Solr (comes back
as HTML so pysolr tries to parse the HTML and yank out the contents of
the <h1>) but your ElementTree is failing to parse the HTML due to
invalid HTML (maybe?). You could try manually poking at your Solr
instance with data through a browser and seeing what comes back.


Daniel

Collin Anderson

unread,
May 15, 2009, 10:36:33 AM5/15/09
to django-...@googlegroups.com
I personally just modified pysolr to save the response to a file
before it attempts to parse the error, so I can view the error in a
browser instead.
Reply all
Reply to author
Forward
0 new messages