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

AttributeError: 'PipelineResponse' object has no attribute 'get' #24589

Closed
SiberianTiger01 opened this issue May 25, 2022 · 13 comments
Closed

AttributeError: 'PipelineResponse' object has no attribute 'get' #24589

SiberianTiger01 opened this issue May 25, 2022 · 13 comments
Assignees
Labels
Azure.Identity Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@SiberianTiger01
Copy link

hello Azure SDK for Python team,

my client set up Pacemaker on SUSE Linux Enterprise Server in Azure, came across the Error "ERROR: Failed: Unable to deserialize to object: type, AttributeError: 'PipelineResponse' object has no attribute 'get'". As a Azure support engineer, I have tried many times but failed to fix this error. As I traced the origin of PipelineResponse class, https://docs.microsoft.com/en-us/python/api/azure-core/azure.core.pipeline.pipelinerequest?view=azure-python, I found PipelineResponse class is one part of Azure SDK for Python.
Accordingly, I am asking for help from the team which is the contributor for PipelineResponse class. I need some documentation about PipelineResponse class which I cannot find online. Also, May I have some debugging hints about this error.

Thank you very much for your help

Treynor Cui Na
email: [email protected]

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 25, 2022
@azure-sdk
Copy link
Collaborator

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Data Factory:0.35301474,Docs:0.09512764,Compute - VM:0.0456159'

@annatisch
Copy link
Member

Thanks @SiberianTiger01
We will need a bit more information in order to get find the best people to help - the PipelineResponse object is a structural part of all the Azure Python SDKs, so it would be great if we could narrow this down a bit.
Are you able to provide a more complete error stack so we can see which file/SDK is raising the attribute error?
Or maybe your client is able to provide more details as to which Azure services they are using?
In order to help diagnose this, we will need to figure out details such as which Azure SDK is being used, which version is installed, and which APIs are being used.

You can find more information on the PipelineResponse, and how it fits into the SDK pipeline here:
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#pipelinerequest-and-pipelineresponse

@SiberianTiger01
Copy link
Author

SiberianTiger01 commented May 25, 2022

the hosting vm is Azure VM using SLES 15 image. Python2.7.18 and Python 3.6.15 are installed.
Client set up STONITH by using an Azure fence agent following this article: https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/high-availability-guide-suse-pacemaker
Client install the Azure fence agent and other dependency packages by zypper install.

vm-psapapp04:/home/azureuser # rpm -qa |grep fence-agents
fence-agents-4.9.0+git.1624456340.8d746be9-150100.7.32.1.x86_64

After installation, client tried to start the service rsc_st_azure by below command:

fence_azure_arm -l 'ceb2620c-xxxx-xxxx' -p '9C58QV7VELveaxxxxx' --resourceGroup 'RG-LPMAUSAPPROD-AE-APP-01' --subscriptionId 'xxx-xxx' --tenantId 'xxxx-xxx-xxx' -o list -v

but failed to kickstart the service, and error pop out:
ERROR: Failed: Unable to deserialize to object: type, AttributeError: 'PipelineResponse' object has no attribute 'get'

attached detailed snippets of /var/log/messages file

varlogs.txt

@SiberianTiger01
Copy link
Author

The STONITH device uses a service principal to authorize against Microsoft Azure. Client use an Azure fence agent, which restarts a failed node via the Azure APIs.

@annatisch
Copy link
Member

Thanks @SiberianTiger01
From the linked guide - the only reference I can find to the Python SDK is here in step 10A, which would seem to narrow the scope down to either azure-identity or azure-mgmt-compute.

# You might need to activate the public cloud extension first. In this example, the SUSEConnect command is for SLES 15 SP1
 SUSEConnect -p sle-module-public-cloud/15.1/x86_64
 sudo zypper install python3-azure-mgmt-compute
 sudo zypper install python3-azure-identity

However from this alone it's still hard to tell where the error is occurring.
Could you let us know whether the client is installing to Python 2 or Python 3? (Python 2 is no longer officially supported by the Azure SDK).
Additionally, which versions of these Python packages are being installed?
Do we know how these packages are being consumed?

This could be an issue in the framework/agent that's calling into the SDK, rather than the SDK itself. It could also be worth reaching out to the authors of the guide to see if they can provide more details.

@SiberianTiger01
Copy link
Author

2022-05-25 12:34:34,516 INFO: 'User-Agent': 'azsdk-python-identity/1.5.0 Python/3.6.15 (Linux-4.12.14-197.83-default-x86_64-with-glibc2.3.4)'

@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label May 25, 2022
@annatisch
Copy link
Member

Thanks - I'll tentatively tag this as identity for now.

@xiangyan99
Copy link
Member

From the log, I found:
ClientSecretCredential.get_token succeeded -- looks like we got the access token successfully.

and

