Azure / functions-action

Enable GitHub developers to deploy to Azure Function Apps using GitHub Actions
MIT License
152 stars 75 forks source link

Broken deployment of Azure Serverless function to Azure #195

Closed TrevorLinkgreen closed 1 year ago

TrevorLinkgreen commented 1 year ago

Our github deployment workflow file stopped working today. Upon drilling down into the issue, it appears that this was updated to v1.5.1 ~ 35 minutes ago.

Downgrading to 1.5.0 appears to allow us to work without issue.

DOTNET_VERSION: '6.0.x'

.NET action

      - name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: ${{ env.DOTNET_VERSION }}

Azure/functions-action workflow section

- name: 'Run Azure Functions Action'
        uses: Azure/functions-action@v1
        id: fa
        with:
          app-name: 'xxx-staging'
          slot-name: 'Production'
          package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
          publish-profile: ${{ secrets.xxxx }}

Error from build log

Run Azure/functions-action@v1
  with:
    app-name: xxx-staging
    slot-name: Production
    package: ./output
    publish-profile: ***
    respect-pom-xml: false
    respect-funcignore: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
  env:
    AZURE_FUNCTIONAPP_PACKAGE_PATH: .
    DOTNET_VERSION: 6.0.x
    BRANCH_NAME: master
    DOTNET_ROOT: /home/runner/.dotnet
node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module './debug'
Require stack:
- /home/runner/work/_actions/Azure/functions-action/v1/node_modules/debug/src/node.js
- /home/runner/work/_actions/Azure/functions-action/v1/node_modules/debug/src/index.js
- /home/runner/work/_actions/Azure/functions-action/v1/node_modules/https-proxy-agent/dist/agent.js
- /home/runner/work/_actions/Azure/functions-action/v1/node_modules/https-proxy-agent/dist/index.js
- /home/runner/work/_actions/Azure/functions-action/v1/node_modules/@azure/core-rest-pipeline/dist/index.js
- /home/runner/work/_actions/Azure/functions-action/v1/node_modules/@azure/core-client/dist/index.js
- /home/runner/work/_actions/Azure/functions-action/v1/node_modules/@azure/arm-storage/dist/index.js
- /home/runner/work/_actions/Azure/functions-action/v1/lib/publishers/websiteRunFromPackageDeploy.js
- /home/runner/work/_actions/Azure/functions-action/v1/lib/publishers/index.js
- /home/runner/work/_actions/Azure/functions-action/v1/lib/handlers/contentPublisher.js
- /home/runner/work/_actions/Azure/functions-action/v1/lib/main.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:10[2](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:2)8:15)
    at Function.Module._load (node:internal/modules/cjs/loader:87[3](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:3):27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1/node_modules/debug/src/node.js:1[4](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:4):28)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:12[5](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:5)2:10)
    at Module.load (node:internal/modules/cjs/loader:107[6](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:6):32)
    at Function.Module._load (node:internal/modules/cjs/loader:[9](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:9)11:12)
    at Module.require (node:internal/modules/cjs/loader:1[10](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:10)0:[19](https://github.com/OrderEaseInc/ClientIntegrationService/actions/runs/5894075314/job/15986941733#step:6:20)) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/Azure/functions-action/v1/node_modules/debug/src/node.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/node_modules/debug/src/index.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/node_modules/https-proxy-agent/dist/agent.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/node_modules/https-proxy-agent/dist/index.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/node_modules/@azure/core-rest-pipeline/dist/index.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/node_modules/@azure/core-client/dist/index.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/node_modules/@azure/arm-storage/dist/index.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/lib/publishers/websiteRunFromPackageDeploy.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/lib/publishers/index.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/lib/handlers/contentPublisher.js',
    '/home/runner/work/_actions/Azure/functions-action/v1/lib/main.js'
  ]
}

Downgrading using

uses: Azure/functions-action@v1.5.0

appears to resolve the issue

1kevgriff commented 1 year ago

Seeing similar issue:

Run Azure/functions-action@v1
  with:
    app-name: ****
    slot-name: ****
    package: *****
    publish-profile: ***
    respect-pom-xml: false
    respect-funcignore: false
    scm-do-build-during-deployment: false
    enable-oryx-build: false
  env:
    AZURE_FUNCTIONAPP_PACKAGE_PATH: ****
    DOTNET_VERSION: 7.0.x
    DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module './debug'
Require stack:
- D:\a\_actions\Azure\functions-action\v1\node_modules\debug\src\node.js
- D:\a\_actions\Azure\functions-action\v1\node_modules\debug\src\index.js
- D:\a\_actions\Azure\functions-action\v1\node_modules\https-proxy-agent\dist\agent.js
- D:\a\_actions\Azure\functions-action\v1\node_modules\https-proxy-agent\dist\index.js
- D:\a\_actions\Azure\functions-action\v1\node_modules\@azure\core-rest-pipeline\dist\index.js
- D:\a\_actions\Azure\functions-action\v1\node_modules\@azure\core-client\dist\index.js
- D:\a\_actions\Azure\functions-action\v1\node_modules\@azure\arm-storage\dist\index.js
- D:\a\_actions\Azure\functions-action\v1\lib\publishers\websiteRunFromPackageDeploy.js
- D:\a\_actions\Azure\functions-action\v1\lib\publishers\index.js
- D:\a\_actions\Azure\functions-action\v1\lib\handlers\contentPublisher.js
- D:\a\_actions\Azure\functions-action\v1\lib\main.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:108:[18](****))
    at Object.<anonymous> (D:\a\_actions\Azure\functions-action\v1\node_modules\debug\src\node.js:14:28)
    at Module._compile (node:internal/modules/cjs/loader:1[19](*****)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1[25](****)2:10)
    at Module.load (node:internal/modules/cjs/loader:1076:[32](****))
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\node_modules\\debug\\src\\node.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\node_modules\\debug\\src\\index.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\node_modules\\https-proxy-agent\\dist\\agent.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\node_modules\\https-proxy-agent\\dist\\index.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\node_modules\\@azure\\core-rest-pipeline\\dist\\index.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\node_modules\\@azure\\core-client\\dist\\index.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\node_modules\\@azure\\arm-storage\\dist\\index.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\lib\\publishers\\websiteRunFromPackageDeploy.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\lib\\publishers\\index.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\lib\\handlers\\contentPublisher.js',
    'D:\\a\\_actions\\Azure\\functions-action\\v1\\lib\\main.js'
  ]
}
rjhernandez commented 1 year ago

Same issue, this error has broken our deployment pipeline.

