Instance data is not valid

I have read through:


which covers this issue, despite having a different header.
I have this issue on a new child db I have called ‘test’ (I also get the error with the parentdb) and I therefore supply the requested data, for reviewing this issue, below:

Map(Paginate(Databases()), Lambda("x",Get(Var("x"))))
Map(Paginate(Collections()), Lambda("x",Get(Var("x"))))
Map(Paginate(Indexes()), Lambda("x",Get(Var("x"))))
Map(Paginate(Functions()), Lambda("x",Get(Var("x"))))

{
  data: [
    {
      ref: Ref(Ref("functions"), "all_user_names"),
      ts: 1599619167500000,
      name: "all_user_names",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allUserNames",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_user_names",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  List: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_user_names was not implemented yet. Please access your database and provide an implementation for the all_user_names function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "all_player_challenger_addresses"),
      ts: 1599619167500000,
      name: "all_player_challenger_addresses",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allPlayerChallengerAddresses",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_player_challenger_addresses",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  List: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_player_challenger_addresses was not implemented yet. Please access your database and provide an implementation for the all_player_challenger_addresses function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "create_new_player"),
      ts: 1599619167500000,
      name: "create_new_player",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Mutation",
            field: {
              name: "createNewPlayer",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "create_new_player",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  Named: "Player"
                }
              },
              arguments: [
                {
                  name: "active",
                  type: {
                    NotNull: {
                      Named: "Boolean"
                    }
                  }
                },
                {
                  name: "address",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "rank",
                  type: {
                    NotNull: {
                      Named: "Int"
                    }
                  }
                },
                {
                  name: "challengeraddress",
                  type: {
                    Named: "String"
                  }
                }
              ]
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function create_new_player was not implemented yet. Please access your database and provide an implementation for the create_new_player function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "all_userjoinedranking"),
      ts: 1599619167500000,
      name: "all_userjoinedranking",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allUserJoinedRanking",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_userjoinedranking",
                    paginated: false
                  }
                }
              ],
              type: {
                List: {
                  Named: "UserJoinedRanking"
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_userjoinedranking was not implemented yet. Please access your database and provide an implementation for the all_userjoinedranking function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "create_new_userjoinedranking"),
      ts: 1599619167500000,
      name: "create_new_userjoinedranking",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Mutation",
            field: {
              name: "createNewUserJoinedRanking",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "create_new_userjoinedranking",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  Named: "UserJoinedRanking"
                }
              },
              arguments: [
                {
                  name: "active",
                  type: {
                    NotNull: {
                      Named: "Boolean"
                    }
                  }
                },
                {
                  name: "rankingid",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "rankingname",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "useraddr",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "rankingowneraddr",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function create_new_userjoinedranking was not implemented yet. Please access your database and provide an implementation for the create_new_userjoinedranking function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "all_rankings"),
      ts: 1599619167500000,
      name: "all_rankings",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allRankings",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_rankings",
                    paginated: false
                  }
                }
              ],
              type: {
                List: {
                  Named: "Ranking"
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_rankings was not implemented yet. Please access your database and provide an implementation for the all_rankings function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "all_player_ranks"),
      ts: 1599619167500000,
      name: "all_player_ranks",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allPlayerRanks",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_player_ranks",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  List: {
                    NotNull: {
                      Named: "Int"
                    }
                  }
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_player_ranks was not implemented yet. Please access your database and provide an implementation for the all_player_ranks function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "all_players"),
      ts: 1599619167500000,
      name: "all_players",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allPlayers",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_players",
                    paginated: false
                  }
                }
              ],
              type: {
                List: {
                  Named: "Player"
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_players was not implemented yet. Please access your database and provide an implementation for the all_players function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "all_player_addresses"),
      ts: 1599619167500000,
      name: "all_player_addresses",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allPlayerAddresses",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_player_addresses",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  List: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_player_addresses was not implemented yet. Please access your database and provide an implementation for the all_player_addresses function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "all_users"),
      ts: 1599619167500000,
      name: "all_users",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Query",
            field: {
              name: "allUsers",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "all_users",
                    paginated: false
                  }
                }
              ],
              type: {
                List: {
                  Named: "User"
                }
              }
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function all_users was not implemented yet. Please access your database and provide an implementation for the all_users function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "create_new_ranking"),
      ts: 1599619167500000,
      name: "create_new_ranking",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Mutation",
            field: {
              name: "createNewRanking",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "create_new_ranking",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  Named: "Ranking"
                }
              },
              arguments: [
                {
                  name: "active",
                  type: {
                    NotNull: {
                      Named: "Boolean"
                    }
                  }
                },
                {
                  name: "rankingname",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "rankingdesc",
                  type: {
                    Named: "String"
                  }
                },
                {
                  name: "rankingowneraddr",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function create_new_ranking was not implemented yet. Please access your database and provide an implementation for the create_new_ranking function."
          )
        )
      )
    },
    {
      ref: Ref(Ref("functions"), "create_andor_login_user"),
      ts: 1599619167500000,
      name: "create_andor_login_user",
      data: {
        gql: {
          ts: Time("2020-09-09T02:39:27.306193Z"),
          meta: {
            location: "Mutation",
            field: {
              name: "createAndOrLoginUser",
              directives: [
                {
                  name: "resolver",
                  args: {
                    name: "create_andor_login_user",
                    paginated: false
                  }
                }
              ],
              type: {
                NotNull: {
                  Named: "String"
                }
              },
              arguments: [
                {
                  name: "active",
                  type: {
                    NotNull: {
                      Named: "Boolean"
                    }
                  }
                },
                {
                  name: "username",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "password",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "ethaddress",
                  type: {
                    NotNull: {
                      Named: "String"
                    }
                  }
                },
                {
                  name: "description",
                  type: {
                    Named: "String"
                  }
                },
                {
                  name: "email",
                  type: {
                    Named: "String"
                  }
                },
                {
                  name: "mobile",
                  type: {
                    Named: "String"
                  }
                }
              ]
            }
          }
        }
      },
      body: Query(
        Lambda(
          "_",
          Abort(
            "Function create_andor_login_user was not implemented yet. Please access your database and provide an implementation for the create_andor_login_user function."
          )
        )
      )
    }
  ]
}

