Closed emarcey closed 4 months ago
In version 1.20.0, the bug did not occur, but the flag also didn't work correctly for an invalid file
I'm not able to reproduce the 500 error with your request. Can you verify the container is running and our requests look the same?
PR with test: https://github.com/moov-io/ach/pull/1379
It does also appear to work fine when I copy your test code and run that
Here's my docker ps:
I copy pasted the exact url into my postman and hit the docker image, with the same result as before:
Can you dump the full request headers and the moov/ach logs?
Here's the curl export:
--header 'Content-Type: text/plain' \
--data '101 011600062N8332197762105182246A094101SAMPLE BANK TWO KRAB PAYROLL SERVICES 00000000
5200Apple 900 *10692422681833219778PPDNET=PAY 240425240425 1011600060000001
62207590057544442280852 0000444400011600060000001Kyle Prince 0011600060000001
62207590057544442280852 0000012345011600060000002Michael Moyer 0011600060000002
62207590057544442280852 0000434354011600060000003Tracy Delgado 0011600060000003
6270114015331111222233330000 0000891099011600060000004Apple 0011600060000004
820000000400239103240000008910990000008910991833219778 011600060000001
5200Key-Morse 900 *10692422681833219778PPDNET=PAY 240425240425 1011600060000002
62207590057544442280852 0000002094011600060000005Laura Cruz 0011600060000005
62205300021944449593224 0000001604011600060000006Jillian Clayton 0011600060000006
62205300021944449593224 0010766499011600060000007Brian Waters 0011600060000007
627018042652121889252 0010770197011600068000008Key-Morse 0011600060000008
820000000400199943640000107701970000107701971833219778 011600060000002
5200Rubio Baldwin 900 *10692422681833219778PPDNET=PAY 240425240425 1011600060000003
6220710000134444911717 0000008617011600060000009Stephanie Flowers 0011600060000009
6220710000134444911717 0000006483011600060000010Catherine Martin 0011600060000010
6220710000134444911717 0000004566011600060000011Jason Lewis 0011600060000011
62704210119044444383427 0000019666011600068000012Rubio Baldwin 0011600060000012
820000000400255101220000000196660000000196661833219778 011600060000003
5200PRENOTES 900 *10692422681833219778PPDNET=PAY 240425240425 1011600060000004
623021000021986171749 0000000000011600060000013Blake Webb 0011600060000013
623021000021986171748 0000000000011600060000014Kayla Rodriguez 0011600060000014
633021000021011600060000015 0000000000287 Julie Decker 0011600060000015
820000000300063000060000000000000000000000001833219778 011600060000004
5200Lopez-Robinson 900 *10692422681833219778PPDNET=PAY 240425240425 1011600060000005
6221243031204444379179753 0000070690011600060000016Robin Fleming 0011600060000016
622124303120444459015 0000955239011600060000017Christine Keith 0011600060000017
6273211752614444389 0001025929011600068000018Lopez-Robinson 0011600060000018
820000000300569781500000010259290000010259291833219778 011600060000005
9000005000003000000180132692966000012706891000012706891
'
I don't have much in the way of ACH logs
Is there a debug enabled setting I can use?
For what it's worth, I built ./bin/server locally and that seems to work fine as well (although allowMissingFileHeader/Control don't work to allow invalid files through, but at least the bug doesn't show up). It's just the docker image where I'm running into issues
It also works okay if I submit a JSON file for creation without a file header/control, it's only on the ACH formatted version where there's an issue, so I would assume the problem is at these two places: https://github.com/moov-io/ach/blob/master/reader.go#L205 https://github.com/moov-io/ach/blob/master/reader.go#L211
Okay so idk why but v1.34.3 that you just released seems to be working for me with properly formatted files.
I'm unable to create with an ach file when it's missing the file header/control, even when using that opt. Is that just not supported?
Trying out that curl works for me. I had to add some args to the curl
command.
curl -v -XPOST http://localhost:8080/files/create --header 'Content-Type: text/plain' \
* Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> POST /files/create HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.4.0
> Accept: */*
> Content-Type: text/plain
> Content-Length: 2811
>
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Date: Mon, 26 Feb 2024 18:14:25 GMT
< Transfer-Encoding: chunked
<
{"id":"1ca6541d6eb6a363ac2f4a371b5fbe9d07ab9e79","file":{"id":"1ca6541d6eb6a363ac2f4a371b5fbe9d07ab9e79","fileHeader":{"id":"","immediateDestination":"011600062","immediateOrigin":"N833219776","fileCreationDate":"210518","fileCreationTime":"2246","fileIDModifier":"A","immediateDestinationName":"SAMPLE BANK TWO","immediateOriginName":"KRAB PAYROLL SERVICES","referenceCode":"00000000"},
I see the issue. Without a header I'm unable to get a file created, even with those query parameters. I'll open a fix.
Thanks for the quick response @adamdecaf !
I've updated https://github.com/moov-io/ach/pull/1379 with a fix. Surprised this has lasted so long.
Awesome, thank you so much! I'll keep an eye out for a new release
It's working for me, thanks!
ACH Version
1.34.2
What were you trying to do?
I am attempting to handle support for a system where both properly-formatted ACH files, and custom return files that are missing file headers/controls are being processed.
I added the
allowMissingFileHeader=true
to the request params and attempted to process both types of filesWhat did you expect to see?
I expected to see a success response for both files, bypassing the missing file header/control in the latter.
What did you see?
Instead, I received 500 errors for both the valid and the invalid files. I certainly expected the valid file to still work correctly, but having the invalid file not work causes issues for me.
Successful response with valid file (all data is mocked)![image](https://github.com/moov-io/ach/assets/42551883/863bd00c-df8b-471d-8306-f38c07acbd41)
Error response with invalid file (all data is mocked)![image](https://github.com/moov-io/ach/assets/42551883/c7af8da1-c644-460d-b55f-033666294a77)
How can we reproduce the problem?
localhost:8080/files/create?bypassDestination=true&bypassOrigin=true&customTraceNumbers=true&bypassCompanyIdentificationMatch=true&allowInvalidAmounts=true&allowMissingFileControl=true&allowMissingFileHeader=true