Repository navigation
Troubleshooting
This page lists problems that happen in real installations, what causes each one and how to fix it. If yours is not here, look for the error in logs/error.log (see Logs and Security Events) and then open an issue with the log line (remove anything personal first).
Symptom: every page, and every kaw-cake command, fails with an error about the security salt.
Cause: SECURITY_SALT is empty or shorter than 32 characters, or the environment file was not read.
Fix: check that the variable is in the file and long enough, then restart Apache.
sudo grep -c '^SECURITY_SALT=.\{34,\}' /etc/keyanywhere/keyanywhere.envThe command prints 1 when the value is there and has at least 32 characters. If it prints 0, generate one as in Generating Security Keys. If it prints 1 and Apache still fails, check that /etc/apache2/envvars loads the file (Environment Variables, step 3).
Symptom: every page and every kaw-cake command fails with server does not support SSL, but SSL was required.
Cause: since 2.4.1, KeyAnyWhere connects to PostgreSQL with sslmode=require, and this PostgreSQL has SSL turned off.
Fix: turn SSL on in PostgreSQL (ssl = on in postgresql.conf, with a certificate; Debian ships one) and restart it:
sudo -u postgres psql -c 'ALTER SYSTEM SET ssl = on;'sudo systemctl restart postgresqlIf the database is on the same machine and you prefer not to use SSL, lower the requirement in config/app_local.php (Configuration Files) instead:
'Datasources' => [
'default' => [
'ssl_mode' => 'prefer',
],
],Symptom: a form submission fails with this message.
Cause: the browser still has a CSRF cookie signed with an older SECURITY_SALT (the salt was replaced, or KeyAnyWhere was reinstalled on the same domain).
Fix: reload the page (a GET) and submit again. KeyAnyWhere drops a CSRF cookie whose signature doesn't match the current salt on the next GET, and issues a new one.
Symptom: "A configuração inicial não foi autorizada" (The first-run setup was not authorized).
Cause: the address has no token, a wrong token, or CONFIG_INICIAL_TOKEN is shorter than 32 characters or missing on the server.
Fix: print the address again with the command in First-Run Setup, step 1.
Symptom: a CLI command fails with a connection error, while the site works.
Cause: the command was run as bin/cake (which doesn't read /etc/keyanywhere/keyanywhere.env) or as a user that can't read the file.
Fix: always run CLI commands as www-data through kaw-cake:
sudo -u www-data kaw-cake migrations statusCause: with debug off, KeyAnyWhere accepts only HTTPS. This is on purpose.
Fix: set up the certificate on Apache itself, as in Web Server and HTTPS. KeyAnyWhere doesn't trust proxy headers (X-Forwarded-Proto), so a proxy or load balancer that ends HTTPS and talks plain HTTP to Apache is not supported: keep HTTPS all the way to Apache.
Symptom: after a restore or a move to a new server, entries open with an error, or their fields come out empty.
Cause: KEY_CRIPTOGRAFIC is not the one the data was encrypted with.
Fix: put back the original key from your offline copy. There is no other way: without the original key, the data cannot be read.
Symptom: "Permission denied" in tmp/ or logs/, or errors about missing columns right after an upgrade.
Fix: run steps 4 and 5 of Upgrading again: migrations, cache clear, permissions and an Apache restart.
Source code · Issues · Releases · Packagist · Online demo · Hosted edition
1. Getting started
2. Installing in production
- Overview
- Preparing the Server
- Installing KeyAnyWhere
- File Permissions
- Generating Security Keys
- Environment Variables
- Configuration Files
- Database Setup
- Insecure Password Catalog
- Web Server and HTTPS
- First-Run Setup
3. Operating your installation
4. Using KeyAnyWhere
5. Security
6. Development
7. Extending