BitShares Forum

Main => General Discussion => Topic started by: bytemaster on September 15, 2014, 01:48:53 pm

Title: "insufficient funds" Help Thread
Post by: bytemaster on September 15, 2014, 01:48:53 pm
This thread is dedicated to tracking down the bugs people have reported with insufficient funds for transfer. 

After looking over the code it appears that the most likely candidate is a pending transaction that is holding up funds.   If you are unable to transfer funds please post the following:

First for BTSX:
1) Output of "balance" command
2) Output of "wallet_transfer" command.
3) Attempt to "vote" and report the balance after voting as well as the vote transaction.

For BitAssets:
1) Does the account you are sending form have BTSX (to pay fees)

Lastly what does this report?
blockchain_list_pending_transactions

If you don't want to reveal your balance you may scale all values by the *SAME* constant amount.
Title: Re: "insufficient funds" Help Thread
Post by: Xeldal on September 15, 2014, 02:24:33 pm
Code: [Select]
>> balance

ACCOUNT                         BALANCE                     
============================================================
     
xeldal                        21,935.10245 BTSX       
                                8,074.7998 USD             
                                10. STAR                   

Code: [Select]
>> wallet_transfer 8000 USD xeldal xeldal2

20010 insufficient_funds: insufficient funds

    {"required":"8,000.0000 USD","available":"0.0000 USD"}
    bitshares  wallet.cpp:474 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"amount_to_withdraw":{"amount":80000000,"asset_id":22},"from_account_address":"BTSX9XfcNGwAEvFehn2pRDZDSwQPBFNpEXqNJ","trx":{"expiration":"19700101T000000","delegate_slate_id":null,"operations":[],"signatures":[]},"required_signatures":[]}
    bitshares  wallet.cpp:475 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"real_amount_to_transfer":8000,"amount_to_transfer_symbol":"USD","paying_account_name":"xeldal","from_account_name":"xeldal","to_account_name":"xeldal2","memo_message":""}
    bitshares  wallet.cpp:4065 bts::wallet::wallet::transfer_asset

    {}
    bitshares  common_api_client.cpp:1043 bts::rpc_stubs::common_api_client::wallet_transfer

    {"command":"wallet_transfer"}
    bitshares  cli.cpp:555 bts::cli::detail::cli_impl::execute_command

I attempted to vote and got the error "insufficient funds"

Code: [Select]
>> wallet_transfer 20000 BTSX xeldal xeldal

20010 insufficient_funds: insufficient funds

    {"required":"20,000.50000 BTSX","available":"1,935.08565 BTSX"}
    bitshares  wallet.cpp:474 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"amount_to_withdraw":{"amount":2000050000,"asset_id":0},"from_account_address":"BTSX9XfcNGwAEvFehn2pRDZDSwQPBFNpEXqNJ","trx":{"expiration":"19700101T000000","delegate_slate_id":null,"operations":[{"type":"withdraw_op_type","data":{"balance_id":"BTSXDCfSB6E9LvaiZg45FcLeyXDnLrYKUMjtL","amount":19350856597,"claim_input_data":""}}],"signatures":[]},"required_signatures":["BTSXHyAnXKCDC9eyfV4yqNXfSr1EH3UW3Ukeb"]}
    bitshares  wallet.cpp:475 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"real_amount_to_transfer":20000,"amount_to_transfer_symbol":"BTSX","paying_account_name":"xeldal","from_account_name":"xeldal","to_account_name":"xeldal","memo_message":""}
    bitshares  wallet.cpp:4065 bts::wallet::wallet::transfer_asset

    {}
    bitshares  common_api_client.cpp:1043 bts::rpc_stubs::common_api_client::wallet_transfer

    {"command":"wallet_transfer"}

Code: [Select]
>> blockchain_list_pending_transactions

No pending transactions.


Title: Re: "insufficient funds" Help Thread
Post by: yvg1900 on September 16, 2014, 06:12:36 am
Same here:

a) Account created by importing keyhotee founder ID (using brain wallet key)
b) PTS and AGS balances imported manually, each private key separately
c) Keyhotee founder ID reward NOT claimed

Code: [Select]
>> blockchain_list_pending_transactions

No pending transactions.

Code: [Select]
>> balance

ACCOUNT                         BALANCE                     
============================================================
yvg1900                         2,586.15334 BTSX      (scaled, definitely more than 2000)

