Error: Could not load model


You may see an error like this when trying to Explore:

This error can happen when errors occur while parsing the LookML in the model. This is often caused by indentation errors, or LookML parameters being preceded by a - when they shouldn’t be.

For example, this would cause a Could not load model error:

- explore: orders
- joins:            # extra - here
    - join: users
      foreign_key: orders.user_id

Note the extra - before joins:. This code should look like:

- explore: orders
    - join: users
      foreign_key: orders.user_id

(Charlie Hsu) #2

Ran into this issue today on a new model, don’t forget to also check the Projects page and make sure your model is added to your project. :sweat_smile: It will work in dev mode but not in production.

(Richard) #3

So glad I found your comment - saved me hours of stress!

(Josiah Vincent) #4

Why does “Validate LookML” not catch this?

(Morgan Imel) #5

Hey @Falreign,
Are you referring to the indentation error or the model not being added to the project?

(Josiah Vincent) #6

The issue that brought me to this thread was model not being added to the project. I was surprised to see that the clicking exercise was required on the project page.

Does the current version still use the strict indentation requirements noted above?

(will.adams) #7

@Falreign Yep, the above indentation and extra - issue are a function of old lookml being derivative of YAML, so old lookml still has this requirement. New LookML has far more forgiving formatting policies, so if this is a concern I would consider converting to new LookML as outlined here: New LookML — How to convert a "YAML" LookML project

Hope this helps!