cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

agents.deploy NOT_FOUND: The directory being accessed is not found. error

stevomcnevo007
Visitor
I keep getting the following error although the model definitely does exist and version names and model name is correct
 

RestException: NOT_FOUND: The directory being accessed is not found.

 

when calling

 
# Deploy the model to the review app and a model serving endpoint
agents.deploy(model_name, model_version, scale_to_zero=True)
 
( i'm on a free trial )
 
 

 

3 REPLIES 3

Alberto_Umana
Databricks Employee
Databricks Employee

The error message "RestException: NOT_FOUND: The directory being accessed is not found" typically indicates that the model or its version cannot be located in the specified directory. Here are a few steps you can take to troubleshoot and resolve this issue:

 

  1. Verify Model URI: Ensure that the model URI is correctly specified. The model URI should follow the format models:/<model_name>/<model_version>. Double-check for any typos in the model name or version.
  2. Check Model Registration: Confirm that the model and its version are registered in the MLflow Model Registry. You can do this by navigating to the Model Registry in the Databricks workspace and verifying that the model and version exist.
  3. Permissions: Ensure that you have the necessary permissions to access the model and its version. Lack of permissions can sometimes result in a "not found" error.
  4. Model Serving Endpoint: If you are using Unity Catalog, ensure that the model serving endpoint is correctly set up and that there are no issues with the endpoint configuration.

Here is an example of how to verify the model URI and check the model registration

 

import mlflow

 

# Set the registry URI to Databricks

mlflow.set_registry_uri("databricks-uc")

 

# Define the model URI

model_uri = f"models:/{model_name}/{model_version}"

 

# Check if the model exists

try:

    model_info = mlflow.models.get_model_info(model_uri)

    print(f"Model {model_name} version {model_version} exists.")

except mlflow.exceptions.MlflowException as e:

    print(f"Error: {e}")

When running this, getting this which looks like it's going to the default directory, this is not where the model sits I think:

Error: RESOURCE_DOES_NOT_EXIST: Routine or Model 'viable_test.default.egg_chat' does not exist.

Alberto_Umana
Databricks Employee
Databricks Employee

 

Check the code or configuration files where the model is being referenced or loaded. The path or directory of the model is often specified in these files.

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group