Transaction simulation failed: Attempt to debit an account but found no record of a prior credit
{'code': -32002, 'message': 'Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.', 'data': {'accounts': None, 'err': 'AccountNotFound', 'logs': []}}
Getting this error, but there is SOL in the account. Thoughts?
Are you able to provide the transaction instructions? Without it, this is your best bet. Happens when you try to move all sol, without leaving some dust for the fees. https://www.reddit.com/r/solana/comments/p0qhpi/transfer_sol_from_staking_account_to_wallet/
Yeah you need to keep a minimal amount of SOL in your main wallet account, I don't think there is a way around this.
I had the same problem. In my case the error was sending the transaction to 'mainnet-beta' instead of 'devnet'.
I am trying to upload images on candymachine however I keep getting the error "Translating error SendTransactionError: failed to send transaction: Transaction simulation failed: Attempt to debit an account but found no record of a prior credit." despite having over 5 sol in my wallet? Mainnet-beta
Did anyone found any solution to this problem ?
I'm having the same issue. It's intermittent and I most definitely have SOL in the account. In fact, sometimes I can just skip the preflight check and it works. Other times I can't get a single dang txn thru
Exact same problem on local test-validator. I had exhausted all options, so I just sat there and retried it over and over and eventually it went through. Pretty dumb, but might shed some light on this?
Could it be it doesn't like some Keypairs? (being generated every time)
I don't think it's related to your keypairs. I'm using the same keypair each time and it'll puke thousands of times in a row with this error and then all of a sudden be happy. I'm rotating various paid RPC nodes.... no help
same story here, local test-validator endless waiting for processing...
I'm having the same issue... Trying to put in a limit order on mango mainnet, I am able to do it via the website, but whenever I try to do it via the python API I end up with:
client.TransactionException: « TransactionException in 'Mango Explorer' [sendTransaction]: -32002:: Transaction failed with: 'Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.'
But here is an interesting thing..
this is my order:
Placing order: « Order 📌 BUY 0.10000000 at 0.10000000 [ID: 0 / 6969] LIMIT » (so I never expect it to fullfil, I just want to see it placed). But in the output, just below the above error line, I see this:
« Mango Instruction: PlaceSpotOrder2: side: BUY, order_type: LIMIT, limit_price: 100, max_base_quantity: 1, max_quote_quantity: 10000, client_id: 6969, self_trade_behavior: DECREMENT_TAKE, limit: 65535
What is this 'limit_price: 100' ??? Where is this coming from ? Is it trying to order 100, when I told it to order 0.1 ? It's referring to the same client_id I provided, so this LOOKS like it's supposed to be my order, but I see neither my limit price nor my size?
Any ideas? Thanks!
Same problem as @scottwilson312 and @HarryneZoumi on devnet. Anyone managed to get any further on this issue?
What is really strange is that after re-sending the same tx several times it succeeds. In my case the tx is composed of 2 sets of instructions, where the first one is used to create an account and the second one calls a smart contract that interacts with the newly created account. Somehow I am suspecting that the "Attempt to debit an account but found no record of a prior credit" error refers to the newly created account, but I am not entirely sure (even when setting skip preflight to true the error says "Simulating transaction failed" so I can not inspect the logs to see exactly at which part it failed).
This appears to be API related; I was attempting to do this via the Python API; when I posted a support question on the Mango discord, I was told that Python wasn't supported anymore, since the person maintaining the code base was no longer there.
After I switched to using the Javascript connectivity library, this problem went away, using the same account, same wallet. So it wasn't an account/wallet problem for me...
I have the same problem: some of transactions go through, others return this error.
I found out what was the problem in my case: I had two signers (one of them was newly generated keypair) in my transaction. The solution was to enter fee payer's public key as a parameter while creating Transaction object.
This is not so obvious because of this phrase in documentation of Transaction's sign method:
Multiple signatures may be applied to a Transaction. The first signature is considered "primary" and is used when testing for Transaction confirmation.
However the order of signers given to that method has no effect at which keypair is considered to be fee payer.
Thank you so much @WhatsWithAlex! Your solution fixed my issue as well.
@WhatsWithAlex @QuanticCapital are you saying that one needs to specify the fee_payer of a Transaction or it doesn't work? Like should we just require that transasctions have a fee_payer?
I had to specify fee_payer to reliably send the create_account transaction (the other signing keypair is the one associated with newly created account and, therefore, can not be the payer). However, I am not sure requiring the fee_payer parameter is the desired approach in all the cases. Perhaps the fee_payer could be automatically set to the first signing keypair, but the user could override it if necessary?