OpenEnergyPlatform / open-MaStR

A collaborative software to download the energy database Marktstammdatenregister (MaStR)
https://open-mastr.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
83 stars 17 forks source link

'Fehler bei der Emittlung des Nutzers.' for GetGefilterteListeStromErzeuger and GetEinheitSolar #517

Closed georgroesch closed 3 months ago

georgroesch commented 3 months ago

Description of the issue

Since a few days certain SOAP calls seem to fail with the error message below. This is somehow weird as the exact same code was working quite well. Also the error message indicates that there is some issue authenticating the user but other SOAP calls using the same function seem to work. We were even able to gather 11294 solar units for example.

We are calling those function in an asynchronous manner in order to gather all existing records as quick as possible - but I was able to reproduce the error with a single call.

Error message:

Traceback (most recent call last):
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/open_mastr/soap_api/download.py", line 115, in wrapper
    response = soap_func(*args, **kwargs)
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/proxy.py", line 46, in __call__
    return self._proxy._binding.send(
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 135, in send
    return self.process_reply(client, operation_obj, response)
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
    return self.process_error(doc, operation)
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 329, in process_error
    raise Fault(
zeep.exceptions.Fault: Fehler beim Deserialisieren des Textkörpers der Anforderungsnachricht für Vorgang "GetGefilterteListeStromErzeuger".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/open_mastr/soap_api/download.py", line 119, in wrapper
    response = soap_func(*args, **kwargs)
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/proxy.py", line 46, in __call__
    return self._proxy._binding.send(
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 135, in send
    return self.process_reply(client, operation_obj, response)
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
    return self.process_error(doc, operation)
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 329, in process_error
    raise Fault(
zeep.exceptions.Fault: Fehler bei der Emittlung des Nutzers. Bitte versuchen Sie es erneut

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/g.roesch/PycharmProjects/reporting_ssot_tools/venv/lib/python3.10/site-packages/open_mastr/soap_api/download.py", line 133, in wrapper
    raise Fault(msg) from e
zeep.exceptions.Fault: MaStR SOAP API still gives a weird response: 'Fehler bei der Emittlung des Nutzers. Bitte versuchen Sie es erneut'.
Retry failed!

Steps to Reproduce

from open_mastr.soap_api.download import MaStRAPI

mastr_api = MaStRAPI(user=username, key=token)

units = mastr_api.GetGefilterteListeStromErzeuger(limit=1000,
                                             startAb=0,
                                             energietraeger="SolareStrahlungsenergie",
                                             datumAb="2024-04-30 00:00:00")

Ideas of solution

No current solution in sight but please let me know if you need more information

Context and Environment

Workflow checklist

FlorianK13 commented 3 months ago

Hi @georgroesch, this message seems to come from the original API request, hence the source of the error is not open-mastr but the official API from Bundesnetzagentur. You can check their documentation here if they recently changed something regarding the API. If you still think it is a bug, there is the possibility to contact them directly here

georgroesch commented 3 months ago

Hi @FlorianK13, thanks for the response, I will reach out to Bundesnetzagentur directly then. However, the error we encountered seemed to be a temporary one as our today's requests went through successfully!