2022-05-19 18:30:51,084 INFO: Request URL: 'https://management.azure.com/subscriptions/f2124a35-xxx-xxx/resourceGroups/RG-LPMAUSAPPROD-AE-APP-01/providers/Microsoft.Compute/virtualMachines?api-version=REDACTED'
2022-05-19 18:30:51,084 INFO: Request method: 'GET'
2022-05-19 18:30:51,084 INFO: Request headers:
2022-05-19 18:30:51,084 INFO: 'Accept': 'application/json'
2022-05-19 18:30:51,084 INFO: 'x-ms-client-request-id': '2e770b50-d752-11ec-844a-000d3a6ab175'
2022-05-19 18:30:51,084 INFO: 'User-Agent': 'azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.15 (Linux-4.12.14-197.83-default-x86_64-with-glibc2.3.4)'
2022-05-19 18:30:51,084 INFO: 'Authorization': 'REDACTED'
2022-05-19 18:30:51,084 INFO: No body was attached to the request
2022-05-19 18:30:51,086 DEBUG: Starting new HTTPS connection (1): management.azure.com:443
2022-05-19 18:30:51,366 DEBUG: https://management.azure.com:443 "GET /subscriptions/f2124a35-xxx-xxx/resourceGroups/RG-LPMAUSAPPROD-AE-APP-01/providers/Microsoft.Compute/virtualMachines?api-version=2020-06-01 HTTP/1.1" 200 None
2022-05-19 18:30:51,367 INFO: Response status: 200
2022-05-19 18:30:51,367 INFO: Response headers:
2022-05-19 18:30:51,367 INFO: 'Cache-Control': 'no-cache'
2022-05-19 18:30:51,367 INFO: 'Pragma': 'no-cache'
2022-05-19 18:30:51,368 INFO: 'Transfer-Encoding': 'chunked'
2022-05-19 18:30:51,368 INFO: 'Content-Type': 'application/json; charset=utf-8'
2022-05-19 18:30:51,368 INFO: 'Content-Encoding': 'REDACTED'
2022-05-19 18:30:51,368 INFO: 'Expires': '-1'
2022-05-19 18:30:51,368 INFO: 'Vary': 'REDACTED'
2022-05-19 18:30:51,368 INFO: 'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/HighCostGet3Min;138,Microsoft.Compute/HighCostGet30Min;697'
2022-05-19 18:30:51,368 INFO: 'Strict-Transport-Security': 'REDACTED'
2022-05-19 18:30:51,368 INFO: 'x-ms-request-id': 'ad1b8621-2579-48ce-9660-fbbc55ff94e6'
2022-05-19 18:30:51,368 INFO: 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
2022-05-19 18:30:51,368 INFO: 'x-ms-ratelimit-remaining-subscription-reads': '11998'
2022-05-19 18:30:51,368 INFO: 'x-ms-correlation-request-id': 'REDACTED'
2022-05-19 18:30:51,368 INFO: 'x-ms-routing-request-id': 'REDACTED'
2022-05-19 18:30:51,368 INFO: 'X-Content-Type-Options': 'REDACTED'
2022-05-19 18:30:51,369 INFO: 'Date': 'Thu, 19 May 2022 09:00:50 GMT'
2022-05-19 18:30:51,369 DEBUG: Unable to deserialize to object: type, AttributeError: 'PipelineResponse' object has no attribute 'get'
2022-05-19 18:30:51,369 ERROR: Failed: Unable to deserialize to object: type, AttributeError: 'PipelineResponse' object has no attribute 'get'

especially:
'User-Agent': 'azsdk-python-azure-mgmt-compute/17.0.0 Python/3.6.15 (Linux-4.12.14-197.83-default-x86_64-with-glibc2.3.4)'

@msyyc can you take a look?

@xiangyan99 xiangyan99 added the Mgmt This issue is related to a management-plane library. label May 25, 2022
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label May 25, 2022
@SiberianTiger01
Copy link
Author

yes, CX login successfully. but came across this error, "ERROR: Failed: Unable to deserialize to object: type, AttributeError: 'PipelineResponse' object has no attribute 'get'"

@BigCat20196
Copy link
Contributor

Hi @SiberianTiger01, thanks for your feedback, I used the same package version, but did not reproduce your results.

Could you please run the following demo script and tell us your results?

import os
import sys
import logging

from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient

logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler(stream=sys.stdout, )
logger.addHandler(handler)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)

credential = DefaultAzureCredential()
SUBSCRIPTION_ID = os.environ.get("AZURE_SUBSCRIPTION_ID", None)

compute_client = ComputeManagementClient(credential, SUBSCRIPTION_ID, api_version='2020-06-01')

resource_group_name = 'your-resource-group-name'    # replace this
for res in compute_client.virtual_machines.list(resource_group_name):
    print(res)

fyi: https://github.com/Azure-Samples/azure-samples-python-management/blob/main/samples/compute/README.md

@BigCat20196 BigCat20196 added needs-author-feedback Workflow: More information is needed from author to address the issue. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. labels Jun 2, 2022
@ghost
Copy link

ghost commented Jun 6, 2022

Hi @SiberianTiger01. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@ghost ghost removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team needs-author-feedback Workflow: More information is needed from author to address the issue. labels Jun 6, 2022
@BigCat20196 BigCat20196 added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jun 6, 2022
@ghost ghost removed the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Jun 6, 2022
@BigCat20196 BigCat20196 added issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Jun 9, 2022
@ghost
Copy link

ghost commented Jun 9, 2022

Hi @SiberianTiger01. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@ghost
Copy link

ghost commented Jun 16, 2022

Hi @SiberianTiger01, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

@ghost ghost closed this as completed Jun 16, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

6 participants