playtestcloud / ruby_fints

Basic FinTS 3.0 (formerly known as HBCI) implementation in Ruby
MIT License
14 stars 6 forks source link

"Wrong line format" error with comdirect #6

Open deyhle opened 5 years ago

deyhle commented 5 years ago

Hi,

I just came over from https://github.com/schurig/ynab-bank-importer/issues/43 where @schurig recommended to open an issue here.

I get the following error:

/usr/local/bundle/gems/cmxl-0.2.1/lib/cmxl/field.rb:51:in `parse': Wrong line format: ":              ?249,999?25FLOSSB.V.STORCH-MUL.OPP.R?26A0M430EUR 1,60?27ABR.BETRAG BRUTTO 13,07 EUR?28STEUERABZUG 2,93- EUR?29Ref. 2PF199999999992/4" (Cmxl::Field::LineFormatError)

(sensitive parts overwritten with 9s)

The transaction seems to be this one in the comdirect web interface:

bildschirmfoto 2019-01-09 um 08 35 36

Any help?

mkilling commented 5 years ago

Hi, and thanks for reporting this! Unfortunately I don’t have any spare time to look into this in the next couple of weeks... However I can offer some pointers on how you could approach debugging this:

  1. Record the failing request/response using a gem like VCR so it can be reproduced without hitting the server - potentially writing a failing test case just for the sake of this debugging session
  2. Use a ruby debugger to set a break point where the exception gets thrown
  3. work my way backward on why the data gets rejected by Cmxl

Sorry that I can’t offer more help right now!

117agu commented 5 years ago

Hi, I got the same error with this line: maxmeerbusch@YOGAMAX:~/ynab-bank-importer$ ruby run.rb /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl/field.rb:51:inparse': Wrong line format: ":?32AMAZON EU S.A R.L., NIEDERL?33ASSUNG D?60DE24ZZZ00000000000?61Ref. IE21834000000069/0000" (Cmxl::Field::LineFormatError) from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl/statement.rb:42:in block in parse!' from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl/statement.rb:36:ineach' from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl/statement.rb:36:in parse!' from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl/statement.rb:16:ininitialize' from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl.rb:41:in new' from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl.rb:41:inblock in parse' from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl.rb:41:in collect' from /var/lib/gems/2.3.0/gems/cmxl-0.2.1/lib/cmxl.rb:41:inparse' from /var/lib/gems/2.3.0/gems/ruby_fints-0.0.3/lib/fints/helper.rb:13:in mt940_to_array' from /var/lib/gems/2.3.0/gems/ruby_fints-0.0.3/lib/fints/client.rb:79:inget_statement' from /home/maxmeerbusch/ynab-bank-importer/lib/dumper/fints.rb:22:in fetch_transactions' from /home/maxmeerbusch/ynab-bank-importer/lib/account.rb:18:infetch_transactions' from run.rb:11:in block in <main>' from run.rb:9:inmap' from run.rb:9:in <main>' maxmeerbusch@YOGAMAX:~/ynab-bank-importer$

Maybe you could look into this after the next couple of weeks. thank you!

nerdgore commented 5 years ago

Maybe this helps, this might be related to account types of comdirect. For me it works well with "Girokonto" and I see the problems with "Verrechnungskonto". Previously I've encountered a similar issue working on a csv parser for comdirect because each account type uses different column fields.

Phil0 commented 5 years ago

got the same problem with ynab-bank-importer and comdirect

all numbers from bank statement changed to 9, if needed i can send the original.

$ docker-compose run importer
/usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/field.rb:51:in `parse': Wrong line format: ":             9?999,999?99SIEMENS AG NA?99999999             EUR9,99?99Ref. 99A9999999999999/9" (Cmxl::Field::LineFormatError)
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:42:in `block in parse!'
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:36:in `each'
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:36:in `parse!'
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:16:in `initialize'
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `new'
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `block in parse'
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `collect'
    from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `parse'
    from /usr/local/bundle/gems/ruby_fints-0.0.3/lib/fints/helper.rb:13:in `mt940_to_array'
    from /usr/local/bundle/gems/ruby_fints-0.0.3/lib/fints/client.rb:79:in `get_statement'
    from /usr/app/lib/dumper/fints.rb:22:in `fetch_transactions'
    from /usr/app/lib/account.rb:18:in `fetch_transactions'
    from /usr/app/run.rb:11:in `block in <main>'
    from /usr/app/run.rb:9:in `map'
    from /usr/app/run.rb:9:in `<main>'

Has someone found a solution yet?

117agu commented 5 years ago

After the latest pull from @schurig , comdirect works fine for me!

misterfinster commented 5 years ago

I updated the schurig/ynab-bank-importer manually to ruby_fints-0.0.4 and this issue still exists.

Traceback (most recent call last):
    15: from /usr/app/run.rb:9:in `<main>'
    14: from /usr/app/run.rb:9:in `map'
    13: from /usr/app/run.rb:11:in `block in <main>'
    12: from /usr/app/lib/account.rb:18:in `fetch_transactions'
    11: from /usr/app/lib/dumper/fints.rb:22:in `fetch_transactions'
    10: from /usr/local/bundle/gems/ruby_fints-0.0.4/lib/fints/client.rb:124:in `get_statement'
     9: from /usr/local/bundle/gems/ruby_fints-0.0.4/lib/fints/helper.rb:13:in `mt940_to_array'
     8: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `parse'
     7: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `collect'
     6: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `block in parse'
     5: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl.rb:41:in `new'
     4: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:16:in `initialize'
     3: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:36:in `parse!'
     2: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:36:in `each'
     1: from /usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/statement.rb:42:in `block in parse!'
/usr/local/bundle/gems/cmxl-0.2.2/lib/cmxl/field.rb:51:in `parse': Wrong line format: ":48  Folge?25nr. 007  Verfalld. 1222  Or?26iginal 300,00 CHF 1 EUR/1,1?274259 CHF  Entgelt 5,99 EUR?30XXXXXXXXXXX?31DE12345678901234567890?32Deutsche Bank AG" (Cmxl::Field::LineFormatError)

Possibly an error in cmxl? I see that it is already at 1.4.0, it is possible to update?

misterfinster commented 5 years ago

I updated cmxl to 1.4.0 and applied this patch manually (https://github.com/railslove/cmxl/pull/31) and it has resolved my issue.