# Troubleshooting

This chapter provides the Administrator with additional information related to Application Errors and common problems in MantisBT.

Useful additional reference information and support may also be found on the MantisBT website, more specifically the Forums and the Bugtracker.

## Application Errors

Additional information about MantisBT common errors.

### Error 1502 - Category not found

This error generally occurs when the Category specified by $g_default_category_for_moves has been deleted from the database.

To resolve this issue, you need to set this parameter to a valid Category Id. This can be done either globally in config_inc.php, or via the Manage Configuration page (globally or per project).

Note: to retrieve the category ID, you can either

- Look up the value directly in the database: mantis_category_table, column 'id'

- Go to Manage Projects, click the Edit button for the desired category and look for the the value next to 'id=' in the page's URL

### Error 2800 - Invalid form security token

This error may only occur when Form Validation is enabled with $g_form_security_validation = ON. There are several known cases that could trigger it:

- Multiple submissions of a form by clicking on the submit button several times (user error)

- Invalid or unauthorized submission of a form, e.g. by hand-crafting the URL (CSRF attack)

- Expired PHP session

In the first two instances, MantisBT's behavior is by design, and the response as expected. For expired sessions however, the user is impacted by system behavior, which could not only cause confusion, but also potential loss of submitted form data. What happens is driven by several php.ini configuration settings:

- The ratio session.gc_probability divided by session.gc_divisor, which determines the probability that the garbage collection process will start when a session is initialized.

- session.gc_maxlifetime which specifies (as the name does not indicate) the minimum validity of session data.

With PHP default values, sessions created more than 1440 seconds (24 minutes) ago have a 1% chance to be invalidated each time a new session is initialized. This explains the seemingly random occurence of this error.

Unfortunately, this problem cannot be fixed without a major rework of the way sessions and form security are handled in MantisBT.

As a workaround, the Administrator can

- Increase the value of session.gc_maxlifetime

- Set $g_form_security_validation = OFF. Note that for security reasons, it is strongly recommended not to do this.

Users may also install local tools to avoid loss of form data, e.g. Lazarus Form Recovery add-on for Firefox.

Further references and reading:

- MantisBT issues 12381, 12492, 13106, 13246