#DanTheGoodman

1 messages ยท Page 1 of 1 (latest)

vagrant sableBOT
static galleon
#

I found a bug from copy paste ๐Ÿ˜ฆ

#

XD sorry!

#

OK wait no bug

drowsy crystal
#

?

static galleon
#

wait maybe.... let me test lol

#

the format was really strange, like it was grabbing random crap from memory. But I was reusing one from another request that had a still different format than what I see in the log

static galleon
#

ok so I think i fixed the issue with the idempotency key, but now because I had to do some reversals it now says we don't have the stripe funds to payout a connect account even though I see we do

drowsy crystal
#

Great to hear. Happy to be a rubber ๐Ÿฆ†

static galleon
#

{"level":"error","reqID":"f85a910b-2475-4450-867c-bfc3a8d321dc","userID":"user_2C1kOTDZ8OQvpyaBzdwUgcGRDtl","user_id":"user_2C1kOTDZ8OQvpyaBzdwUgcGRDtl","error":"error sending stripe payout: {\"code\":\"balance_insufficient\",\"doc_url\":\"https://stripe.com/docs/error-codes/balance-insufficient\",\"status\":400,\"message\":\"You have insufficient funds in your Stripe account for this transfer. Your card balance is too low. You can use the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance).\",\"request_id\":\"req_gd1WeNe4ON2FYo\",\"type\":\"invalid_request_error\"}","time":"2022-10-10T17:09:57.944265678Z","caller":"/app/http_server/admin.go:315 http_server.(*HTTPServer).SetPayoutState()","message":"error sending payout"}

#

this is the error we get back, how long until we get funds available if we instantly reversed something?

frail goblet
#

๐Ÿ‘‹ stepping in as Snufkin needs to step away

static galleon
#

I can get a few requests

#
/v1/transfers/tr_1LrP06CyQAg6NyoScFsJOhsz/reversals
12:44:55 PM
200 OK
POST    
/v1/transfers/tr_1LrOzzCyQAg6NyoSkpTOexSv/reversals
12:44:39 PM
200 OK
POST    
/v1/transfers/tr_1LrP02CyQAg6NyoSpdYyfQbQ/reversals
12:44:23 PM
200 OK
POST    
/v1/transfers/tr_1LrP09CyQAg6NyoS0sDRazmW/reversals
12:43:51 PM
200 OK
POST    
/v1/transfers/tr_1LrP0CCyQAg6NyoSHp61fgi3/reversals
12:43:32 PM
200 OK
POST    
/v1/transfers/tr_1LrP0GCyQAg6NyoSYWVw36q1/reversals
12:43:18 PM
200 OK
POST    
/v1/transfers/tr_1LrP0WCyQAg6NyoSR1HXWGT2/reversals
12:42:55 PM
200 OK
POST    
/v1/transfers/tr_1LrP0ZCyQAg6NyoScdF00Q7Y/reversals```
frail goblet
#

That request in that error is using an idempotency key from a previous request

#

So it is just replaying

#

Can you make a new request with new idempotency key?

static galleon
#

well the issue is not that, the issue is that the first one errors with that we dont have sufficient funds, so our retry loops because it doesn't know about that error

frail goblet
#

Ah okay so you are asking about the original error?

#

Let me look at one of the transfers

#

So you are reversing these transfers then attempting to create a payout, correct?

#

Looks to me like the reversals come after the payout attempt which errors for NSF?

static galleon
#

so what happened basically is I screwed up the idempotency key for the transfer, so when we got an error it retried a bunch without the key and made a ton of duplicate transfers

#

so we then reversed all of them, BUT now stripe says we dont have enough funds to send transfer, which is now causing the transfer request to retry-loop again but now we have a fixed idempotency key so it's fine that they loop

#

even thouhg it was a 200? I can try it again

#

acct_1LnqTU2SXRMH603P

#

here is one account specifically

frail goblet
static galleon
#

im going to do another one real quick

#

haha ok well now they are all failing becuase I've used the key before ๐Ÿ˜› since they key is tied to the payout

#

also. Idon't see the logs for the payouts or account updates.. only the transfer requests which is weird

#

I see this, but my code does a account update, payout, then transfer each time. Not just a transfer

frail goblet
#

You are only seeing your platform's logs

#

Click the "More" button

#

And select "Outgoing Connect requests" as well

#

Then you should see all of them

static galleon
#

oh ๐Ÿ™‚

#

you can see it says insufficient funds

#

I just did someone for like $4 a few min ago to test

frail goblet
#

That is a filter which I can't view

#

Just fyi

static galleon
#

that went through, but I've got way more than that request to payout

#

sorry sec

#

whiffed the copy ๐Ÿ™‚

frail goblet
#

No worries

#

Are you sure that is the right ID? That is another 400 due to an idempotent replay

static galleon
#

mmm so I'm guessing the issue is then that it's replaying the response from the original request, which probably happened after they all looped and we had nothing in the account (before we reversed)

frail goblet
#

Yep

static galleon
#

I guess the easiest thing is to manually do all these lol

#

I don't want to change to the code to ignore idempotency keys

frail goblet
#

I'm still unclear exactly what you are trying to do.

#

But sounds like you need a new script here imo

static galleon
#

pay out people from my internal dashboard, but a idempotency error made it spin a bunch and then one of my highly sophisticated teammates decided to keep pressing buttons even though errors were throwing ๐Ÿ˜›

frail goblet
#

lol

static galleon
#

including after I fixed the keys but before the transfers were reversed

#

so now all the good idempotency keys are stuck with insufficient fund responses

frail goblet
#

The other option is to wait 24 hours for the idempotency keys to expire

static galleon
#

eh it will only take me a few min to handle, but thanks for the help sorting it XD

frail goblet
#

Sounds good

#

Let me know if I can help any further!

static galleon
#

I think im all good now but thanks!