Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Nachricht ungueltig.:Validierung fehlgeschlagen with DKB in current version #94

Open
korneliuscode opened this issue Dec 11, 2021 · 17 comments
Labels

Comments

@korneliuscode
Copy link
Contributor

korneliuscode commented Dec 11, 2021

I get an error with DKB on the most current version. Right with synchronization:

HNHBK:1:3+000000000137+300+0+1+0:1'
HIRMG:2:2+9010::Nachricht ungueltig.:Validierung fehlgeschlagen.+9800::Dialog abgebrochen'
HNHBS:3:1+1'

This is the trace of the sent message.

HNSHA:6:2+2146045886951968++XXXXXX'
HNHBK:1:3+000000000407+300+0+1'
HNVSK:998:3+PIN:1+998+1+1::0+1:20211211:140736+2:2:13:@8@00000000:5:1+280:12030000:XXXXXXXX:V:0:0+0'
HNVSD:999:1+@246@HNSHK:2:4+PIN:1+999+2146045886951968+1+1+1::0+1+1:20211211:140736+1:999:1+6:10:16+280:12030000:XXXXXXXX:S:0:0'
HKIDN:3:2+280:12030000+XXXXXXXX+0+1'
HKVVB:4:3+0+0+0+9FA6681DEC0CF3046BFC2F8A6+1.0.0'
HKSYN:5:3+0'
HNSHA:6:2+2146045886951968++XXXXXXXXXXX''
HNHBS:7:1+1'

Does anyone have an idea what this could be?

@leschbenedikt
Copy link

There is an error in the message creation.
In line 705 and 726 in FinTsMessage.cs a StringBuilder is reused which results in a faulty message.

But even if I fix that I'm running into other issues later when trying the get the account balance.

@party-pansen
Copy link
Contributor

I see the same issue with the latest version.
But probably there is also something else:

  • Until some days I used an much older version, I think it was from april 21, without any problems...

  • Since beginning of 2022 I think DKB changed something and I got error message (with older version) like:
    Initialisation failed: 9050: Die Nachricht enthält Fehler., 3905: Es wurde keine Challenge erzeugt., 9800: Dialog abgebrochen, 3920: Zugelassene Zwei-Schritt-Verfahren für den Benutzer.:921, 9955: Auftrag nicht ausgeführt - Die Gerätebezeichnung ist unbekannt. (MBV07390100255)

@leschbenedikt Is this something you see after your fix?

Anyone else available to look into the DKB issue?
I'll try to have a more detailed look within the next days at least to reproduce the old error message, but I am not really familiar with this bank communication stuff...

@thisistorsten
Copy link
Collaborator

Ich habe versucht die Library upzudaten. Scheinbar ist mir hier ein Fehler unterlaufen. Die Bibliothek benötigt jedoch ein komplettes Redesign/Refactoring.

@leschbenedikt
Copy link

@party-pansen
I just checked my local code, the only othes changes I found were in HKKAZ.cs
But the change is only related to transaction retrieval. I'm not sure what use case your are talking about.

But anyway this are the changes:

At first I added the segment Id to the call in line 147
segments = HKTAN.Init_HKTAN(client, segments, "HKKAZ");

In addition I replace every client.HICAZS with client.HIKAZS like in the commented rows below.
But if I remenber it correctly this resolved problems with one bank but had issues with other banks.
Maybe you try the first change at first and only try the second one if it's still not working.

@party-pansen
Copy link
Contributor

Ok, I had some time to analyse:

There is a major bug in the new implementation as you already pointed out:
In line 705 and 726 in FinTsMessage.cs the following line needs to be added:
sb = new StringBuilder();

After that I get back to my original error message regarding "9955: Auftrag nicht ausgeführt - Die Gerätebezeichnung ist unbekannt."

After some research I found the following article:
https://medium.com/@subsembly/leitfaden-deutsche-kreditbank-dkb-bbd2d23fb6b9

So there was indeed an issue with my TAN devices which I could solve online @ DKB by removing a second, old pushTan device...

Back to the program, it still did not work. I needed to provide a pushtan, but the generated HKTAN message has failures:
HIRMG:3:2+9050::Die Nachricht enthält Fehler.+9800::Dialog abgebrochen+9000::Konvertierung in das/aus dem Format des Verarbeitungssystems fehlgeschlagen.'

Luckily I had an old trace which gave me a hint on the bug. It's simple:
Just uncomment line 151 from Tan.cs
That's again a bug when switching to sb.Append from old string concatenation

With that I am now able to get a correct answer from DKB.
Unfortunately my accounts are not accessible as before switching to latest version. I need to analyze this...

Currently I have not yet github correctly setup to simply push the bugfixes, but I think these are extreme simple for you to incorporate @thisistorsten

I'll probably open up a new issue for the other bugs when anlzying them in the next days...

@party-pansen
Copy link
Contributor

