I created a new canister in a dedicated subnet with a specific amount of cycles, but the process failed.
dfx canister create backend --subnet shefu-t3kr5-t5q3w-mqmdq-jabyv-vyvtf-cyyey-3kmo4-toyln-emubw-4qe --with-cycles 1T --ic
Creating canister backend…
created-at-time for canister backend is 1726416134008722000.
Error: Failed to create canister ‘backend’.
Caused by: Failed to create canister via cycles ledger.
Caused by: The replica returned an HTTP Error: Http Error: status 400 Bad Request, content type “text/plain; charset=utf-8”, content: Specified ingress_expiry not within expected range: Minimum allowed expiry: 2024-09-15 16:00:14.079120981 UTC, Maximum allowed expiry: 2024-09-15 16:05:44.079120981 UTC, Provided expiry: 2024-09-15 16:06:00 UTC
After that, I have 1T fewer cycles in the cycles ledger, and the canister is not created.”
from my understanding you should have received the remaining cycles back after you deleted the canister on the wrong subnet.
to me it seems that “just” the deployment (of 2 different canisters?) on the specified subnet failed for you.
I am not sure what the term “soon enough” means. from what the Kapa AI tells me it should be around 24 hours. if my understanding is correct, you should run the following command again as soon as possible to secure the cycles given your example above:
the --created-at-time value should reflect what the dfx logs printed out. so in case of 2 different canisters the value would most likely differ.
I agree that people should be aware/warned if such error occurs and cycles might get lost.
to avoid such scenario it might be better to split the deployment and the cycle top up into two different actions and just provide a minimal initial amount of cycles (if needed at all).