urllib.error.URLError: <urlopen error [WinError 10061] No connection could be made because the target machine actively refused it>

I have this error when trying to transfer funds. How can i solve this error.

def create_transaction():
    #params = algod_client.suggested_params()
    # proxy_handler = urllib3.ProxyHandler({})
    # opener = urllib3.build_opener(proxy_handler)
    # urllib3.install_opener(opener)
    
    form = TransferForm(request.form)
    if request.method == 'POST' and form.validate():
        sender = form.sender.data
        receiver = form.receiver.data
        amount = (form.amount.data)

    # Debugging
        params = algod_client.suggested_params()
        params.flat_fee = True
        params.fee = 1000
        print(params, params.fee)
        unsigned_txn = PaymentTxn(sender,  params, receiver,  amount, None)
        #return unsigned_txn
    # End

        
        try:
            signed_txn = unsigned_txn.sign(mnemonic.to_private_key(session['passphrase']))
            #Commitprint(signed_txn)

        except WrongChecksumError:
            return {"passphrase": "Checksum error"}
        except ValueError:
            return {"passphrase": "unknown word in the passphrase"}
        except WrongMnemonicLengthError: 
            return {"passphrase": "Incorrect size of the passprase"}
 
        transaction_id = algod_client.send_transaction(signed_txn)
        print(transaction_id)

        return transaction_id

Can you show how you created algod_client (replace any secret tokens by something else)?
Most likely the URL used to construct algod_client is incorrect or you are trying to connect to your own node that is not running.

Which tutorial were you following? (post the exact URL)
Many tutorials assume you are running sandbox: Set up your development environment - Algorand Developer Portal

1 Like

Someone knows for solving this error, what should i do?
When I run the code show me this error.

1 Like