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

az functionapp deployment source config-zip fails with AttributeError: 'NoneType' object has no attribute 'lower' #23050

Closed
markhoratiowalmsley opened this issue Jun 28, 2022 · 7 comments
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. Functions az functionapp needs-author-feedback More information is needed from author to address the issue.
Milestone

Comments

@markhoratiowalmsley
Copy link

markhoratiowalmsley commented Jun 28, 2022

Using latest azure-cli I cannot deploy to a functionapp using cli locally.
Update to latest azure-cli did not work as specified here: #10773

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az functionapp deployment source config-zip

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 522, in enable_zip_deploy_functionapp
    remove_remote_build_app_settings(cmd, resource_group_name, name, slot)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/appservice/custom.py", line 645, in remove_remote_build_app_settings
    value = keyval['value'].lower()
AttributeError: 'NoneType' object has no attribute 'lower'

To Reproduce:

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

  • Put any pre-requisite steps here...
  • az functionapp deployment source config-zip --src {} --subscription {} --resource-group {} --name {}

Expected Behavior

Environment Summary

Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31, Ubuntu 20.04 LTS
Python 3.10.4
Installer: DEB

azure-cli 2.37.0

Additional Context

`
@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jun 28, 2022
@ghost ghost added AKS az aks/acs/openshift CXP Attention This issue is handled by CXP team. Auto-Assign Auto assign by bot Account az login/account labels Jun 28, 2022
@ghost ghost assigned jiasli Jun 28, 2022
@ghost ghost added this to the Backlog milestone Jun 28, 2022
@ghost ghost added the Functions az functionapp label Jun 28, 2022
@yonzhan yonzhan removed Account az login/account AKS az aks/acs/openshift labels Jun 28, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 28, 2022

route to CXP team

@RakeshMohanMSFT RakeshMohanMSFT self-assigned this Jun 29, 2022
@RakeshMohanMSFT
Copy link
Contributor

@markhoratiowalmsley Thank you for reaching out, we are looking into it.

@RakeshMohanMSFT RakeshMohanMSFT added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 29, 2022
@RakeshMohanMSFT
Copy link
Contributor

@markhoratiowalmsley We are unable to reproduce the issue. It is something to do with the appsettings returned. can you please share the -debug log?

@RakeshMohanMSFT RakeshMohanMSFT added the needs-author-feedback More information is needed from author to address the issue. label Jun 30, 2022
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Jul 7, 2022
@ghost
Copy link

ghost commented Jul 7, 2022

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@ghost ghost closed this as completed Jul 22, 2022
@dmexs
Copy link

dmexs commented Jul 25, 2022

I'm having the same issue:

Linux-5.15.0-1014-azure-x86_64-with
Python 3.6.10
Installer: DOCKER

azure-cli 2.9.1

Is there a private channel for me to share the debug logs?

@ghost ghost removed the no-recent-activity There has been no recent activity on this issue. label Jul 25, 2022
@RakeshMohanMSFT
Copy link
Contributor

@dmexs Your azure cli version is outdated. Please update it to 2.40.0

@leadpony
Copy link
Contributor

leadpony commented Oct 16, 2022

@RakeshMohanMSFT

I reproduced the problem with the latest version: 2.41.0.

The functionapp as a deployment target is configured as follows:

  • Stack: custom docker image
  • Registry source: Azure Container Registry
  • Registry authentication: Admin Credentials
  • Set WEBSITE-ENABLE_APP_SERVICE_STORAGE in the appsettings to true, for deploying the app under /home

Please see the article
https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#configure-environment-variables

If your app uses images from a private registry or from Docker Hub, credentials for accessing the repository are saved in environment variables: DOCKER_REGISTRY_SERVER_URL, DOCKER_REGISTRY_SERVER_USERNAME and DOCKER_REGISTRY_SERVER_PASSWORD. Because of security risks, none of these reserved variable names are exposed to the application.

Functionapp services automatically replace the value of DOCKER_REGISTRY_SERVER_* in the appsettings with null, which is mapped to None in the Azure CLI. NoneType object has no attribute lower in Python.

Could you please reopen this issue?

zhoxing-ms pushed a commit that referenced this issue Oct 26, 2022
…p`: Fix the bug that zip deployment will fail if app settings contain any values of null (#24077)
avgale pushed a commit to avgale/azure-cli that referenced this issue Aug 24, 2023
…ig-zip`: Fix the bug that zip deployment will fail if app settings contain any values of null (Azure#24077)
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. Functions az functionapp needs-author-feedback More information is needed from author to address the issue.
Projects
None yet
Development

No branches or pull requests

6 participants