For me DKB is working again,
besides the obvious bugfixes I already explained above, I needed to hack HKKAZ. I only did it for the relevant section for my bank and switched it back to some old HKKAZ string.
I wonder what these changes in HKKAZ were all about?`It looked very different.
Please review this in Branch bugfixes_dkb
Regards
party-pansen

@thisistorsten
Copy link
Collaborator

Can someone please retest?

@party-pansen
Copy link
Contributor

party-pansen commented Jan 13, 2022

the initial error is gone, but retrieving transactions via HKKAZ is not working for DKB. You did not honor my change to HKKAZ. At least for DKB this must be changed back to the old message...

@iamtorsten
Copy link
Owner

@party-pansen please recommend your changes here.

@party-pansen
Copy link
Contributor

Please compare with my pushed branch bugfixing_pp. Since the segment now looks very different someone with some insight should have a look at it...

@party-pansen
Copy link
Contributor

Within the same branch I also added 2 additional fixes for consorsbank, one regarding the consorsbank message format (6241d4e) and the other also regarding the HKKAZ (8890b67)
Please have a look

@korneliuscode
Copy link
Contributor Author

Is DKB working for you again? I also deleted my second pushTAN device, but still no luck on Master and also not on bugfixing_pp.

@iamtorsten
Copy link
Owner

@korneliuscode @party-pansen please retest with this PR.
0810e8f

@korneliuscode
Copy link
Contributor Author

Sorry for the late reply. I was just trying but unfortunately it is not working for me still. I'm testing on the current version of master.

Code: 3060 | Typ: Warning | Nachricht: Bitte beachten Sie die enthaltenen Warnungen/Hinweise.
Code: 0020 | Typ: Success | Nachricht: Auftrag ausgeführt.
Code: 3050 | Typ: Warning | Nachricht: BPD nicht mehr aktuell, aktuelle Version enthalten.
Code: 3920 | Typ: Warning | Nachricht: Zugelassene Zwei-Schritt-Verfahren für den Benutzer.:xxx
Code: 0020 | Typ: Success | Nachricht: Der Auftrag wurde ausgeführt.
Code: 9050 | Typ: Error | Nachricht: Die Nachricht enthält Fehler.
Code: 9800 | Typ: Error | Nachricht: Dialog abgebrochen
Code: 9000 | Typ: Error | Nachricht: Konvertierung in das/aus dem Format des Verarbeitungssystems fehlgeschlagen.
Code: 9110 | Typ: Error | Nachricht: Ungültige Auftragsnachricht: Unbekannter Aufbau.

@korneliuscode
Copy link
Contributor Author

I tested it again with the current master. It still does not work with DKB. The old version of the library works, but the results are somewhat malformed. Is there anything I can do to support?

@leo-schick
Copy link
Contributor

Hi @korneliuscode ,

I think I had the same issue with DKB as you with. After running through code, I realized that I just typed in the IBAN and not the account number (Kontonummer) in the UI interface. Since DKB uses HKKAZ version 5, it still relyes on the account number and there seems to be no logic to extract the account number from the IBAN by default.

After entering the Kontonummer, all worked fine for me.

See as well HKKAZ.cs.

Log output with empty Kontonummer

Code: 3060 | Typ: Warning | Nachricht: Bitte beachten Sie die enthaltenen Warnungen/Hinweise.
Code: 0020 | Typ: Success | Nachricht: Auftrag ausgeführt.
Code: 3050 | Typ: Warning | Nachricht: BPD nicht mehr aktuell, aktuelle Version enthalten.
Code: 3920 | Typ: Warning | Nachricht: Zugelassene Zwei-Schritt-Verfahren für den Benutzer.:921
Code: 0020 | Typ: Success | Nachricht: Der Auftrag wurde ausgeführt.
Code: 9050 | Typ: Error | Nachricht: Die Nachricht enthält Fehler.
Code: 9110 | Typ: Error | Nachricht: Ungültige Auftragsnachricht: Unbekannter Aufbau.
Code: 9160 | Typ: Error | Nachricht: Pflichtfeld nicht gefunden
Code: 9010 | Typ: Error | Nachricht: Segment wegen anderer Fehler wirkungslos

Log output with filled Kontonummer

Code: 3060 | Typ: Warning | Nachricht: Bitte beachten Sie die enthaltenen Warnungen/Hinweise.
Code: 0020 | Typ: Success | Nachricht: Auftrag ausgeführt.
Code: 3050 | Typ: Warning | Nachricht: BPD nicht mehr aktuell, aktuelle Version enthalten.
Code: 3920 | Typ: Warning | Nachricht: Zugelassene Zwei-Schritt-Verfahren für den Benutzer.:921
Code: 0020 | Typ: Success | Nachricht: Der Auftrag wurde ausgeführt.
Code: 3060 | Typ: Warning | Nachricht: Bitte beachten Sie die enthaltenen Warnungen/Hinweise.
Code: 0020 | Typ: Success | Nachricht: Der Auftrag wurde ausgeführt.
Code: 0020 | Typ: Success | Nachricht: Die Umsätze wurden übermittelt.
Code: 3076 | Typ: Warning | Nachricht: Starke Kundenauthentifizierung nicht notwendig.
Datum: 01.11.2023 00:00:00 | Buchungsschlüssel: NDDT | GV-Code: 105 | Empfänger / Auftraggeber: ******* | Verwendungszweck: ************* | Betrag: -81,82
[ and more transactions ... ]

@leo-schick
Copy link
Contributor

I would suggest to implement a test that required fields must be given before a message is send to the bank server.

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

No branches or pull requests

6 participants