algosdk.error.AlgodHTTPError: {"message":"TransactionPool.Remember: transactionGroup: incomplete group

Hey guys!

I’m having an error when sending multiple transactions. I’ve done it before using templates, so I’m not really sure why it isn’t working. Here is my source code:

arg1 = (0).to_bytes(8, 'big')
lsig = LogicSig(logic2, [arg1])
params.fee = 2000
txn1 = PaymentTxn(address, params, address, 1000)
params.fee = 0
txn2 = AssetTransferTxn(esc_addr, params, esc_addr, 0, asset_id, close_assets_to="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ", rekey_to="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ")

g_id = calculate_group_id([txn1, txn2])
txn1.group = g_id
txn2.group = g_id
stxn1 = txn1.sign(key)
stxn2 = LogicSigTransaction(txn2, lsig)
print(stxn2.verify())
signed_group = [stxn1, stxn2]
txid = cl.send_transactions(signed_group)
wait_for_confirmation(cl, txid)

This prints “True”, so I know that the logic for the second txn is solid. Similarly, I’ve tripled-checked the signature for the PaymentTxn is valid as well. I copied as directly from the atomic transfer example here as I could. Any suggestions?

This appears to be an issue with the network involving atomic transfers that include LogicSigTransactions. There is an open ticket with a similar issue in the js-algorand-sdk here. I will create a ticket for the py-algorand-sdk package.

I figured it out! It seems the error message was completely unrelated to the issue.

The problem is in the line

txn2 = AssetTransferTxn(esc_addr, params, esc_addr, 0, asset_id, close_assets_to="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ", rekey_to="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ")

It works properly when changed to

txn2 = AssetTransferTxn(esc_addr, params, esc_addr, 0, asset_id)

I have no idea why :man_shrugging:. Maybe the error code should be updated?
I get the same error code when I assign a group id to a transaction and try to send it on its own…