Code: [Select]
>> wallet_transfer 10 BTSX yvg1900 delegate.yvg1900

20010 insufficient_funds: insufficient funds

    {"required":"10.50000 BTSX","available":"0.00000 BTSX"}
    bitshares  wallet.cpp:474 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"amount_to_withdraw":{"amount":1050000,"asset_id":0},"from_account_address":"BTSXFBJiZnJVHSteKTPQo3826o2CDFE3NmNZ5","trx":{"expiration":"19700101T000000","delegate_slate_id":null,"operations":[],"signatures":[]},"required_signatures":[]}
    bitshares  wallet.cpp:475 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"real_amount_to_transfer":10,"amount_to_transfer_symbol":"BTSX","paying_account_name":"yvg1900","from_account_name":"yvg1900","to_account_name":"delegate.yvg1900","memo_message":""}
    bitshares  wallet.cpp:4065 bts::wallet::wallet::transfer_asset

    {}
    bitshares  common_api_client.cpp:1043 bts::rpc_stubs::common_api_client::wallet_transfer

    {"command":"wallet_transfer"}
    bitshares  cli.cpp:555 bts::cli::detail::cli_impl::execute_command

Code: [Select]
>> wallet_account_register delegate.yvg1900 yvg1900

20010 insufficient_funds: insufficient funds

    {"required":"0.50000 BTSX","available":"0.00000 BTSX"}
    bitshares  wallet.cpp:474 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"amount_to_withdraw":{"amount":50000,"asset_id":0},"from_account_address":"BTSXFBJiZnJVHSteKTPQo3826o2CDFE3NmNZ5","trx":{"expiration":"19700101T000000","delegate_slate_id":null,"operations":[{"type":"register_account_op_type","data":{"name":"delegate.yvg1900","public_data":null,"owner_key":"BTSX7UcvxMxc2NyyneLsf8iimihXWBbAQbwmDRKCjp6LF2pkATXm6F","active_key":"BTSX7UcvxMxc2NyyneLsf8iimihXWBbAQbwmDRKCjp6LF2pkATXm6F","delegate_pay_rate":255,"meta_data":null}}],"signatures":[]},"required_signatures":["BTSXFBJiZnJVHSteKTPQo3826o2CDFE3NmNZ5"]}
    bitshares  wallet.cpp:475 bts::wallet::detail::wallet_impl::withdraw_to_transaction

    {"account_to_register":"delegate.yvg1900","public_data":null,"pay_with_account_name":"yvg1900","delegate_pay_rate":255}
    bitshares  wallet.cpp:4145 bts::wallet::wallet::register_account

    {"account_name":"delegate.yvg1900","data":null}
    bitshares  client.cpp:3205 bts::client::detail::client_impl::wallet_account_register

    {}
    bitshares  common_api_client.cpp:1139 bts::rpc_stubs::common_api_client::wallet_account_register

    {"command":"wallet_account_register"}
    bitshares  cli.cpp:555 bts::cli::detail::cli_impl::execute_command

Any ideas how I can help tracking this issue down?

yvg1900
Title: Re: "insufficient funds" Help Thread
Post by: bytemaster on September 16, 2014, 09:07:00 pm
I have reproduced the issue and have a fix underway.
Title: Re: "insufficient funds" Help Thread
Post by: Xeldal on September 16, 2014, 09:48:53 pm
I have reproduced the issue and have a fix underway.

 +5% Fantastic!  :'( :'(
Title: Re: "insufficient funds" Help Thread
Post by: Xeldal on September 22, 2014, 08:59:41 pm
I have reproduced the issue and have a fix underway.

No fix yet? 

Using 0.4.16

still can't sell my bitUSD.  Error insufficient funds.
Cannot transfer or vote .  Error insufficient funds.


Title: Re: "insufficient funds" Help Thread
Post by: vikram on September 22, 2014, 11:19:13 pm
I have reproduced the issue and have a fix underway.

No fix yet? 

Using 0.4.16

still can't sell my bitUSD.  Error insufficient funds.
Cannot transfer or vote .  Error insufficient funds.

Your error messages are strange I am looking into this. Are you still having other problems with missing balances? I remember your other thread where you said you were missing balances.
Title: Re: "insufficient funds" Help Thread
Post by: Xeldal on September 22, 2014, 11:41:57 pm
The balances shown on the Accounts page seem correct and match the output from wallet_account_balance.  However, none of my accounts show any transaction history anymore so the balance in these sections is not showing .  so i can't say whether missing or not.

Although the balances shown seem correct I'm still not able to do anything with them.  I can't send or sell my USD balance.  I can't transfer my BTSX balance.

The insufficient funds error reports that I have "available" 0 USD and much less BTSX then is shown under wallet_account_balance

The error message is much longer this version but reports the same "available" balance as my first post this thread. (which is incorrect)
https://bitsharestalk.org/index.php?topic=8935.msg115841#msg115841

Title: Re: "insufficient funds" Help Thread
Post by: vikram on September 23, 2014, 03:31:23 pm
The balances shown on the Accounts page seem correct and match the output from wallet_account_balance.  However, none of my accounts show any transaction history anymore so the balance in these sections is not showing .  so i can't say whether missing or not.

Although the balances shown seem correct I'm still not able to do anything with them.  I can't send or sell my USD balance.  I can't transfer my BTSX balance.

The insufficient funds error reports that I have "available" 0 USD and much less BTSX then is shown under wallet_account_balance

The error message is much longer this version but reports the same "available" balance as my first post this thread. (which is incorrect)
https://bitsharestalk.org/index.php?topic=8935.msg115841#msg115841

If the output of wallet_account_balance is indeed correct, then I have a possible fix that will be in the next version: https://github.com/BitShares/bitshares_toolkit/commit/fd02b4ec808e16d69f2ab3d4752efd2a3589d8db
Title: Re: "insufficient funds" Help Thread
Post by: pendragon3 on September 23, 2014, 03:55:41 pm
I don't think its safe to assume wallet_account_balance in the console is correct. In fact, it's almost surely wrong in some cases.

Recently, I installed 0.4.16 32-bit, and after importing a backup wallet, my BTSX and BitUSD balances disappeared. Also, a lot of the recent transactions are now to "UNKNOWN", and some of the transaction history after about a week ago is missing altogether. Regenerating keys, rescanning, etc. did not help.

The console command for wallet transactions history does seems to give the correct ending balance of xxx,000 BTSX. But both the GUI and the console command wallet_account_balance incorrectly display 0.00 BTSX.
Title: Re: "insufficient funds" Help Thread
Post by: Xeldal on September 23, 2014, 04:07:44 pm
I don't think its safe to assume wallet_account_balance in the console is correct. In fact, it's almost surely wrong in some cases.

Recently, I installed 0.4.16 32-bit, and after importing a backup wallet, my BTSX and BitUSD balances disappeared. Also, a lot of the recent transactions are now to "UNKNOWN", and some of the transaction history after about a week ago is missing altogether. Regenerating keys, rescanning, etc. did not help.

The console command for wallet transactions history does seems to give the correct ending balance of xxx,000 BTSX. But both the GUI and the console command wallet_account_balance incorrectly display 0.00 BTSX.

I agree.  I just installed a fresh copy, imported via private key, regenerated keys, rescaned, and the balance from wallet_account_balance was way off or missing entirely from what I get if I import from a backup and do the exact same process.
Title: Re: "insufficient funds" Help Thread
Post by: modprobe on September 23, 2014, 08:10:14 pm
I don't think its safe to assume wallet_account_balance in the console is correct. In fact, it's almost surely wrong in some cases.

Recently, I installed 0.4.16 32-bit, and after importing a backup wallet, my BTSX and BitUSD balances disappeared. Also, a lot of the recent transactions are now to "UNKNOWN", and some of the transaction history after about a week ago is missing altogether. Regenerating keys, rescanning, etc. did not help.

The console command for wallet transactions history does seems to give the correct ending balance of xxx,000 BTSX. But both the GUI and the console command wallet_account_balance incorrectly display 0.00 BTSX.

I agree.  I just installed a fresh copy, imported via private key, regenerated keys, rescaned, and the balance from wallet_account_balance was way off or missing entirely from what I get if I import from a backup and do the exact same process.

Yes, this is expected behavior. Do not delete your wallet! There is more private data that needs to be kept in order to claim all of your balances than just the account private keys. Primarily, you need the wallet master private key, from which you can regenerate pretty much everything if necessary (though this should be done in emergencies only). If you just create a new wallet and import your account keys, you will not get all of your balances. If you've kept your original wallet, you should have everything you need.

The insufficient funds error you're seeing is hopefully fixed in https://github.com/BitShares/bitshares_toolkit/commit/fd02b4ec808e16d69f2ab3d4752efd2a3589d8db -- when the next version of BTSX is released, try transferring your balances and see if you still get this issue.
Title: Re: "insufficient funds" Help Thread
Post by: Xeldal on September 25, 2014, 01:08:38 pm
The insufficient funds error you're seeing is hopefully fixed in https://github.com/BitShares/bitshares_toolkit/commit/fd02b4ec808e16d69f2ab3d4752efd2a3589d8db -- when the next version of BTSX is released, try transferring your balances and see if you still get this issue.

0.4.17 has fixed the issue with my BTSX insufficient funds error.  However, I still can't sell my bitUSD. 

wallet_account_balance still shows a balance but I continue to get insufficient funds error when trying to sell.
When I enter manually in console I get the following error regardless of how its entered. (I think its a known issue that the syntax requirement here doesn't make any sense)

Code: [Select]
>> wallet_market_submit_ask xeldal 10 USD .030778 BTSX

37001 invalid_market: invalid market

    {"quote_asset_id":0,"base_asset_id":22}
    bitshares  chain_database.cpp:2568 bts::blockchain::chain_database::get_market_bids

    {"quote_symbol":"BTSX","base_symbol":"USD","limit":1}
    bitshares  chain_database.cpp:2589 bts::blockchain::chain_database::get_market_bids

    {}
    bitshares  common_api_client.cpp:1523 bts::rpc_stubs::common_api_client::wallet_market_submit_ask

    {"command":"wallet_market_submit_ask"}
    bitshares  cli.cpp:556 bts::cli::detail::cli_impl::execute_command


>> wallet_market_submit_ask xeldal 10 USD .030778 USD

37001 invalid_market: invalid market

    {"quote_asset_id":22,"base_asset_id":22}
    bitshares  chain_database.cpp:2568 bts::blockchain::chain_database::get_market_bids

    {"quote_symbol":"USD","base_symbol":"USD","limit":1}
    bitshares  chain_database.cpp:2589 bts::blockchain::chain_database::get_market_bids

    {}
    bitshares  common_api_client.cpp:1523 bts::rpc_stubs::common_api_client::wallet_market_submit_ask

    {"command":"wallet_market_submit_ask"}
    bitshares  cli.cpp:556 bts::cli::detail::cli_impl::execute_command


>> wallet_market_submit_ask xeldal 10 USD 32.49 BTSX

37001 invalid_market: invalid market

    {"quote_asset_id":0,"base_asset_id":22}
    bitshares  chain_database.cpp:2568 bts::blockchain::chain_database::get_market_bids

    {"quote_symbol":"BTSX","base_symbol":"USD","limit":1}
    bitshares  chain_database.cpp:2589 bts::blockchain::chain_database::get_market_bids

    {}
    bitshares  common_api_client.cpp:1523 bts::rpc_stubs::common_api_client::wallet_market_submit_ask

    {"command":"wallet_market_submit_ask"}
    bitshares  cli.cpp:556 bts::cli::detail::cli_impl::execute_command

Oddly I am able to transfer the USD from this account to another and that seems to work fine.

But the new account is not able to sell the USD either.
Title: Re: "insufficient funds" Help Thread
Post by: xeroc on September 25, 2014, 01:23:19 pm
Quote
>> wallet_market_submit_ask xeldal 10 USD .030778 BTSX
Not sure about the syntax but I thing that is the wrong way to go .. because it says: "invalid market" .. can't help you though .. couldn't make my head up for how to use ask/bid quote/base :(
Title: Re: "insufficient funds" Help Thread
Post by: Xeldal on September 25, 2014, 01:40:40 pm
Your right.  I had the wrong bit backwards.  Hard to keep track of which things need to be backwards and where.

So, this worked in windowGUI console to SELL USD

Code: [Select]
>> wallet_market_submit_bid xeldal 100 BTSX .03077 USD

TIMESTAMP           BLOCK     FROM                TO                  AMOUNT                  MEMO                                        FEE                 ID     
======================================================================================================================================================================
2014-09-25T13:33:21 PENDING   xeldal              BID-3ec11803        3.0770 USD              buy BTSX @ 0.03077 USD / BTSX               0.0457 USD          9966f1f1


Ok so since this worked I tryed again with the GUI MARKET.  It always fails to execute if I tell it to sell my entire balance, but if I reduce the amount by .50 cents it goes through.

Good enough for me. 8)

EDIT: strange gets stranger.  I reduced the max balance order by .50 cents and now I have $1.6461 left.  Lol
Also the "Quantity" and "Cost" fields listed under "Open Orders" are incorrect.  ... And they sold. I wasn't able to get a screen shot. I like the liquidity so far at least!!  :)
Title: Re: "insufficient funds" Help Thread
Post by: bytemaster on September 25, 2014, 03:39:07 pm
Your right.  I had the wrong bit backwards.  Hard to keep track of which things need to be backwards and where.

So, this worked in windowGUI console to SELL USD

Code: [Select]
>> wallet_market_submit_bid xeldal 100 BTSX .03077 USD

TIMESTAMP           BLOCK     FROM                TO                  AMOUNT                  MEMO                                        FEE                 ID     
======================================================================================================================================================================
2014-09-25T13:33:21 PENDING   xeldal              BID-3ec11803        3.0770 USD              buy BTSX @ 0.03077 USD / BTSX               0.0457 USD          9966f1f1


Ok so since this worked I tryed again with the GUI MARKET.  It always fails to execute if I tell it to sell my entire balance, but if I reduce the amount by .50 cents it goes through.

Good enough for me. 8)

EDIT: strange gets stranger.  I reduced the max balance order by .50 cents and now I have $1.6461 left.  Lol
Also the "Quantity" and "Cost" fields listed under "Open Orders" are incorrect.  ... And they sold. I wasn't able to get a screen shot. I like the liquidity so far at least!!  :)

Probably your yield for holding USD.
Title: Re: "insufficient funds" Help Thread
Post by: xeroc on September 25, 2014, 03:42:15 pm
I also figured out today that transactionsfees for usd transfers are paid in usd already .. Just dont know how the amount is determined
Title: Re: "insufficient funds" Help Thread
Post by: bytemaster on September 25, 2014, 03:44:10 pm
I also figured out today that transactionsfees for usd transfers are paid in usd already .. Just dont know how the amount is determined

It is a multiple of BTSX fee converted to USD at the price feed.
Title: Re: "insufficient funds" Help Thread
Post by: edilliam on October 16, 2014, 06:39:44 pm
Sorry to drag this thread back up, but I'm getting a similar "insufficient funds" issue and perhaps it's related.

"client_version": "v0.4.20"

When attempting to add a sell BitBTC order, if I own 1.12345678 BitBTC and I attempt to create a sell order for that exact amount I get the "insufficient funds" error. Trying 1.1234567, 1.123456, 1.12345 and 1.1234 had the same error. However, if I try to create a sell order for 1.123 it goes through fine.

Is there maybe some data stored somewhere that is a reference to a users balance that only goes to 3 decimal points and is therefore making the system think that users have slightly less funds than they really have? Although, looking at the order book there are several orders that are for amounts with more than 3 decimal points. Perhaps these orders were put through with different versions of the client? Or perhaps this issue is unique to me?



Title: Re: "insufficient funds" Help Thread
Post by: vikram on October 16, 2014, 06:44:05 pm
Sorry to drag this thread back up, but I'm getting a similar "insufficient funds" issue and perhaps it's related.

"client_version": "v0.4.20"

When attempting to add a sell BitBTC order, if I own 1.12345678 BitBTC and I attempt to create a sell order for that exact amount I get the "insufficient funds" error. Trying 1.1234567, 1.123456, 1.12345 and 1.1234 had the same error. However, if I try to create a sell order for 1.123 it goes through fine.

Is there maybe some data stored somewhere that is a reference to a users balance that only goes to 3 decimal points and is therefore making the system think that users have slightly less funds than they really have? Although, looking at the order book there are several orders that are for amounts with more than 3 decimal points. Perhaps these orders were put through with different versions of the client? Or perhaps this issue is unique to me?

This is likely due to the rounding issue discussed in this thread: https://bitsharestalk.org/index.php?topic=9748.msg129175#msg129175