Skip to content

[BUG Bash] _key_vault_client.py ImportError: cannot import name 'Deserializer' #22862

@dakooka

Description

@dakooka

Describe the bug
We are using some python modules in our python scripts, and when gitlab-runner is trying to run test for this python script we are getting error message:
from msrest import Deserializer, Serializer
ImportError: cannot import name 'Deserializer'

requirements.txt
**We are also tried to use the last versions of the Python Azure SDK and clear the caches for gitlab-runner but the issue is still present **

PyYAML
colorama
azure-common~=1.1
azure-identity>=1.0.1
azure-keyvault-secrets~=4.0
azure-mgmt-keyvault~=1.0
azure-mgmt-storage~=2.0
azure-mgmt-resource~=4.0
azure-mgmt-subscription~=0.2.0
python-terraform
pyodbc
pyhcl
requests

Exception or Stack Trace

Traceback (most recent call last):
File "tools/manage.py", line 11, in
import preterraform
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/tools/preterraform.py", line 4, in
from azure.mgmt.storage import models
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/mgmt/storage/init.py", line 12, in
from .storage_management_client import StorageManagementClient
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/mgmt/storage/storage_management_client.py", line 12, in
from msrest.service_client import SDKClient
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/msrest/init.py", line 28, in
from .configuration import Configuration
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/msrest/configuration.py", line 38, in
from .universal_http.requests import (
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/msrest/universal_http/requests.py", line 41, in
from oauthlib import oauth2
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/oauthlib/oauth2/init.py", line 8, in
from .rfc6749.clients import (
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/init.py", line 9, in
from .backend_application import BackendApplicationClient
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/backend_application.py", line 10, in
from .base import Client
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 11, in
import secrets
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/tools/secrets.py", line 6, in
from azure.keyvault import secrets as client_secrets
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/keyvault/secrets/init.py", line 5, in
from ._models import DeletedSecret, KeyVaultSecret, KeyVaultSecretIdentifier, SecretProperties
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/keyvault/secrets/_models.py", line 5, in
from ._shared import parse_key_vault_id
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/keyvault/secrets/_shared/init.py", line 13, in
from .client_base import KeyVaultClientBase
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/keyvault/secrets/_shared/client_base.py", line 12, in
from .._generated import KeyVaultClient as _KeyVaultClient
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/keyvault/secrets/_generated/init.py", line 9, in
from ._key_vault_client import KeyVaultClient
File "/home/gitlab-runner/builds/kgZdCMGe/0/smart-azure/terraform-profiles/.venv-test/lib/python3.6/site-packages/azure/keyvault/secrets/_generated/_key_vault_client.py", line 17, in
from msrest import Deserializer, Serializer
ImportError: cannot import name 'Deserializer'

Setup (please complete the following information):

  • Python Version: Python 3.6
  • azure-keyvault-secrets-4.3.0
  • msrest 0.6.21
  • azure_core-1.21.1
  • azure_mgmt_subscription-3.0.0
  • azure_mgmt_keyvault-9.3.0
  • azure_identity-1.7.1
  • azure_mgmt_storage-19.0.0
  • azure_mgmt_resource-20.1.0
  • azure_common-1.1.27
  • pip 21.3.1
  • virtual environment CPython3.6.9.final.0-64

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.KeyVaultbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions