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

Exrension "az logicapp deployment source config-zip" doesn't work with 401 error #29020

Open
ShingoHanai opened this issue May 24, 2024 · 5 comments
Assignees
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve 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. Logic App az logic Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue

Comments

@ShingoHanai
Copy link

ShingoHanai commented May 24, 2024

Describe the bug

Through following document, after adding latest extension of az logicapp, zip deploy doesn't work with 401 error.

https://learn.microsoft.com/en-us/azure/logic-apps/set-up-devops-deployment-single-tenant-azure-logic-apps?tabs=azure-cli#tabpanel_1_azure-cli

If removing that extension by following command, zip deploy works correctly without that extension.

az extension remove --name logicapp

Could you fix az logicapp extension?

Related command

az extension add --yes --source "https://aka.ms/logicapp-latest-py2.py3-none-any.whl"
az logicapp deployment source config-zip --name test808 --resource-group standard --src test808.zip

Errors

urllib3.connectionpool: https://test808.scm.azurewebsites.net:443 "GET /api/settings HTTP/1.1" 401 0
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1561, in enable_zip_deploy_functionapp
remove_remote_build_app_settings(cmd, resource_group_name, name, slot)
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1467, in remove_remote_build_app_settings
scm_is_up_to_date = validate_app_settings_in_scm(
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1426, in validate_app_settings_in_scm
scm_settings = _get_app_settings_from_scm(cmd, resource_group_name, name, slot)
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 130, in call
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in get_app_settings_from_scm
return response.json() or {}
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 910, in json
File "json_init
.py", line 346, in loads
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1561, in enable_zip_deploy_functionapp
remove_remote_build_app_settings(cmd, resource_group_name, name, slot)
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1467, in remove_remote_build_app_settings
scm_is_up_to_date = validate_app_settings_in_scm(
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1426, in validate_app_settings_in_scm
scm_settings = _get_app_settings_from_scm(cmd, resource_group_name, name, slot)
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 130, in call
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in get_app_settings_from_scm
return response.json() or {}
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 910, in json
File "json_init
.py", line 346, in loads
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
az_command_data_logger: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1561, in enable_zip_deploy_functionapp
remove_remote_build_app_settings(cmd, resource_group_name, name, slot)
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1467, in remove_remote_build_app_settings
scm_is_up_to_date = validate_app_settings_in_scm(
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1426, in validate_app_settings_in_scm
scm_settings = _get_app_settings_from_scm(cmd, resource_group_name, name, slot)
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/appservice/utils.py", line 130, in call
File "C:\Users\shhanai.azure\cliextensions\logicapp\azext_logicapp\custom.py", line 1416, in get_app_settings_from_scm
return response.json() or {}
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/models.py", line 910, in json
File "json_init
.py", line 346, in loads
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Issue script & Debug output

az logicapp deployment source config-zip --name test808 --resource-group standard --src test808.zip
The behavior of this command has been altered by the following extension: logicapp
Getting scm site credentials for zip deployment
Starting zip deployment. This operation can take a while to complete ...
Deployment endpoint responded with status code 401
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...
Deployment status endpoint https://test808.scm.azurewebsites.net/api/deployments/latest returns malformed data. Retrying...

Expected behavior

Zip deploy works correctly by az logicapp extension without 401 error

Environment Summary

{
"azure-cli": "2.49.0",
"azure-cli-core": "2.49.0",
"azure-cli-telemetry": "1.0.8",
"extensions": {
"logic": "0.1.6",
"logicapp": "0.1.2",
"quota": "0.1.0"
}
}

Additional context

No response

@ShingoHanai ShingoHanai added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label May 24, 2024
Copy link

Hi @ShingoHanai,

2.49.0 is not the latest Azure CLI(2.61.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label May 24, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Logic App az logic labels May 24, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label May 24, 2024
Copy link

Hi @ShingoHanai
Find similar issue #10639.

Issue title Unclear what this error means?
Create time 2019-09-25
Comment number 4

Possible solution:
The error message "Expecting value: line 1 column 1 (char 0)" indicates that the JSON response from the server is empty or malformed. This can be caused by various reasons such as network issues or server-side errors. One possible solution is to remove the "az logicapp" extension by running the command "az extension remove --name logicapp" and then try the zip deployment again. If the zip deployment works correctly without the extension, then the issue might be related to the extension itself. You can try to reinstall the extension or contact the extension developer for further assistance.


Please confirm if this resolves your issue.

@yonzhan
Copy link
Collaborator

yonzhan commented May 24, 2024

Thank you for opening this issue, we will look into it.

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wsilveiranz.

@AliRz90
Copy link

AliRz90 commented Oct 23, 2024

I have trouble to install the extension and I got this error massage "An error occurred. Pip failed with status code 1. Use --debug for more information." when I run az extension add --yes --source "https://aka.ms/logicapp-latest-py2.py3-none-any.whl". Could you guys help me with this issue?

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 Auto-Resolve Auto resolve 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. Logic App az logic Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

5 participants