This document provides solutions to common issues you might encounter when
using Storage Insights [inventory reports](https://docs.cloud.google.com/storage/docs/insights/inventory-reports) or [datasets](https://docs.cloud.google.com/storage/docs/insights/datasets).

## Common issues

This section provides guidance on how to resolve commonly-encountered issues
using inventory reports and datasets.

### Multiple inventory reports being generated daily

**Issue**: My inventory report configuration is generating multiple inventory
reports on a daily basis.

**Solution** : If you have more than 1,000,000 objects in your bucket, multiple
inventory reports can be generated as *shards* . An inventory report
configuration generates one inventory report for every 1,000,000 objects in the
bucket. For example, if you have a bucket with 3,500,000 objects, the inventory
report configuration on the bucket will generate four inventory report shards
per the frequency you specify, along with a [manifest file](https://docs.cloud.google.com/storage/docs/insights/inventory-reports#manifest-file) that contains
the number of generated inventory report shards and their file names.

### Inventory reports not appearing in the destination bucket

**Issue**: My inventory reports aren't appearing in the destination bucket.

**Solution**: If you've created an inventory report configuration and don't see
inventory reports being generated in the destination bucket, check the
following:

- Make sure the start date specified in the inventory report configuration
  matches your expectation for when inventory reports should be generated. For
  instructions on how to specify a start date, see
  [Create an inventory report configuration](https://docs.cloud.google.com/storage/docs/insights/using-inventory-reports#create-report-config).

- View your inventory report history to check for failures and their root
  causes. To see your inventory report history, complete the following steps:

  1. In the Google Cloud console, go to the Cloud Storage **Buckets** page.  

     [Go to Buckets](https://console.cloud.google.com/storage/browser)
  2. In the list of buckets, click the name of the source bucket that contains
     the inventory report configuration.

  3. On the **Bucket details** page, click the **Inventory reports** tab.

  4. In the list of inventory report configurations, click the UUID of the
     inventory report configuration that generated the reports you want to
     check.

  5. Check for failures in the **Inventory report history** section. You can
     hold the pointer over **Help** ()
     to get details about why a failure occurred.

- Make sure the project-level service agent is granted the IAM
  roles required for reading and writing inventory reports. For instructions,
  see [Grant required roles to the service agent](https://docs.cloud.google.com/storage/docs/insights/using-inventory-reports#grant-permissions-to-service-account).

### Inventory report delays

**Issue**: I'm seeing random delays with the generation of inventory reports.

**Solution**: The interval of time between inventory reports being generated
can vary. You might see a delay of up to one day.

### Datasets not getting populated

**Issue**: The Storage Insights dataset tables aren't getting populated.

**Solution** : In the `error_attributes_view` table in the linked dataset, find
the error code. Then, follow the troubleshooting steps in
[Troubleshoot dataset errors](https://docs.cloud.google.com/storage/docs/insights/dataset-tables-and-schemas#troubleshoot-error-codes).

### Null values in 'ref' column when querying datasets

**Issue** : When querying Storage Insights datasets in BigQuery, the
`ref` column returns `null`.

**Solution** : For objects ending in `/`, the `ref` column in datasets is
null.

If the `ref` column returns null values when you query Storage Insights
datasets in BigQuery, verify that you have granted the required connection
permissions and roles, including access to Cloud Storage resources, as
described in [Analyze object data and metadata using
BigQuery](https://docs.cloud.google.com/storage/docs/insights/configure-datasets#analyze-object-data).