azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

App Service deploy error Input string was not in a correct format

Open GMZwinge opened this issue 4 years ago • 5 comments

Describe the bug

An App Service deployment with a custom script that somehow displays a { to stdout can fail deployment at the line that display this character with this error message in the deployment log: Input string was not in a correct format. Example of custom script custom.cmd that produces the error: @echo {, or a PowerShell command with Where-Object or ForEach-Object like PowerShell -Command "Get-Item * | ForEach-Item { $_.Name }".

The deployment also only fails after the timeout (default to 60 seconds or configured with SCM_COMMAND_IDLE_TIMEOUT) with an error like this in the log: Command 'starter.cmd custom.cmd' was aborted due to no output nor CPU activity for <nn> seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed.\r\nstarter.cmd custom.cmd.

Command Name az webapp deployment source config-zip

Errors:

Zip deployment failed. {'id': '5364faa9fb42499f8144d4f896546386', 'status': 3, 'status_text': '', 'author_email': 'N/A', 'author': 'N/A', 'deployer': 'ZipDeploy', 'message': 'Created via a push deployment', 'progress': '', 'received_time': '2022-05-24T21:57:38.1413494Z', 'start_time': '2022-05-24T21:57:38.2976066Z', 'end_time': '2022-05-24T21:57:40.9381808Z', 'last_success_end_time': None, 'complete': True, 'active': False, 'is_temp': False, 'is_readonly': True, 'url': 'https://gmzwingeappservice.scm.azurewebsites.net/api/deployments/latest', 'log_url': 'https://gmzwingeappservice.scm.azurewebsites.net/api/deployments/latest/log', 'site_name': 'GMZwingeAppService', 'provisioningState': 'Failed'}. Please run the command az webapp log deployment show -n GMZwingeAppService -g rg-0102-flourish-prod-centralus

Call stask:

cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 713, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/commands.py", line 39, in _ex_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 528, in enable_zip_deploy_webapp
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 562, in enable_zip_deploy
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/custom.py", line 3750, in _check_zip_deployment_status

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Use a custom deployment script that will display to stdout a single {.
  • az webapp deployment source config-zip --subscription {} --resource-group {} --name {} --src {} --verbose --debug

Expected Behavior

Environment Summary

Windows-10-10.0.19042-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.36.0 *

Extensions:
account 0.2.1
resource-graph 2.1.0

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

GMZwinge avatar May 24 '22 22:05 GMZwinge

route to CXP team

yonzhan avatar May 25 '22 11:05 yonzhan

Thanks for reporting this is a runtime issue & not CLI specific. Please report this on the Kudu GitHub project. I will report this offline to the team as well. @JasonFreeberg FYI,

panchagnula avatar Jul 15 '22 16:07 panchagnula

FYI - This issue was fixed for us a few weeks ago with the release of Kudu version 97.40603.5765. If you haven't already, you may try running your script again and see if the issue still exists.

davegw avatar Jul 19 '22 00:07 davegw

@GMZwinge Could you please run the above CLI command again and check if you are still facing this issue ? Awaiting your reply.

navba-MSFT avatar Jul 22 '22 04:07 navba-MSFT

@GMZwinge This issue is now addressed. The action is pending on you now to test the command again. We will now proceed with closure of this GitHub issue. If you need any further assistance on this issue in future, please feel free to reopen this thread. We would be happy to help.

navba-MSFT avatar Jul 26 '22 04:07 navba-MSFT