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

Getting 404 when deploying #192

Closed
ardalis opened this issue Sep 9, 2021 · 29 comments · Fixed by #226
Closed

Getting 404 when deploying #192

ardalis opened this issue Sep 9, 2021 · 29 comments · Fixed by #226
Labels
bug Something isn't working P0 Action not working

Comments

@ardalis
Copy link

ardalis commented Sep 9, 2021

This if for a public repo you can see here:
https://github.com/DevBetterCom/DevBetterWeb

Running the CI/CD workflow (github action), everything works until the deploy step, when I get back a 404 result. Here's the failing log:

image

I've been searching and I can't find any information on why one might get a 404 here. I don't see anything in the Azure Portal for this app (though I admit I'm not sure where to look). I just tried switching the deploy step to use Windows instead of Ubuntu - not sure if that will make a difference. Any ideas?

@ardalis
Copy link
Author

ardalis commented Sep 9, 2021

Ok, so, it worked once I switched to using windows.

image

Here's the YAML (https://github.com/DevBetterCom/DevBetterWeb/blob/main/.github/workflows/ci-cd.yml):

cd:
    if: needs.ci.outputs.is_push_to_default_branch == 'true'
    name: Continuous Deployment
    needs: ci
    runs-on: windows-latest
    steps:
      - name: Download publish artifacts
        id: dl_publish_artifacts
        uses: actions/download-artifact@v2
        with:
          name: Publish artifacts
          path: WebApp/

      - name: Azure webapp deploy with Publish Profile
        id: azure_webapp_deploy_with_publish_profile
        uses: azure/webapps-deploy@v2
        with:
          app-name: ${{ env.AZURE_WEBAPP_NAME }}
          publish-profile: ${{ secrets.AZUREWEBAPPPUBLISHPROFILE }}
          package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/WebApp'

Only thing I changed is runs-on to windows-latest from ubuntu. Is this a known issue? Some kind of case sensitivity?

@BALAGA-GAYATRI BALAGA-GAYATRI added bug Something isn't working and removed need-to-triage labels Sep 13, 2021
@ehamai
Copy link
Collaborator

ehamai commented Sep 13, 2021

Hi @ardalis, I'm not sure exactly what the difference is between the different OS's for publishing with Zip Deploy, but given that your target app is running on Windows, this might be the expected behavior.

@mbiegert
Copy link

Hi, I just had a call with the Azure Support team. We experience the same problem as mentioned in the initial post, a "CODE 404" error on the zip deploy.

Curiously when switching the github action from ubuntu-latest to windows-latest the issue appears to resolve for us as well. We also run the Azure App Service on Windows, however I fail to understand how a network request fails if it is made between a linux and a windows machine but doesn't between two windows machines.

We also had the issue one or two weeks ago and were also in contact with Azure Support but it auto resolved a couple of days after the first appearance.

@ardalis
Copy link
Author

ardalis commented Sep 14, 2021

@ehamai if it's the expected behavior it should be well-documented; is it documented at all?

Also, if this is the expected or known behavior, I would expect a more helpful error message than a 404 Not Found with no other useful information. Last time I checked, HTTP worked across different operating systems, so I'm guessing the issue isn't at the HTTP layer, but somewhere in Azure's stack, where they could have chosen a different, more informative response.

@mbiegert
Copy link

I don't think it's desired behaviour, it has been working fine for many months up until now.
Also deploying using the endpoint in the kudu tools of the App Service works from my (Linux) computer, after creating the zip locally.

@mbiegert
Copy link

mbiegert commented Sep 17, 2021

We just ran into the problem again even when using windows actions.
Same error as with the linux backed github actions, CODE 404

Edit: Switching back to running the actions on linux again mitigated the problem this time. There's something really strange afoot here.

@prabhakarreddy1234
Copy link

Yea. this issue suddenly popped up again. Getting CODE 404.

@ehamai
Copy link
Collaborator

ehamai commented Sep 20, 2021

@spellegrino021 could you help take a look into this please?

@darena-patrick
Copy link

darena-patrick commented Sep 22, 2021

im getting the same but with 400. Works some times but not others:

image

@github-actions
Copy link

github-actions bot commented Oct 6, 2021

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle label Oct 6, 2021
@darena-patrick
Copy link

Any updates here?

@github-actions github-actions bot removed the idle label Oct 28, 2021
@github-actions
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle label Nov 11, 2021
@darena-patrick
Copy link

Any updates here? Right now I can work around this by swapping my container between windows and ubuntu, but this is annoying and it seems to be inconsistent as to which one will work and when.

@github-actions github-actions bot removed the idle label Nov 11, 2021
@mbiegert
Copy link

We haven't hit this snag for over a month now. We didn't need to take further action.

@darena-patrick
Copy link

I'm still getting this daily. running azure/webapps-deploy@v2

@github-actions
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle label Nov 25, 2021
@chprasad893
Copy link

I was also getting the 404 error while deploying, after debugging I found the IIS server is throwing 404 because my commit message was pretty long (because of merging multiple commits using squash & merge option in the pull request in Github the description contained commit messages of all the previous commits before squash and this big commit message is now being passed as query parameter to Kudu server in the App Service) and it exceeded the default allowed URL parameters length by the IIS server of App Service (Windows).

HTTP Error 404.15 - Not Found The request filtering module is configured to deny a request where the query string is too long.

I have created a new commit with shorter commit message and the deployment was successful even when I have used the "runs-on: ubuntu-latest" option.

@darena-patrick
Copy link

Wow! What a find ... is there a way to prevent the GH action from sending that? This definitely tracks with our situation. I thought the resolution was swapping the container ... but to do that, i was making a small commit which likely is what solved the problem then.

I was also getting the 404 error while deploying, after debugging I found the IIS server is throwing 404 because my commit message was pretty long (because of merging multiple commits using squash & merge option in the pull request in Github the description contained commit messages of all the previous commits before squash and this big commit message is now being passed as query parameter to Kudu server in the App Service) and it exceeded the default allowed URL parameters length by the IIS server of App Service (Windows).

HTTP Error 404.15 - Not Found The request filtering module is configured to deny a request where the query string is too long.

I have created a new commit with shorter commit message and the deployment was successful even when I have used the "runs-on: ubuntu-latest" option.

@chprasad893
Copy link

I believe we need to make the changes in src/actionparameters.ts and raise a pull request to fix thing, I think instead of removing the entire commit message we can trim the long commit messages going beyond a fixed length.

From this url the default size for maxQueryString is 2048 bytes.

@github-actions github-actions bot removed the idle label Dec 22, 2021
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle label Jan 5, 2022
@DavidBoike
Copy link

It would be really nice if someone could look at and merge #226 to fix this problem. Ran into it again today.

@github-actions github-actions bot removed the idle label Jul 15, 2022
@github-actions
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle label Jul 29, 2022
@DavidBoike
Copy link

It is not idle, it's waiting for someone to look at #226

@github-actions github-actions bot removed the idle label Aug 1, 2022
@github-actions
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle label Aug 15, 2022
@WDoughty
Copy link

Still not idle

@github-actions github-actions bot removed the idle label Aug 16, 2022
@darena-patrick
Copy link

I sent an approval on it hoping it might get some attention

@github-actions
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle label Aug 30, 2022
@DavidBoike
Copy link

Still not idle

@liam-ot
Copy link

liam-ot commented Dec 29, 2023

i am still getting a mysterious 404 error and it so happens that i got it when committing with a long commit message, but i cannot get it unstuck with a smaller subsequent commit message

Successfully parsed SCM credential from publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
(node:1895) [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)
Successfully acquired app settings from function app (with SCM credential)!
Will archive . into /home/runner/work/_temp/temp_web_package_5279344640656993.zip as function app content
Will use Kudu https://<scmsite>/api/zipdeploy to deploy since publish-profile is detected.
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to false
Update using context.kuduService.updateAppSettingViaKudu
Response with status code [20](https://github.com/robot-kittens/ravetosave-backend/actions/runs/7357868557/job/20030185001#step:5:21)4
App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to false
Update using context.kuduService.updateAppSettingViaKudu
Response with status code 204
App setting ENABLE_ORYX_BUILD propagated to Kudu container
Package deployment using ZIP Deploy initiated.
Error: Failed to deploy web package to App Service.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/_temp/temp_web_package_5279344640656993.zip as ZipDeploy content
Error:     Failed to deploy web package to App Service.
Not Found (CODE: 404)
Error:       Error: Failed to deploy web package to App Service.
Not Found (CODE: 404)
    at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:[23](https://github.com/robot-kittens/ravetosave-backend/actions/runs/7357868557/job/20030185001#step:5:24)5:41)
    at Generator.throw (<anonymous>)
    at rejected (/home/runner/work/_actions/Azure/functions-action/v1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:6:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Deployment Failed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Action not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.