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

set_container_access_policy returns 400 Bad Request on a valid request #2378

Open
cloudtest-anon opened this issue Mar 19, 2024 · 3 comments
Assignees
Labels
blob-storage bug Something isn't working

Comments

@cloudtest-anon
Copy link

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the Azurite was used?

3.29.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

DockerHub

What's the Node.js version?

--

What problem was encountered?

API set_container_access_policy returns with 400 Bad Request on a valid request. The same request succeeds with Azure (Requests were made using the Python SDK).

Steps to reproduce the issue?

The following code should reproduce it

from azure.storage.blob import BlobServiceClient
from azure.storage.blob import PublicAccess
from azure.storage.blob import AccessPolicy

blob_service_client = BlobServiceClient.from_connection_string(f'{conn_string}')
container_client = blob_service_client.get_container_client('container')

container_client.create_container()
container_client.set_container_access_policy(signed_identifiers={'test': AccessPolicy()}, public_access=PublicAccess.Container)

azure.core.exceptions.HttpResponseError: Bad Request
ErrorCode:None

If possible, please provide the debug log using the -d parameter, replacing <pathtodebuglog> with an appropriate path for your OS, or review the instructions for docker containers:

-d "<pathtodebuglog>"

Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.

Have you found a mitigation/solution?

@EmmaZhu
Copy link
Collaborator

EmmaZhu commented Mar 20, 2024

Hi @anna-mazhar , If possible, can you share Azurite debug log?

@cloudtest-anon
Copy link
Author

Sure, here is the log generated with the code above: debug.log

@blueww blueww added bug Something isn't working blob-storage labels Mar 22, 2024
@blueww
Copy link
Member

blueww commented Mar 22, 2024

@anna-mazhar

From the debug log, we see the error is "containerAcl.AccessPolicy cannot be null or undefined."
Could you share the user scenario why you are trying to put a null/undefined access policy the container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blob-storage bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants