Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroying deployment failed #216

Closed
archit3kt opened this issue May 3, 2022 · 4 comments
Closed

Destroying deployment failed #216

archit3kt opened this issue May 3, 2022 · 4 comments
Assignees
Labels
type_bug Something isn't working

Comments

@archit3kt
Copy link

Hi there,

I tried to destoy my deployment on testnet (standard 2 vCPU 4 Go RAM VM and wireguard access) with terraform grid plugin 0.1.27

It failed once with the following error

grid_deployment.selfHosting: Destroying... [id=4263]
╷
│ Error: account contains 500, min fee is 20000
│ 

So I transfered 0.1 TFT to the test account and launch the destroy process again (by the way, would be nice to stop the deployment when there is still enough funds to properly destroy the contract...). It failed again with the following error :

grid_deployment.selfHosting: Destroying... [id=4263]
╷
│ Error: failed to delete deployment: ContractNotExists
│ 
│ 
╵

I still see a 15 GB MRU Reserved on my node (but no CRU strangely...) and 100 GB reserved for a SSD, so I think the deletion was not properly done. Any help on the matter please ?

@OmarElawady
Copy link
Contributor

Once the account has no money, the contracts gets deleted. After they get deleted, they get zeroed in the chain and that's why it says that the contract doesn't exist. But the deployment contract and the vm should be deleted. And what is the node id the deployment was on? The node reserves max(10%, 2GB) of the memory for itself, this may explain the usage reported by it.

Contracts that doesn't exist should get cleaned up (done in other resources but missing in the deployment resource).

To ensure that other resources (like the network) is deleted. You can specity --target resource_network.net1 in the delete command after removing the deployment from terraform.tfstate (or deleting the contracts in terraform.tfstate directly from polkadot)

@OmarElawady OmarElawady added the type_bug Something isn't working label May 8, 2022
@archit3kt
Copy link
Author

I removed the deployment from the terraform.tfstate then issued a terraform destroy, getting rid of the network successfully.

IMHO the network should get deleted as well when the user do not get anymore funds

@OmarElawady
Copy link
Contributor

The network is by default billed on the traffic not on its existence. So if a network is not attached to any deployment, it doesn't get billed. The contract deletion happens only for contracts that get billed. An issue is open to propose charging a small fee for networks so people would be encouraged to clean up unused contracts, and should ensure that all contracts are removed in case the user goes out of fund
threefoldtech/tfchain#292

@OmarElawady
Copy link
Contributor

Fixed in #236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type_bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants