HTTP status 404 index-name

i’m setting this error,but my index name is not active on dashboard?this the error im getting
{“error”:“A call to https://api.pinecone.io/indexes/“pdf-index-2024”%20%23%20PINECONE_INDEX_NAME%20is%20in%20the%20indexes%20tab%20under%20"index%20name"%20in%20blue returned HTTP status 404.”}

The 404 error message you are seeing suggests that the index you are trying to access does not exist or is not yet available. This can occur because the creation process of a Pinecone index involves multiple subsystems, and the index may not be immediately available even after the create_index() call returns. To resolve this issue, you should:

  1. Verify that the index name is correctly specified and matches the name shown in the Pinecone dashboard.
  2. Ensure that the index creation process has fully completed. You may need to wait a few moments and then refresh the dashboard to see if the index appears.
  3. Check the Pinecone dashboard under the “indexes” tab to confirm that the index is listed and active.

If the index still does not appear, you may need to retry the creation process or contact Pinecone support for further assistance

To check if your index is fully created and ready, you can use this code to wait for the index to be available. It will help you verify when your index is fully created and ready to accept requests:

import pinecone
from time import sleep

def wait_on_index(index: str):
    """ Takes the name of the index to wait for and blocks until it's available and ready. """
    ready = False
    while not ready:
        try:
            desc = pinecone.describe_index(index)
            if desc[7]['ready']:
                return True
        except pinecone.core.client.exceptions.NotFoundException:
            # NotFoundException means the index is not created yet.
            pass
        sleep(5)

This script will repeatedly check the status of the index and block until it is available and ready