---
title: I lost access to a bucket after applying a bucket policy
description: Regain access to buckets lost due to policy issues.
tags: help troubleshooting bucket access lose policy principal
dates:
  validation: 2025-07-31
  posted: 2023-12-15
---
import Requirements from '@macros/iam/requirements.mdx'
import ImportantBucketPolicy from '@macros/storage/important-bucket-policy.mdx'


<Requirements />

- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization

## Problem

When [creating and applying a bucket policy](/object-storage/api-cli/create-bucket-policy/) to a bucket, you may lose access to the resources within the bucket if your bucket policy was not set properly.

[Bucket policies](/object-storage/api-cli/bucket-policy/) automatically deny actions to users who are not explicitly allowed by a [statement](/object-storage/api-cli/bucket-policy/#statement).

<ImportantBucketPolicy />

## Cause

If you are not explicitly allowed access to the resources in your bucket, you may see one of the following messages:

- \[CLI\] - `An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied`

- \[CLI\] - `403 AccessDenied`

- \[Console\] - `Failed to update bucket. Retry.`

- \[Console\] - `Failed to load data. Try refreshing the page.`

## Solution

<Tabs>
<TabsTab label="Scaleway console">

If you have permission to apply a bucket policy, you can also edit it or delete it using the [Scaleway console](https://console.scaleway.com).

1. Click **Object Storage** on the left side menu of the console. The Object Storage dashboard displays.

2. Click the **Bucket policies** tab.

3. Click the name of the bucket policy applied to the lost bucket.

4. Either edit it to grant yourself access, or delete it and [create a new one](/object-storage/how-to/create-bucket-policy/)
</TabsTab>
<TabsTab label="AWS CLI">

If you have the permission to apply a bucket policy, you can also delete it. To regain access to the resources stored in your bucket, you can either:

- delete the current bucket policy using the command below. The bucket will become available to every user with [IAM permissions](/iam/concepts/#permission).
    ```
    aws s3api delete-bucket-policy --bucket <BUCKET_NAME>
    ```
- [apply a new bucket policy](/object-storage/api-cli/create-bucket-policy/) in the bucket to allow yourself (or the desired principal) to perform the desired [storage operations](/object-storage/api-cli/using-api-call-list/).

</TabsTab>
</Tabs>

<Message type="note">
  Refer to the [bucket policies overview](/object-storage/api-cli/bucket-policy/) for more information on the different elements of a bucket policy.
</Message>

## Going further

- Refer to the [bucket policies overview](/object-storage/api-cli/bucket-policy/) for more information on the different elements of a bucket policy.

- If you did not manage to identify the error and solve it by yourself, [open a support ticket](/account/how-to/open-a-support-ticket/), and provide as many details as possible, along with the necessary information below:
    - Object Storage Endpoint (e.g. `s3.fr-par.scw.cloud`)
    - Bucket name
    - Object name (if the request concerns an object)
    - Request type (PUT, GET, etc.)
    - HTTP status code
    - Date and time (timestamp)
    - User-agent (SDK, client, console, etc.)
    - Transaction ID (if possible)
    - Log / trace of the error (if possible)
