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

ERROR: (InvalidParameterValueInContainerTemplate) #85

Open
danielPerez97 opened this issue Jan 5, 2024 · 4 comments
Open

ERROR: (InvalidParameterValueInContainerTemplate) #85

danielPerez97 opened this issue Jan 5, 2024 · 4 comments

Comments

@danielPerez97
Copy link

Hello, we are getting this error:

ERROR: (InvalidParameterValueInContainerTemplate) The following field(s) are either invalid or missing. Field 'template.containers.<our-registry>.image' is invalid with details: 'Invalid value: "<our-registry>.azurecr.io/our-server:32931cfe[65](https://github.com/my-org/our-repol/actions/runs/7415102429/job/20177549358#step:12:70)8e2c0800f4a8[79](https://github.com/my-org/our-repo/actions/runs/7415102429/job/20177549358#step:12:84)0da35183ecac2906": GET https:?scope=repository%3Aour-server%3Apull&service=<our-registry>.azurecr.io: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information.';.

This doesn't make sense to us because it sucessfully logs into the ACR beforehand:

Run docker/[email protected]
  with:
    registry: <our-registry>.azurecr.io
    username: ***
    password: ***
    ecr: auto
    logout: true
  env:
    SERVICE: <our-registry>
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
    CA_GH_ACTION_START_MILLISECONDS: 1704404270120
    CA_GH_ACTION_RESULT_ARG: --property 'result=failed'
    CA_GH_ACTION_YAML_PROVIDED: true
Logging into <our-registry>.azurecr.io...
Login Succeeded!

Here is the full log:

Run docker/[email protected]
  with:
    registry: <our-registry>.azurecr.io
    username: ***
    password: ***
    ecr: auto
    logout: true
  env:
    SERVICE: <our-registry>
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
    CA_GH_ACTION_START_MILLISECONDS: 1704404270120
    CA_GH_ACTION_RESULT_ARG: --property 'result=failed'
    CA_GH_ACTION_YAML_PROVIDED: true
Logging into <our-registry>.azurecr.io...
Login Succeeded!
Run CA_GH_ACTION_REGISTRY_LOGIN_ARG="--registry-server <our-registry>.azurecr.io --registry-username *** --registry-password ***"
  CA_GH_ACTION_REGISTRY_LOGIN_ARG="--registry-server <our-registry>.azurecr.io --registry-username *** --registry-password ***"
  CA_GH_ACTION_REGISTRY_URL=<our-registry>.azurecr.io
  CA_GH_ACTION_REGISTRY_USERNAME=***
  CA_GH_ACTION_REGISTRY_PASSWORD=***
  echo "CA_GH_ACTION_REGISTRY_LOGIN_ARG=$***CA_GH_ACTION_REGISTRY_LOGIN_ARG***" >> $GITHUB_ENV
  echo "CA_GH_ACTION_REGISTRY_URL=$***CA_GH_ACTION_REGISTRY_URL***" >> $GITHUB_ENV
  echo "CA_GH_ACTION_REGISTRY_USERNAME=$***CA_GH_ACTION_REGISTRY_USERNAME***" >> $GITHUB_ENV
  echo "CA_GH_ACTION_REGISTRY_PASSWORD=$***CA_GH_ACTION_REGISTRY_PASSWORD***" >> $GITHUB_ENV
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail ***0***
  env:
    SERVICE: <our-registry>
    AZURE_HTTP_USER_AGENT: 
    AZUREPS_HOST_ENVIRONMENT: 
    CA_GH_ACTION_START_MILLISECONDS: 1704404270120
    CA_GH_ACTION_RESULT_ARG: --property 'result=failed'
    CA_GH_ACTION_YAML_PROVIDED: true
Run CA_GH_ACTION_IMAGE_TO_BUILD="<our-registry>.azurecr.io/github-action/container-app:741[51](https://github.com/my-org/our-repo/actions/runs/7415102429/job/20177549358#step:12:55)02429.1"
Run CA_GH_ACTION_IMAGE_TO_DEPLOY="<our-registry>.azurecr.io/our-server:32931cfe6[58](https://github.com/my-org/our-repo/actions/runs/7415102429/job/20177549358#step:12:62)e2c0800f4a8790da35183ecac2906"
Run CA_GH_ACTION_RESOURCE_GROUP="***"
Run az containerapp show \
WARNING: The behavior of this command has been altered by the following extension: containerapp
ERROR: (ResourceNotFound) The Resource 'Microsoft.App/containerApps/<our-registry>' under resource group '***' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Run az containerapp create \
WARNING: The behavior of this command has been altered by the following extension: containerapp
WARNING: Additional flags were passed along with --yaml. These flags will be ignored, and the configuration defined in the yaml will be used instead
ERROR: (InvalidParameterValueInContainerTemplate) The following field(s) are either invalid or missing. Field 'template.containers.<our-registry>.image' is invalid with details: 'Invalid value: "<our-registry>.azurecr.io/our-server:32931cfe[65](https://github.com/my-org/our-repo/actions/runs/7415102429/job/20177549358#step:12:70)8e2c0800f4a8[79](https://github.com/my-org/our-repo/actions/runs/7415102429/job/20177549358#step:12:84)0da35183ecac2906": GET https:?scope=repository%3Aour-server%3Apull&service=<our-registry>.azurecr.io: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information.';.

We're unsure where to go from here to get this working and find this error confusing when you see the login succeeded beforehand. Thank you.

@eXigentCoder
Copy link

Getting the same error though my login action is slightly different:
image

  • Login works
  • build & push works
  • Deploy fails with UNAUTHORIZED: authentication required

@danielPerez97
Copy link
Author

Hey @eXigentCoder, I believe I was able to get this working by changing the Location to match where the ACR or ContainerApps Environment was located. I had copy-pasted my YAML file but didn't update the location field. Let me know if this helps and we can probably just close this issue.

@eXigentCoder
Copy link

When you say change the location, do you mean like "West US 2" etc?

@danielPerez97
Copy link
Author

@harryli0108 Yeah, "centralus" more specifically. Changed it in the YAML file to match where I believe our Container Apps Environment was located.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants