Warnings and errors
There are a range of warnings and errors that you may encounter in the developer tools while debugging your apps.
Warnings are notices which you should review. You should potentially take action if your app is suffering from degraded performance.
This warning occurs when an Update/Create/Delete or Set Selection action node has been run, forcing another data source to recalculate one of its runtime properties (function properties), a short time after it was last done.
Example: Data source
Order
has a runtime property Is transferred
(a function, returning true
if the property Transferred Date has value
). An action updates Transferred Date
twice. This warning will appear.This warning can be ignored in most cases. It might be worth investigating if you notice a performance issue when recalculating formulas (runtime properties as functions) on large data sources.
This warning is typically seen when performing web requests and a mapped data source is populated with data. The populated data source is runtime only, and when this is populated using a web request, an optimization is in place to ensure that potential dependencies are not recalculated. A dependency in this case is a deep data binding.
Example: A web request populates data source
Orders (runtime)
. If you try to display Orders (runtime).Customer.Name
in a view, Customer.Name
will not be updated when Orders (runtime)
is repopulated. However, if you add Customer
as a reference data source on the Orders (runtime)
, you can safely reference Orders (runtime).Customer.Name
.This warning could be ignored in most cases. If you are using deep data bindings on the populated data source, make sure to utilize reference data sources.
This warning appears when you have a Filter on a Database Connected Data Source, and you perform a Create Object into it - but the created object does not match the filter of the Data Source. The object is successfully created, but is then immediately removed from the Data Source.
Example: A Data Source
Open Tickets
with filter Ticket.Status = Open
. A Create Object creates a new Ticket into this Data Source, but the Status
is set to Completed
. Thus, a Completed ticket is created into the database, but that completed Ticket does not exist in the Data Source Open Tickets
.This error occurs when you have a runtime-only data source with cardinality one. You try to create a new object in the data source, but an object already exists in the data source.
Example: You have an action
Create project
creating a new Project in the data source Project (runtime)
. It works the first time, but fails the second time. There are two ways to solve this issue:
Option 1 (recommended): In the Create Objects action node, select the Replace Existing Object checkbox.
Option 2: Use a Delete Objects action node on the runtime data source before running the Create Objects action node.
The following errors may occur when creating or updating user accounts from an app.
- AuthorizationError: Missing required permissions to assign roles
- AuthorizationError: Missing required permissions to delete roles
- AuthorizationError: Missing required permissions to update account
- AuthorizationError: Missing required permissions to create account
These errors indicate that the logged-in user's role(s) do not have sufficient privileges to perform the operation. When performing user account operations in an app, Owners, Maintainers, and Developers role privileges are not valid.
Go to Permissions > Accounts/Roles to verify that you have the correct permissions in place. Note that your own user must be member of a custom role in order to create, update or delete users from an app - even in the Development environment. Also, verify that create, update or delete users is enabled for the environment under Environments. Read more here.
The same cause also applies to the following error messages:
- User Accounts accounts cannot be created from current environment - Check Environment settings
- User Accounts accounts cannot be deleted from current environment - Check Environment settings.
These errors can occur in the Development, Test or Staging environments.
User accounts are global resources and changes to user accounts in any environment will affect production. To prevent unintended user changes, user account manipulation operations are disabled by default in Development, Test, and Staging. Additionally, the settings are automatically reset every night.
A Foreach action node is missing a value for the Selection property. This error can also be seen in Appfarm Create with a red dot on the property.
Set a valid value in the Selection property of the Foreach action node such as All objects, Selected object(s) or Filtered selection.
Example: You read data into a
User (runtime)
data source, resulting in 0 objects. You try to run Send email with the recipient User (runtime).Email.
Your business logic is not set up correctly. Make sure the data source selected in the Recipient property contains an object, and that the email property of this object has a value.
A Delete objects action node results in no objects being deleted, since either the data source is empty, or the filter expression results in no objects for deletion.
It might also be that you have a Delete objects action node using Selected object(s), and the data source has no selected objects.
Your business logic is not set up correctly. Make sure the Delete objects action node has a valid filter or selection.
This error occurs when you have a Web request action node with Send from Client selected. When using send from client, the browser's CORS (Cross-Origin Resource Sharing) policies are triggered.
The recipient of the web request (the other application) needs to add *.appfarm.app (or your custom domain, if applicable) to their list of accepted domains in their 'Access-Control-Allow-Origin' settings.
A Web request action node returns an array of objects, and the result mapping is not set up correctly.
In Result Mapping, to map all objects from the response, make sure to set the Data Source property to a runtime-only data source with cardinality Many. If you receive an array of objects and only want to map the first item, you can use dot notation to access the first object, for example Orders.0.OrderNumber to only map the order number of the first order. See Web request for more information.
This error message is related to drag-and-drop.
Functions may exist in Runtime Properties in App Data, inside an Action (e.g a Condition) or in User Interfaces.
If this error message e.g. appears in a Persist Action Node, it's probably caused by a Runtime Only Property (Function) on a Data Source. If it appears just when navigating to a View, it's caused by a function (calculated text, visible condition etc.) inside that View.
Example: A function
return companies[0].name
can give this error message: What if companies
is an empty list? Then this function will fail with this error message. The function should handle this scenario and be set up such as this: if (companies.length>0) return ...
Go through Runtime Properties (Functions) on your Data Sources. If this message occurs when the App loads, it's probably related to a Database Connected Data Source. Check for functions which could result in errors, and handle this by adding IFs as in the above example.
This error occurs when a Function returns a data type which is not a simple data type. A simple data type is an Integer, Boolean, String, Float, ID etc. Typically, this occurs when the function returns an Object or an Array.
Example: An Update Object Action Node updates a Datetime property using the following function:
let myDate = moment().add(2,'days')
return myDate
myDate
is an Object of type moment, and not a simple data type. In the example above, the Function should return a Datetime data type.Solution: The return value needs to be changed to a simple data type. In this case, the moment.js library has a toJSON() method that converts it to a Datetime.
let myDate = moment().add(2,'days')
return myDate.toJSON()
This issue is solved by converting the return value of the function to a simple data type. In many cases, the issue is that you are returning an object, and you may often apply
.toJSON()
to the return value.This error message may occur when trying to access an App, the GraphQL Editor (
https://<yoursolution>.appfarm.app/api/graphql/
) or Swagger (the Services tool found in https://<yoursolution>.appfarm.app/api/services/
).The most frequent occurrence of this error is in the Dev-client for your Apps (when testing your App in Develop environment), and you have a large solution. In this case, the auto-deploy may cause a minor delay for the Dev-client to reload. The issue should only last for a few seconds. The exact same issue may occur for the Swagger client when testing your Services in the Dev environment.
This issue normally resolves itself after 5-30 seconds
This error may also occur in a Prod environment when not sufficient resources are available. For example, if one or more performance-heavy services are running, and the auto-scaling has reached its limit. A solution to this may be to improve the performance of the Service (optimize it) or to adjust the Schedule (if more Services are running in parallel). It might be that the limits should be adjusted as well if there is nothing to optimize (Appfarm needs to be contacted).
Example error messages:
Proxy error
(only): This may occur when the client is suspended or disabled. For example, if your solution has been suspended and the Dev client is disabled.{"code":503, "message":"Proxy error - service", "err":{"errno":-111, "code":"ECONNREFUSED","syscall":"connect","address":"NN.NN.NNN.NN", "port":5000}}
{"code":503, "message":"Proxy error - client unavailable", "err":{"errno":-111, "code":"ECONNREFUSED","syscall":"connect","address":"NN.NN.NNN.NN", "port":5000}}
These errors are usually caused by one of these reasons.
- The action tries to open a view that does not exist. This can be caused by a typo in a data bound viewId or an inconsistency between actual views and the navigate action node.
- The View exists, but is not loaded since it is corrupt and contains an error causing the parsing and inflation of the view to fail. These parsing errors should be shown in Dev Tools from the App Validation menu.
- The navigate is run in an On App Load event handler, and is run prior to the client receiveing all metadata. Note that the On App Load event is run after the App has loaded app description, data model, actions, functions and initial data, but prior to loading all layout / views.
Last modified 3mo ago