Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLSyntaxError: Start tag expected, '<' #16

Closed
vincePekaway opened this issue Apr 24, 2024 · 2 comments
Closed

XMLSyntaxError: Start tag expected, '<' #16

vincePekaway opened this issue Apr 24, 2024 · 2 comments

Comments

@vincePekaway
Copy link

Hey, I'm using a selfhosted version of pretix.
Since a few weeks ago, I'm getting the following error on the order confirmation when using pretix-sofort:

lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1
lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

I then did update the whole server from Debian Buster to Bookworm, upgraded Python from 3.7 to 3.11 and upgraded the Pretix installation and all the plugins to the latest version. Also did an upgrade to Postgres 15.

Now everything works as expected, only the SyntaxError in the Sofort plugin persists. Is the syntax something that could be corrected in the Pretix Backend? The error ocurred after having a working plugin for quite some time (since Buster basically), no changes have been made in Pretix and the last updates before that also happened some time ago.

The user that wants to buy tickets is presented with an internal server error, emails are being sent and therefore the order is confirmed as ordered but not paid.

full error log ERROR 2024-04-24 08:04:54,027 django.request log Internal Server Error: /VK/HOL-6/order/.../.../pay/8995/confirm Traceback (most recent call last): File "/var/pretix/venv/lib/python3.11/site-packages/pretix_sofort/sofort.py", line 130, in from_xml root = etree.fromstring(xml) ^^^^^^^^^^^^^^^^^^^^^ File "src/lxml/etree.pyx", line 3287, in lxml.etree.fromstring File "src/lxml/parser.pxi", line 1989, in lxml.etree._parseMemoryDocument File "src/lxml/parser.pxi", line 1876, in lxml.etree._parseDoc File "src/lxml/parser.pxi", line 1164, in lxml.etree._BaseParser._parseDoc File "src/lxml/parser.pxi", line 633, in lxml.etree._ParserContext._handleParseResultDoc File "src/lxml/parser.pxi", line 743, in lxml.etree._handleParseResult File "src/lxml/parser.pxi", line 672, in lxml.etree._raiseParseError File "", line 1 lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/pretix/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/django/views/decorators/clickjacking.py", line 58, in wrapper_view
resp = view_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/pretix/presale/views/init.py", line 500, in wrapped_view
resp = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/pretix/presale/views/order.py", line 449, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/pretix/presale/views/robots.py", line 41, in dispatch
resp = super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/pretix/presale/views/order.py", line 467, in post
resp = self.payment.payment_provider.execute_payment(request, self.payment)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/pretix_sofort/payment.py", line 129, in execute_payment
trans = sofort.NewTransaction.from_xml(self._api_call(r.to_xml()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/pretix_sofort/sofort.py", line 132, in from_xml
raise SofortError("Invalid XML received: " + xml.decode())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/pretix/venv/lib/python3.11/site-packages/pretix_sofort/sofort.py", line 16, in init
errors = etree.fromstring(xml)
^^^^^^^^^^^^^^^^^^^^^
File "src/lxml/etree.pyx", line 3287, in lxml.etree.fromstring
File "src/lxml/parser.pxi", line 1989, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1869, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1105, in lxml.etree._BaseParser._parseUnicodeDoc
File "src/lxml/parser.pxi", line 633, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 743, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 672, in lxml.etree._raiseParseError
File "", line 1
lxml.etree.XMLSyntaxError: Start tag expected, '<' not found, line 1, column 1

@raphaelm
Copy link
Member

This looks like sofort returned an error page. Maybe you are using invalid API credentials?

@vincePekaway
Copy link
Author

My mistake, Sofort GmbH went out of business and they discontinued all existing seller contracts. So yes, basically it was a problem with the API credentials.
There'll be SEPA instant payments soon, so no more need for third party providers.

Thanks for your answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants