-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_container_app - Cannot deploy container with ingress enabled #20435
Comments
Thanks @btbaetwork for raising this issue. I need to find out the minimum timeout for environment creation. Will update once confirmed. |
If I may add another data point: container app env is created after about 12min. Container app creation starts immediately after that. I'm creating one container app with the new resource provider:
and one the old azapi way:
The first fails with a timeout (although the resource is created fine), the second succeeds. |
Same here, to be more precise, in my case, a creation without the ingress part works. And after that if you update your container app with an ingress it works too (no timeout). Timeout occurs when you send for the first time a definition with an ingress. |
Can confirm what @jpinsolle-betclic wrote. Also these timings may be of interest:
Apart from that i noticed the following (maybe related, maybe different error):
This is not the case when the AzApi-provider is used @ggeorgovassilis: you wrote that "The first fails with a timeout (although the resource is created fine)" - is there really a running container inside your Container App that is reachable from "outside"? The resource itself looks fine for me also at first glance, but in reality doesn`t run anything... |
@btbaetwork I spoke hastily and with little knowledge. In fact, the container is created but ingres returns 404. |
I can also confirm the same findings - creation in two steps (without ingress then adding) is fast ~20-30s in all cases, but creating with ingress enabled leads to timeout after around 10-15mins and deployment failure usually with revision 'unknown' as the status and the whole azure container apps ui is somewhat unresponsive until the app is deleted. On some occasions I had to delete the app via CLI as the portal wouldn't load the app state. This was on a new empty container apps env (created ~1hr previous) and the container apps env had VNET integration via the infrastructure_subnet_id property. |
I got the same issue, with revision mode set to Multiple I do see the container deployed in the Azure Portal, still the revision status is stuck on "In Progress" and terraform timeouts:
|
I can observe the same behaviour, thanks to this thread I can at least pinpoint it to the Once I include the |
Hi all, I can confirm the bug with the configuration stated above. However I was experimenting with some more properties on the ingress and I could manage to get it working with this ingress block:
Befor this setup I only provided the required parameters as in @ggeorgovassilis configuration above. After adding latest_revision parameter it suddenly started working again. Also creation was very fast, 4:50 minutes for the environment and just 16 seconds for each container app. |
Can also confirm. Creating |
@trichling thanks, that works. @andmos does "... and then adding the block" mean two deployments? For me it worked with a single deployment with the simple change Tobias proposed. |
@ggeorgovassilis ah did not try with more parameters in the block. Will give it a go, I got it working with a minimal block and two runs of |
can also confirm this works with traffic_weight block set to:
|
I can confirm that i'm seeing the behavior. From the logs i see that when it tries to assign the traffic weight, it's not including the revision hash so it fails trying to find the revision. If you remove the ingress it'll succeed in creation. Then you can modify the terraform and put the ingress back and this time it succeeds, but updating the traffic percentage to 100 will still fail. |
Adding a bit more context: Setting LatestRevision = true works and allows it to successfully set the traffic to 100%. Looking into the code at in the helpers/container_apps.go you see:
that is why setting latest revision works. Seems the client isnt correctly populating the RevisionSuffix after it gets generated. |
Thank you all, this has moved me on an validated I'm not going crazy, but after adding the latest_revision=false to the traffic_weight, I now get this error
|
Today when I've returned to this it's all working, I'm assuming the "context deadline exceeded" was a temporary issue and adding |
I can confirm setting |
I also confirm. If you want a complete working example, you can have a look at this code I just finished: https://github.com/microsoft/NubesGen/blob/099ce8616a1b762ff9d0016fcdb13b7e0037ac47/terraform/modules/container-apps/main.tf#L97 |
Can also confirm that this issue is happening because of the |
wow... I have been fighting with some problme from about 4 days now... I think there are still different problems with this kind of resource.... I confirm all has been said and I add a new problem I thought was about VS 2022 but now I think it is about the terraform module. I cannot deploy my projet in the app container form VS 2022... I get the error
But, the image is correctly deployed to the registry but it is not used in the app container. In fact I can deploy with no problem the image only to the container registry, and I can deploy with no problem to an app container I created manually... only I cannot deploy to the container app created with terraform. Anyone has the same problem? How do you solve it? |
@simonecoppini This seems unrelated. Please create a new issue for that |
Hi, i had the same problem recently. This happen when revision_mode is set to Single. This terraform ressource worked for me : resource "azurerm_container_app" "example" { template {
} ingress { depends_on = [ azurerm_cosmosdb_postgresql_cluster.example, null_resource.import-image,] Hope this will help ! |
Another confirmation of |
Thanks for taking the time to submit this issue. It looks like this has been resolved as of the suggestion of |
This should definitely NOT be closed. Latest_revision should not be required to be true - this is a hack. There is a clear bug in the code where the revision suffix is not getting set correctly. |
Thank you for the clarification @stewartbeck. I have reopened this issue. I appreciate the quick response. |
Wow! Spent the whole day trying to figure out why the Apply took more than 10 mins and then failed out of nowhere. Many thanks @trichling to find that hack! For me (West Europe), adding Hopefully this gets fixed soon, the documentation marking the parameter as |
FWIW - add me to the list of people who had it "working" then added ingress, thought it was fine b/c it worked, later it broke and took extensive time to figure it out. This bug is evasive and a bit gnarly b/c it's not obvious at the time you make the change that it will later break and when it does break, the error message gives no indication or direction on the issue or how to fix. |
setting latest_revision = true also resolved the issue for me |
I'll be one more person reporting exactly the same issue, exactly the same results with the workaround and exactly the same thoughts about what a time sink this problem is. The 10 minute wait time for testing of ideas combined with the non-specificity of the error is really painful. Even if the error message were updated to indicate that this workaround exists that would be a massive improvement. Thanks to the team for what they do.
|
it is not clear to me why if However, when creating a Container App with the portal, inspecting the json object I see:
It seems the traffic block with |
@clemlesne this issue has a regression or wasn't fixed properly in the first place. When omitting |
@klemmchr I don't know if it has anything to do with That being said, the JSON we use to create the container app using |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
👏Folks, I've got some update after connecting to the service team. In principle, the Whilst, there is an issue in the service side, in that for Speaking of the implementation of this provider, if the terraform-provider-azurerm/internal/services/containerapps/helpers/container_apps.go Lines 628 to 630 in 5efe279
This aligns with the expectation of this API. I've updated the validation logic in #27396 to align with above. Hoping this clarifies the behavior and the existing service known issue a bit. |
Is there an existing issue for this?
Community Note
Terraform Version
1.3.8
AzureRM Provider Version
3.43.0
Affected Resource(s)/Data Source(s)
azurerm_container_app
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Container App should be successfully provisioned and be publicly reachable using the FQDN
Actual Behaviour
Steps to Reproduce
just apply the config above and wait for it to timeout :-)
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: