python-fints icon indicating copy to clipboard operation
python-fints copied to clipboard

FinTS dialog with Berliner Sparkasse aborts due to invalid dialog ID

Open cjolowicz opened this issue 1 year ago • 5 comments

Describe the bug Minimal bootstrap fails with Sparkasse.

The FinTS dialog with Sparkasse aborts when fetching the tan medium (client.get_tan_media) with error 9010 - Die angegebene Bankreferenz/Dialog-ID ist nicht gültig.

*Bank I tested this with Name of the bank: Berliner Sparkasse FinTS URL: https://banking-be3.s-fints-pt-be.de/fints30

Expected behavior Minimal bootstrap succeeds.

I've successfully used this for a couple of years and I've passed a valid product ID. Last successful use was on April 27, 2024. First failure was on May 20, 2024.

Code required to reproduce The code from quickstart.rst up to minimal bootstrap (minimal_interactive_cli_bootstrap).

Log output / error message

ERROR:fints.client:Dialog response: 9050 - Die Nachricht enthält Fehler.
ERROR:fints.client:Dialog response: 9800 - Dialog abgebrochen
ERROR:fints.client:Dialog response: 9010 - Die angegebene Bankreferenz/Dialog-ID ist nicht gültig.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../raphaelm/python-fints/fints/utils.py", line 301, in minimal_interactive_cli_bootstrap
    m = client.get_tan_media()
        ^^^^^^^^^^^^^^^^^^^^^^
  File ".../raphaelm/python-fints/fints/client.py", line 1425, in get_tan_media
    response = method(dialog)(seg)
               ^^^^^^^^^^^^^^^^^^^
  File ".../raphaelm/python-fints/fints/dialog.py", line 156, in send
    self.client.process_response_message(self, response, internal_send=internal_send)
  File ".../raphaelm/python-fints/fints/client.py", line 230, in process_response_message
    self._process_response(dialog, None, response)
  File ".../raphaelm/python-fints/fints/client.py", line 1341, in _process_response
    raise FinTSClientError("Error during dialog initialization, could not fetch BPD. Please check that you "
fints.exceptions.FinTSClientError: Error during dialog initialization, could not fetch BPD. Please check that you passed the correct bank identifier to the HBCI URL of the correct bank.

Additional context Python 3.11 macOS python-fints 4.1.0

With earlier versions (4.0.0 and 3.1.0) I get this error instead (which I think was fixed in 4.1.0):
Traceback (most recent call last):
  File ".../raphaelm/python-fints/minimal.py", line 15, in <module>
    minimal_interactive_cli_bootstrap(f)
  File ".../raphaelm/python-fints/fints/utils.py", line 319, in minimal_interactive_cli_bootstrap
    if client.is_tan_media_required() and not client.selected_tan_medium:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../raphaelm/python-fints/fints/client.py", line 1180, in is_tan_media_required
    tan_mechanism = self.get_tan_mechanisms()[self.get_current_tan_mechanism()]
                    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '999'

My last successful use of this library was with a version before 4, likely 3.1.0.

cjolowicz avatar May 20 '24 15:05 cjolowicz

Hello,

same behaviour on fetching Transactions from Sparkasse Pforzheim-Calw (BLZ: 66650085 / Endpoint: https://banking-bw3.s-fints-pt-bw.de/fints30) using fints Library Version 4.1.0.

Fetching failed immediately after changing TAN-Mechanism from QR to PushTAN App (=TAN-Method 923).

Troubleshooting Script shows following error: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last): File "/srv/its/bank/stmt.request/test/troubleshoot.py", line 21, in minimal_interactive_cli_bootstrap(f) File "/srv/its/bank/stmt.request/venv/lib/python3.11/site-packages/fints/utils.py", line 301, in minimal_interactive_cli_bootstrap m = client.get_tan_media() ^^^^^^^^^^^^^^^^^^^^^^ File "/srv/its/bank/stmt.request/venv/lib/python3.11/site-packages/fints/client.py", line 1425, in get_tan_media response = method(dialog)(seg) ^^^^^^^^^^^^^^^^^^^ File "/srv/its/bank/stmt.request/venv/lib/python3.11/site-packages/fints/dialog.py", line 156, in send self.client.process_response_message(self, response, internal_send=internal_send) File "/srv/its/bank/stmt.request/venv/lib/python3.11/site-packages/fints/client.py", line 230, in process_response_message self._process_response(dialog, None, response) File "/srv/its/bank/stmt.request/venv/lib/python3.11/site-packages/fints/client.py", line 1341, in _process_response raise FinTSClientError("Error during dialog initialization, could not fetch BPD. Please check that you " fints

Contents of the OrderedDict in Function client.get_tan_mechanisms: OrderedDict([('923', fints.formals.TwoStepParameters7(security_function='923', tan_process='2', tech_id='pushTAN-cas', zka_id='Decoupled', zka_version=None, name='pushTAN 2.0', max_length_input=None, allowed_format=None, text_return_value='Aufforderung', max_length_return_value=2048, multiple_tans_allowed=True, tan_time_dialog_association=fints.formals.TANTimeDialogAssociation.ALLOWED, cancel_allowed=False, sms_charge_account_required=fints.formals.SMSChargeAccountRequired.MUST_NOT, principal_account_required=fints.formals.PrincipalAccountRequired.MUST_NOT, challenge_class_required=False, challenge_structured=False, initialization_mode=fints.formals.InitializationMode.CLEARTEXT_PIN_NO_TAN, description_required=fints.formals.DescriptionRequired.MUST, response_hhd_uc_required=False, supported_media_number=5, decoupled_max_poll_number=180, wait_before_first_poll=1, wait_before_next_poll=1, manual_confirmation_allowed=True, automated_polling_allowed=True))])

Switching back TAN-Mechanism to QR will fix the error. Troubleshooting Script then works fine.

Also found similar notices in AqBanking Forum.

Sorry @raphaelm - i am not able to solve this by myself at the moment. The process is still too complex for me to understand.

Chris

ntf1974 avatar Jun 09 '24 12:06 ntf1974

There's also https://github.com/raphaelm/python-fints/issues/121 which may be related. It's the same error message, but with DKB.

cjolowicz avatar Jul 21 '24 17:07 cjolowicz

Hello, I'm having the same issue with Sparkasse Schwaben-Bodensee since today on BLZ 73150000 and URL https://banking-by5.s-fints-pt-by.de/fints30.

Any idea how this could be fixed?

webffo avatar Aug 07 '24 05:08 webffo

Same here since yesterday. I'm willing to test if someone is able to blind-fix this like we did in #155

saddy001 avatar Sep 25 '24 13:09 saddy001

#171 could also be related

raphaelm avatar Oct 04 '24 13:10 raphaelm

Please try again with python-fints 4.2.0 and storing the system ID and passing it to the next run: https://python-fints.readthedocs.io/en/latest/tans.html#system-ids

If the issue persists, feel free to reopen.

raphaelm avatar Oct 26 '24 14:10 raphaelm

Please try again with python-fints 4.2.0 and storing the system ID and passing it to the next run: https://python-fints.readthedocs.io/en/latest/tans.html#system-ids

If the issue persists, feel free to reopen.

I confirm: v4.2.0 fixes the problem for sparkasse pforzheim-calw (66650085). THANK YOU so much @raphaelm!

ntf1974 avatar Nov 02 '24 15:11 ntf1974

Sadly doesn't work for me. If I pass the stored system_id to FinTS3PinTanClient it throws

fints.exceptions.FinTSDialogInitError: Couldn't establish dialog with bank, Authentication data wrong?

What's unclear to me in the docs is "During your first connection, the bank will assign your client application a “system ID”". Because I get assigned a new system_id on every call to FinTS3PinTanClient(). I just stored the last one that I got assigned and used it for the next call. Am I doing it wrong?

saddy001 avatar Nov 04 '24 09:11 saddy001