Automatic migration tool for Container Registry to Artifact registry quota exceed error

Hi Community!

I was trying to migrate to artifact registry using the migration tool performing the command:

gcloud artifacts docker upgrade migrate --projects=$PROJECT_ID

docker images were copied successfuly but after that, we get the following message:

Skipping [PROJECT_ID] due to error setting policy: Quota exceeded for quota metric ‘AnalyzeIamPolicy Requests’ and limit ‘AnalyzeIamPolicy Requests per day’ of service ‘cloudasset.googleapis.com’ for consumer ‘project_number:[number]’.

How can i solve this in order to complete the migration process?

thanks in advance

2 Likes

You’re encountering a quota limit on AnalyzeIamPolicy Requests in Cloud Asset Inventory, which is likely due to IAM policy evaluations triggered during the migration process. This restriction impacts the ability to set policies on migrated artifacts.

Recommended Actions:

  1. Verify Current Quota Usage
    Check your quota utilization to confirm if you’ve exceeded the daily limit:

Google Cloud Console:

Navigate to IAM & Admin > Quotas
Search for AnalyzeIamPolicy Requests
Review the current usage and remaining limits.
2. Request a Quota Increase
If this quota is frequently exceeded, submit a request for an increase:

Go to GCP Console → IAM & Admin > Quotas
Locate AnalyzeIamPolicy Requests per day
Click Request Increase and follow the approval process.
3. Optimize Migration to Reduce API Calls
To minimize IAM policy evaluations, consider batching the migration in smaller sets:

gcloud artifacts docker upgrade migrate --projects=$PROJECT_ID --repository=my-repo ----max-threads=5

This approach reduces the number of policy checks performed per request.

  1. Retry After Quota Reset
    This quota resets daily, so if an increase is not immediately possible, you may need to wait before retrying.

By implementing these best practices, you can mitigate quota-related interruptions and ensure a smoother migration process. Let me know if further guidance is needed!

Thanks
Vinoth_GCP

I am on Google Cloud SDK 513.0.0, yet I get:

❯❯ gcloud artifacts docker upgrade migrate --project=PROJECT_ID --batch-size=5
ERROR: (gcloud.artifacts.docker.upgrade.migrate) unrecognized arguments: --batch-size=5
1 Like

Apologies my mistake. The --batch-size not a recognized command in gcloud artifacts command. Please the --max-threads argument.

To fix the “quota exceed” error during automatic migration from Container Registry to Artifact Registry, try these steps:

Check and Increase Quotas:
Review your Google Cloud project quotas for Artifact Registry (storage, API calls, etc.) in the Cloud Console and request an increase if needed.

Clean Up Unused Images:
Delete old or unused images from both Container Registry and Artifact Registry to free up space.

Batch Migration:
Migrate images in smaller batches instead of all at once to avoid hitting quota limits.

Use Service Accounts with Proper Permissions:
Ensure the migration tool uses a service account with sufficient Artifact Registry and Container Registry permissions.

Retry with Backoff:
Implement retry logic with exponential backoff in the migration tool to handle temporary quota errors.

Monitor Quota Usage:
Use Google Cloud Monitoring to track quota usage and anticipate limits before migration.

Following these steps will help resolve quota issues and enable smooth migration.

That error isn’t with the migration tool itself—it’s hitting the Cloud Asset API quota when setting IAM policies during migration. Two ways to fix it:

  1. Wait or request a quota increase: Quotas reset daily, so you can retry tomorrow or request higher limits in the Google Cloud Console → IAM & Admin → Quotas.

  2. Batch the migration: Instead of migrating everything at once, try running the command per repository or with fewer images to reduce policy calls.

If it’s a one-time migration, the simplest path is just waiting for the quota reset. If you expect multiple migrations, requesting a quota increase is the long-term fix.