>> Time elapsed: 48ms

The Schema:

type User 
 {  
    active : Boolean!
    username : String! @unique
    password : String! @unique
    ethaddress : String! @unique
    description : String
    email : String @unique 
    mobile : String @unique
    member_since: Int!
}

type Player 
 {  address : String! @unique
    rank : Int!
    challengeraddress : String
}

type Ranking
  { 
    active : Boolean!
    rankingname : String! @unique
    rankingdesc : String
    rankingowneraddr : String! @unique
    }

type UserJoinedRanking
  { 
    active : Boolean!
    rankingid : String!
    rankingname : String!
    useraddr : String!
    rankingowneraddr : String!
    }


type Mutation {
  createAndOrLoginUser(active: Boolean!, username: String!, password: String!, ethaddress: String!, description: String, email: String, mobile: String): String! @resolver(name: "create_andor_login_user")
  createNewPlayer(active: Boolean!, address: String!, rank: Int!, challengeraddress: String): Player! @resolver(name: "create_new_player")
  createNewRanking(active: Boolean!, rankingname : String!, rankingdesc : String, rankingowneraddr : String!): Ranking! @resolver(name: "create_new_ranking")
  createNewUserJoinedRanking(active: Boolean!, rankingid : String!, rankingname : String!, useraddr: String!, rankingowneraddr : String!): UserJoinedRanking! @resolver(name: "create_new_userjoinedranking")
}

type Query {
  allUserNames: [String!]! @resolver(name: "all_user_names")
  allPlayerAddresses: [String!]! @resolver(name: "all_player_addresses")
  allPlayerRanks: [Int!]! @resolver(name: "all_player_ranks")
  allPlayerChallengerAddresses: [String!]! @resolver(name: "all_player_challenger_addresses")
  allPlayers: [Player] @resolver(name: "all_players")
  allRankings: [Ranking] @resolver(name: "all_rankings")
  allUserJoinedRanking: [UserJoinedRanking] @resolver(name: "all_userjoinedranking")
  allUsers: [User] @resolver(name: "all_users")
  usernameFromEthaddress: [String!]!
}


What changes do I need to make to my configurations (schema or otherwise) to enable regular schema updates (parent and child dbs) without further complications (if possible), to avoid this error? thanks …

@FreeRoss Thanks for bringing this to our attention. I was able to repro this issue with your schema file. The error is coming from the query.

usernameFromEthaddress: [String!]!

Looks like you are missing an input type and @resolver directive.
Something like this if you were expecting a list of username for a given ethaddress.

usernameFromEthaddress(ethaddress: String!): [String!]! @resolver(name: "usernameFromEthaddress")

1 Like

Thanks @Jay. For practical purposes that fixed it when I upload the schema from my project terminal. However, the UI still gives the ‘Instance data is not valid.’ error when I attempt to update the schema via the web UI.
I can work with it for now, but I presume you will want to determine what’s causing the UI problem to avoid future issues on this matter.

@FreeRoss, If you were able to import through project terminal successfully then you should be able to import from UI too. Can you please double check if its the same schema file ?

@Jay, I tried it again with same message today. I only have 1 project and 1 schema file. There is no other file for me to confuse it with. I copied the file path and viewed the same schema from my file system, rather than from the browser dialogue used by the UI, as an extra check.
If it’s any help my Chrome version is:
Version 84.0.4147.105 (Official Build) (64-bit)
Under Linux Mint 18.3
Don’t worry about me on this issue, I can work with the terminal. But I’m happy to assist with any further details you may require to fix the in browser behavior which might generate a lot unnecessary support tickets …

Are there any new indexes being created? I’ve also experienced that the UI causes this error while uploading from the Dashboard but does return errors while uploading from a script/terminal.

I’ve mentioned this several places on the forums and no one has challenged me on that. @Jay ‘s comment here that it shouldn’t happen would be the first.

Hi @ptpaterson. I had created new indexes and I attempted to specify them correctly in the schema. It required Jay’s addition of @resolver to get it right.
Yes, I believe I saw your posts which were helpful when I came across the same issue. Although, for now, for this specific error, it appears to be a straightforward (from a user’s perspective) UI problem to be ignored until it’s fixed …

@FreeRoss @ptpaterson Thanks a mil for your inputs. I have created a low priority ticket for Front End team to take a look. Meanwhile, if you come across this issue again, please try to take a copy of browser logs from Developer Tools and retry clearing Application Cache in browser. Something like below.

Hi @Jay

I have cleared the application cache in browser.
Here is a copy of browser logs from Developer Tools after attempting to import the schema:


Please note that clicking ‘Play’ in Playground doesn’t now appear to do anything for some of my commands (one simple query with a Basic auth works as before). Please let me know if there’s an obvious reason based on above (e.g. clear app cache) and what I should do to fix? If it persists I can post this as a separate issue …
Thanks …

@FreeRoss were you able to solve this ?

@Jay No. I just tried again with a successful schema upload and import from a terminal within VSCode. But I still get ‘instance data is not valid’ from the Fauna UI on ‘update schema’.
Whilst it would be nice if this issue was resolved it is currently a low priority for me as it isn’t materially affecting my development.
However, @Luigi_Servini has been helping me with
https://forums.fauna.com/t/re-auto-created-query-returns-null/660/6
and I am not currently sure how to proceed. The query in question is fundamental to the operation of my app and currently I cannot get it to work with a user specific token (it works with a key) in the Playground. It’s possible I can get it to work directly from the app, but I’m not yet in a position to try that. It would be re-assuring to get it working in the Playground first, which, I believe, is the purpose of the Playground. If you can assist in this issue in any way that would be very helpful … thanks …