Azure / container-apps-deploy-action

GitHub Action for building and deploying Azure Container Apps
MIT License
51 stars 30 forks source link

cannot remove '.../src/oryx-runtime.txt': Permission denied #52

Open jwpaine opened 1 year ago

jwpaine commented 1 year ago

Hello, I'm running into the following issue when attempting to build and deploy:

github deploy yml:

name: Azure Container Apps Deploy

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Log in to Azure
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: Build and deploy Container App
        uses: azure/container-apps-deploy-action@v1

        with:
          appSourcePath: ${{ github.workspace }}/src
          acrName: budgetappr1ae0
          containerAppName: budgetapp
          resourceGroup: rg-budgetapp

I'm getting the following error:

Run azure/container-apps-deploy-action@v1
Run CA_GH_ACTION_START_MILLISECONDS=$(date +%s%N | cut -b1-13)
Run az config set extension.use_dynamic_install=yes_without_prompt
WARNING: Command group 'config' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Run CA_GH_ACTION_ACR_ACCESS_TOKEN=$(az acr login --name budgetappr1ae0 --output json --expose-token | jq -r '.accessToken')
WARNING: You can perform manual login using the provided access token below, for example: 'docker login loginServer -u 00000000-0000-0000-0000-000000000000 -p accessToken'
WARNING! Using -*** the CLI is insecure. Use --password-stdin.
Login Succeeded
Run dockerfilePath=/home/runner/work/budget-app/budget-app/src/Dockerfile
Run CA_GH_ACTION_IMAGE_TO_BUILD="budgetappr1ae0.azurecr.io/github-action/container-app:5581942329.1"
Run CA_GH_ACTION_IMAGE_TO_DEPLOY="budgetappr1ae0.azurecr.io/github-action/container-app:5581942329.1"
Run CA_GH_ACTION_RESOURCE_GROUP="rg-budgetapp"
Run az containerapp show \
WARNING: The command requires the extension containerapp. It will be installed first.
WARNING: The installed extension 'containerapp' is in preview.
Run CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT="budgetapp-env"
Run docker run \
Unable to find image 'mcr.microsoft.com/oryx/cli:builder-debian-buster-[20](https://github.com/jwpaine/budget-app/actions/runs/5581942329/jobs/10200662990#step:4:22)230208.1' locally
builder-debian-buster-20230208.1: Pulling from oryx/cli
d42a0fb443d7: Pulling fs layer
f390d[41](https://github.com/jwpaine/budget-app/actions/runs/5581942329/jobs/10200662990#step:4:45)539fb: Pulling fs layer
103b21370b9f: Pulling fs layer
f7571ea34: Verifying Checksum
...
205ffbb9f89d: Pull complete
Digest: sha256:2d5eaa1e75ef73b5bf461a573d8fdf40cb7bc[159](https://github.com/jwpaine/budget-app/actions/runs/5581942329/jobs/10200662990#step:4:170)6be2f0b044f5eb0231a8e94c
Status: Downloaded newer image for mcr.microsoft.com/oryx/cli:builder-debian-buster-[202](https://github.com/jwpaine/budget-app/actions/runs/5581942329/jobs/10200662990#step:4:213)30[208](https://github.com/jwpaine/budget-app/actions/runs/5581942329/jobs/10200662990#step:4:219).1
Error: Could not detect the language from repo.
rm: cannot remove '/home/runner/work/budget-app/budget-app/src/oryx-runtime.txt': Permission denied
Error: Process completed with exit code 1.

Any idea what I can try to get around the rm: cannot remove '/home/runner/work/budget-app/budget-app/src/oryx-runtime.txt': Permission deniedissue?

Thank you!

cormacpayne commented 1 year ago

@jwpaine Hey John, thanks for filing this issue -- for context: we're attempting to determine the runtime stack to use for your application when producing the final image to deploy to the Container App. In this case, the following error was thrown:

Error: Could not detect the language from repo.

You can find the list of runtime stacks that we support here -- would you mind confirming that the runtime stack your application is targeting is not on this list?

Since we are unable to detect the runtime stack to use, the command fails before writing the result to this oryx-runtime.txt file, and I believe you're seeing the "Permission denied" message because we're trying to delete a file that already doesn't exist. We can dig a bit more into this, but the flow should definitely check for the existence of this file before attempting to remove it, so this can be cleaned up a bit.

pnilssson commented 11 months ago

@jwpaine did you managed to solve this issue? I'm having the same issue and after reading @cormacpayne answer I noticed that .net 8 wasn't supported by Oryx yet and that what I used. But even after trying to use .net 7 instead I'm still having the same issue.