Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Nested exceptions during failure of azure function deployment #171

Closed
andrew-slutsky opened this issue Oct 18, 2020 · 0 comments · Fixed by #172
Closed

Nested exceptions during failure of azure function deployment #171

andrew-slutsky opened this issue Oct 18, 2020 · 0 comments · Fixed by #172

Comments

@andrew-slutsky
Copy link
Contributor

andrew-slutsky commented Oct 18, 2020

Information

  • Onefuzz version: 1.3.0
  • OS: Windows

Provide detailed reproduction steps (if any)

  1. Execute a deployment using a poor internet connection or induce an exception (e.g. kill func.exe) while subprocess "func azure functionapp publish ..." is running.

Expected result

I expect to see only the Azure.Functions.Cli.Common.CliException exception or reason displayed and not a PermissionError.

Traceback (most recent call last):
File "deploy.py", line 789, in
main()
File "deploy.py", line 783, in main
state1
File "deploy.py", line 604, in deploy_app
cwd=tmpdirname,
File "C:\Program Files\Python37\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "C:\Program Files\Python37\lib\subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['C:\ProgramData\chocolatey\bin\func.EXE', 'azure', 'functionapp', 'publish', '', '--python', '--no-build']' returned non-zero exit status 1.

Actual result

Azure.Functions.Cli.Common.CliException: Timed out waiting for SCM to update the Environment Settings
at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.WaitForAppSettingUpdateSCM(Site functionApp, IDictionary2 shouldHaveSettings, IDictionary2 shouldNotHaveSet
tings, Int32 timeOutSeconds) in D:\a\1\s\src\Azure.Functions.Cli\Actions\AzureActions\PublishFunctionAppAction.cs:line 580
at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.PublishRunFromPackageLocal(Site functionApp, Func1 zipFileFactory) in D:\a\1\s\src\Azure.Functions.Cli\Actio ns\AzureActions\PublishFunctionAppAction.cs:line 504 at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.HandleLinuxDedicatedPublish(Site functionApp, Func1 zipStreamFactory) in D:\a\1\s\src\Azure.Functions.Cli\Ac
tions\AzureActions\PublishFunctionAppAction.cs:line 411
at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.PublishFunctionApp(Site functionApp, GitIgnoreParser ignoreParser, IDictionary`2 additionalAppSettings) in D:
\a\1\s\src\Azure.Functions.Cli\Actions\AzureActions\PublishFunctionAppAction.cs:line 319
at Azure.Functions.Cli.Actions.AzureActions.PublishFunctionAppAction.RunAsync() in D:\a\1\s\src\Azure.Functions.Cli\Actions\AzureActions\PublishFunctionAppAction.cs:line 173
at Azure.Functions.Cli.ConsoleApp.RunAsync[T](String[] args, IContainer container) in D:\a\1\s\src\Azure.Functions.Cli\ConsoleApp.cs:line 66
Traceback (most recent call last):
File "deploy.py", line 456, in deploy_app
env=dict(os.environ, CLI_DEBUG="1"),
File "C:\Users\OneFuzzDeployer\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "C:\Users\OneFuzzDeployer\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['C:\Program Files\Microsoft\Azure Functions Core Tools\func.EXE', 'azure', 'functionapp', 'publish', '', '--python',
'--no-build']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "deploy.py", line 581, in
main()
File "deploy.py", line 575, in main
state1
File "deploy.py", line 459, in deploy_app
os.chdir(current_dir)
File "C:\Users\OneFuzzDeployer\AppData\Local\Programs\Python\Python37\lib\tempfile.py", line 807, in exit
self.cleanup()
File "C:\Users\OneFuzzDeployer\AppData\Local\Programs\Python\Python37\lib\tempfile.py", line 811, in cleanup
_shutil.rmtree(self.name)
File "C:\Users\OneFuzzDeployer\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 516, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\OneFuzzDeployer\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 404, in _rmtree_unsafe
onerror(os.rmdir, path, sys.exc_info())
File "C:\Users\OneFuzzDeployer\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 402, in _rmtree_unsafe
os.rmdir(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\OneFuzzDeployer\AppData\Local\Temp\tmp8bdhk01z'

@bmc-msft bmc-msft linked a pull request Oct 19, 2020 that will close this issue
2 tasks
@bmc-msft bmc-msft changed the title An exception raised by src/deployment/deploy::subprocess.check_output() results in two exceptions being displayed instead of one Nested exceptions during failure of azure function deployment Oct 20, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant