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

[azure-storage-blob] snapshot value is None although snapshot value is specified in get_blob_properties() #13287

Closed
Juliehzl opened this issue Aug 24, 2020 · 7 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@Juliehzl
Copy link

  • Package Name: azure-stoage-blob
  • Package Version: 12.4.0
  • Operating System: Win 10
  • Python Version:

Describe the bug
A clear and concise description of what the bug is.
get_blob_properties() with snapshot specified. There is no snapshot value in response.
Http call can be seen as follow:

urllib3.connectionpool : https://zuhdefault.blob.core.windows.net:443 "HEAD /test4/test0.txt?snapshot=2020-08-24T05:59:29.3172939Z HTTP/1.1" 200 0
azure.core.pipeline.policies.http_logging_policy : Response status: 200
azure.core.pipeline.policies.http_logging_policy : Response headers:
azure.core.pipeline.policies.http_logging_policy :     'Content-Length': '1200'
azure.core.pipeline.policies.http_logging_policy :     'Content-Type': 'application/octet-stream'
azure.core.pipeline.policies.http_logging_policy :     'Content-MD5': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'Last-Modified': 'Mon, 24 Aug 2020 05:27:04 GMT'
azure.core.pipeline.policies.http_logging_policy :     'Accept-Ranges': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'ETag': '"0x8D847EE55E77ECD"'
azure.core.pipeline.policies.http_logging_policy :     'Vary': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'Server': 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-request-id': '9183f180-701e-00c7-29dd-79627c000000'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-client-request-id': 'fe74f59e-e5d0-11ea-9784-186024942c80'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-version': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-tag-count': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-meta-a': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-meta-c': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-or-64344fa7-ec2c-46ab-8558-aad0bab6961e_6fa6f33a-6b8b-4639-aca1-00cd1babcb45': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-creation-time': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-blob-type': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-server-encrypted': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-access-tier': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'x-ms-access-tier-change-time': 'REDACTED'
azure.core.pipeline.policies.http_logging_policy :     'Date': 'Mon, 24 Aug 2020 06:13:58 GMT'
Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x0000023FC7AB39D8>, <function _x509_from_base64_to_hex_transform at 0x0000023FC7AB3A68>]
Event: CommandInvoker.OnFilterResult []
{
  "container": "test4",
  "content": "",
  "deleted": false,
  "encryptedMetadata": null,
  "encryptionKeySha256": null,
  "encryptionScope": null,
  "isAppendBlobSealed": null,
  "isCurrentVersion": null,
  "metadata": {
    "a": "b",
    "c": "d"
  },
  "name": "test0.txt",
  "objectReplicationDestinationPolicy": null,
  "objectReplicationSourceProperties": [
    {
      "policyId": "64344fa7-ec2c-46ab-8558-aad0bab6961e",
      "rules": [
        {
          "ruleId": "6fa6f33a-6b8b-4639-aca1-00cd1babcb45",
          "status": "failed"
        }
      ]
    }
  ],
  "properties": {
    "appendBlobCommittedBlockCount": null,
    "blobTier": "Hot",
    "blobTierChangeTime": "2020-08-14T06:55:16+00:00",
    "blobTierInferred": null,
    "blobType": "BlockBlob",
    "contentLength": 1200,
    "contentRange": null,
    "contentSettings": {
      "cacheControl": null,
      "contentDisposition": null,
      "contentEncoding": null,
      "contentLanguage": null,
      "contentMd5": "4edJNByMxQgCm9dVVN4KWQ==",
      "contentType": "application/octet-stream"
    },
    "copy": {
      "completionTime": null,
      "destinationSnapshot": null,
      "id": null,
      "incrementalCopy": null,
      "progress": null,
      "source": null,
      "status": null,
      "statusDescription": null
    },
    "creationTime": "2020-08-14T06:55:16+00:00",
    "deletedTime": null,
    "etag": "\"0x8D847EE55E77ECD\"",
    "lastModified": "2020-08-24T05:27:04+00:00",
    "lease": {
      "duration": null,
      "state": null,
      "status": null
    },
    "pageBlobSequenceNumber": null,
    "pageRanges": null,
    "rehydrationStatus": null,
    "remainingRetentionDays": null,
    "serverEncrypted": true
  },
  "rehydratePriority": null,
  "requestServerEncrypted": true,
  "snapshot": null,
  "tagCount": 3,
  "tags": null,
  "versionId": null
}

To Reproduce
Steps to reproduce the behavior:

  1. get_blob_properties() with snapshot

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 24, 2020
@kaerm kaerm added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Aug 24, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 24, 2020
@kaerm kaerm added the Service Attention Workflow: This issue is responsible by Azure service team. label Aug 24, 2020
@ghost
Copy link

ghost commented Aug 24, 2020

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

@tasherif-msft tasherif-msft self-assigned this Aug 25, 2020
@tasherif-msft
Copy link
Contributor

Hi @Juliehzl,
I will look into the issue and will update you.

Thank you :)

@tasherif-msft
Copy link
Contributor

Hi @Juliehzl, so the response does not contain the snapshot string. get_blob_properties will provide you with all the properties of the specified snapshot, but the response headers that are sent back do not include the snapshot string.
Is there a specific use case as to why you might need this?

Let me know.

@xiafu-msft
Copy link
Contributor

Hi @Juliehzl

when you list blobs including snapshot like this the snapshot will be set.
container.list_blobs(include='snapshots')
@tasherif-msft is right, get_blob_properties will not give you the snapshot value. While the return type for get_blob_properties is BlobProperties which is also used by list_blobs, so the snapshot is there.

@Juliehzl
Copy link
Author

Hi @xiafu-msft , I can list with snapshot. But because in track1 SDK, get_blob_properties() will return snapshot value, which will cause breaking change for CLI side. So I have some concern here.

@xiafu-msft
Copy link
Contributor

Hi @Juliehzl

We can add the snapshot to the returned object of get_blob_properties() if that would make it convenient on CLI side!
I added another commit to this pr 6e64509

@tasherif-msft
Copy link
Contributor

@Juliehzl the PR resolving this issue has been merged and will be released tomorrow!
I will close this issue.

Let us know if anything else comes up.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

4 participants