node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module './debug'
Require stack:
- /home/runner/work/_actions/azure/functions-action/v1/node_modules/debug/src/node.js
- /home/runner/work/_actions/azure/functions-action/v1/node_modules/debug/src/index.js
- /home/runner/work/_actions/azure/functions-action/v1/node_modules/https-proxy-agent/dist/agent.js
- /home/runner/work/_actions/azure/functions-action/v1/node_modules/https-proxy-agent/dist/index.js
- /home/runner/work/_actions/azure/functions-action/v1/node_modules/@azure/core-rest-pipeline/dist/index.js
- /home/runner/work/_actions/azure/functions-action/v1/node_modules/@azure/core-client/dist/index.js
- /home/runner/work/_actions/azure/functions-action/v1/node_modules/@azure/arm-storage/dist/index.js
- /home/runner/work/_actions/azure/functions-action/v1/lib/publishers/websiteRunFromPackageDeploy.js
- /home/runner/work/_actions/azure/functions-action/v1/lib/publishers/index.js
- /home/runner/work/_actions/azure/functions-action/v1/lib/handlers/contentPublisher.js
- /home/runner/work/_actions/azure/functions-action/v1/lib/main.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:[27](https://github.com/microsoft/provenance-bulk-signer/actions/runs/5894097705/job/15987147873#step:11:28))
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/home/runner/work/_actions/azure/functions-action/v1/node_modules/debug/src/node.js:14:[28](https://github.com/microsoft/provenance-bulk-signer/actions/runs/5894097705/job/15987147873#step:11:29))
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:[32](https://github.com/microsoft/provenance-bulk-signer/actions/runs/5894097705/job/15987147873#step:11:33))
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19) ***
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/_actions/azure/functions-action/v1/node_modules/debug/src/node.js',
    '/home/runner/work/_actions/azure/functions-action/v1/node_modules/debug/src/index.js',
    '/home/runner/work/_actions/azure/functions-action/v1/node_modules/https-proxy-agent/dist/agent.js',
    '/home/runner/work/_actions/azure/functions-action/v1/node_modules/https-proxy-agent/dist/index.js',
    '/home/runner/work/_actions/azure/functions-action/v1/node_modules/@azure/core-rest-pipeline/dist/index.js',
    '/home/runner/work/_actions/azure/functions-action/v1/node_modules/@azure/core-client/dist/index.js',
    '/home/runner/work/_actions/azure/functions-action/v1/node_modules/@azure/arm-storage/dist/index.js',
    '/home/runner/work/_actions/azure/functions-action/v1/lib/publishers/websiteRunFromPackageDeploy.js',
    '/home/runner/work/_actions/azure/functions-action/v1/lib/publishers/index.js',
    '/home/runner/work/_actions/azure/functions-action/v1/lib/handlers/contentPublisher.js',
    '/home/runner/work/_actions/azure/functions-action/v1/lib/main.js'
  ]
jonthenerd commented 1 year ago

Same (#196). I'll close as duplicate as more are here. Also confirmed that forcing the use of v1.5.0 works.

jonthenerd commented 1 year ago

@patelchandni this release looks to be broken. Could you delete the release & tag to keep folks working? Or move the v1 tag back to the prior release commit?

patelchandni commented 1 year ago

Sorry for inconvenience and thank you for reporting. I have reverted the v1 tag to 1.5.0 and actively investigating the issue with 1.5.1.

patelchandni commented 1 year ago

This issue is resolved. Thus, v1 tag is back to v1.5.1 latest release. I ran some extra tests but please confirm if it is fixed on you end as well. Thanks!

TrevorLinkgreen commented 1 year ago

New error reverting to @v1

Successfully parsed SCM credential from publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
(node:5896) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: Execution Exception (state: ValidateAzureResource) (step: Invocation)
Error:   Cannot read properties of undefined (reading 'AzureWebJobsStorage')
Error:     TypeError: Cannot read properties of undefined (reading 'AzureWebJobsStorage')
    at ResourceValidator.<anonymous> (D:\a\_actions\Azure\functions-action\v1\lib\handlers\resourceValidator.js:[17](https://github.com/OrderEaseInc/orderease.api/actions/runs/5895204885/job/15990449866#step:5:18)8:40)
    at Generator.next (<anonymous>)
    at fulfilled (D:\a\_actions\Azure\functions-action\v1\lib\handlers\resourceValidator.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Deployment Failed!
patelchandni commented 1 year ago

I have reverted the v1 tag to 1.5.0 and actively investigating the issue with 1.5.1.

jonthenerd commented 1 year ago

Now we have the issue reported in #197. So this particular issue may be resolved, but deployment is still stopped (for us). Staying on v1.5.0 until #197 is resolved.

patelchandni commented 1 year ago

Bug fix released for v1.5.1. I'll wait for feedback on v1.5.1 before updating v1. Thanks.

TrevorLinkgreen commented 1 year ago

I've switched our workflow file to use azure/functions-action@v1.5.1 specifically, and it successfully runs without error now.

patelchandni commented 1 year ago

v1 tag is now pointing to v1.5.1 latest release.