Compiled page/application errors and how to solve them

Some quick solutions for error-handling in your Betty Blocks application.

After reading this article, you'll know:

  • What causes some errors within the platform

  • How to solve certain errors

Errors while building pages

Common errors that you might encounter when you're building a page.

GraphQL error: Unauthorized for models(s): Model name

You'll encounter this error if you lack the 'read permission' for the model containing the data you're trying to access.

GraphQL error: Unauthorized for models(s)

This can be fixed by changing the permission for the model:

Changing th permission of a model

You can find the Roles and permissions tab either in the data model itself or inside the Tools section.

You can also use an authentication profile on the page instead of changing the permission. If someone without an authentication profile lands on the page no data will be shown and the user gets redirected to the login page of the application.

Oops! An error occured!

This error occurs when you delete items a page references, such as another page or a partial. For example, if you delete a page that another page references, you'll encounter this error message when trying to compile the referencing page. Below is an example where an interaction redirects to a deleted page after an action is executed successfully.

Oops! An error occured!
Showcasing an interaction with a deleted page as the target for a redirect

To solve this error restore the missing item in the interaction or delete the interaction that gives you an error.

The same error can also be encountered when you delete a partial that's used on different pages. When the partial is deleted but the pages aren't recompiled yet, this error will pop up as well.


A separate error with the same name can also be encountered when you're working with dates:

This error is caused by adjusting the input of date- and time picker components:

Ensure that you use proper formatting when you change the format option within these components, for example, use 'yyyy' instead of 'YYYY'.

 

GraphQL error: Conditional '_and' cannot have an empty value.

This error shows up when the data query that's performed returns an error. This can happen when you use any of the data components such as the:

  • Data container

  • Data list

  • Data table

When you create a page with an input variable like the image below:

Creating a page with an input variable

When you use that input in a filter on a Data container (which is something we don't recommend using, use Page variables instead), when you compile the page no 'id' is provided in the URL resulting in the error popping up:

Compiling a detail page with the ':id' in the URL instead of an actual id

If you change the ':id' part in the URL with an id of an object that does exist the page will load like you'd expect it to.

Error: Unauthenticated. Authorization header invalid.

You'll encounter this error when you're not authorized to run an action. For example, if you use a create form and the action behind the form is set to private, when you compile the page and try to create a new record this error will pop up.

There are two ways to resolve this error and grant the necessary permissions to run the action:

  • Change the action to public: Make the action itself publicly accessible within the application.

  • Assign an authentication profile: Assign an authentication profile to the action. However, ensure that the user attempting to run the action has the corresponding authentication profile assigned to their account.

GraphQL error: in object 'Model' in the fields 'Property' are not found.

This error is triggered when a builder deletes a property in, for example, a Data table while another user is visiting the compiled page in question.

To resolve this error the builder needs to fix the missing property references that are missing or delete the column in the Data table that references the missing property.

 

Couldn't fetch data (render children)

This error appears in a situation like a Conditional component with a Data container inside. The data inside the Data container might not be loaded when the Conditional component has already been fired. The query of the Data container might be taking longer than the logic of the Conditional component, this will result in the error popping up.

To prevent this from happening we can check the following checkbox inside of the Conditional component.

Render children checkbox

When this option is checked, the Conditional component will only show its content when the data inside of it has been loaded. So once the queries are done and the Data container is ready to show its data, at that moment the content of this component will be shown, without an error.

 

Actions

Common errors that you might encounter when you're building an action.

Error: cannot compare to null

This error occurs when you use the filter in a variable that might not exist. For example, the variable used in the filter doesn't always have a value meaning that the value results in 'null'. This is a value that you might not expect hence the error popping up.

To work around this you can make use of the Expression step specifically, the Always return numeric value function in case of working with numeric values or the Ternary operator (if then else) when working with other data.