safia logs command. Running safia logs 50 prints the last 50 lines from the bot daemon and usually surfaces the exact error message you need. If the logs don’t point to an obvious cause, work through the relevant section below — each entry describes the symptom, explains what’s likely wrong, and walks you through the fix.
Bot Issues
Bot is not responding to messages
Bot is not responding to messages
- The SAFIA daemon is not running
- The bot token is invalid or has been revoked
- The persistent cache file (
CACHE_DB_PATH) is unwritable
Check daemon status
Verify the cache file is writable
CACHE_DB_PATH (default data/cache.db). Make sure the directory exists and the user running SAFIA can write to it:Check your bot token
.env file and confirm TELEGRAM_BOT_TOKEN is set to the token from @BotFather. Tokens look like 123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ. If you regenerated the token in BotFather, update .env and restart:Check the logs for errors
ERROR or Exception that point to the root cause.Cache file errors in the logs
Cache file errors in the logs
data/cache.db).Likely cause: The directory for CACHE_DB_PATH does not exist, the file is owned by another user, or the disk is full.Steps to fix:Confirm the cache file path
CACHE_DB_PATH in your .env (default data/cache.db) and ensure the parent directory exists:Fix permissions
Check available disk space
Restart after making changes
CACHE_DB_PATH) so state survives bot restarts. No external cache server needs to be installed or kept running.LLM API errors — bot replies with an error or stays silent
LLM API errors — bot replies with an error or stays silent
LLM_API_KEYis missing, wrong, or has been revokedLLM_PROVIDERdoes not match the key you suppliedLLM_MODELis set to a model name your provider does not recognize
Open your configuration
Verify your provider and key
LLM_PROVIDER is one of lunos, groq, openai, or custom, and that LLM_API_KEY is the correct key for that provider.Check the model name
llama-3.3-70b-versatile, while OpenAI uses gpt-4o. Refer to your provider’s documentation and update LLM_MODEL accordingly.Check the logs
Restart after saving changes
Slow startup — bot takes a long time to become available
Slow startup — bot takes a long time to become available
safia start, the bot is unresponsive for a minute or two before beginning to work normally.Likely cause: This is expected behaviour on the first run. SAFIA downloads the local embedding model (~120 MB) before it can process messages. Subsequent startups use the cached model and are much faster.What to do:Reminders are not being sent
Reminders are not being sent
REMINDER_ENABLED is not set to true in your .env file.Steps to fix:Check the setting
REMINDER_ENABLED. It must be true (not false, empty, or missing).Set it if needed
.env:Restart SAFIA
REMINDER_MAX_PER_USER and REMINDER_MAX_SENDS_PER_DAY in .env.Voice & Photos
Voice messages are not being transcribed
Voice messages are not being transcribed
GROQ_API_KEY — even if you are using a different provider (Lunos, OpenAI, etc.) for chat.Steps to fix:Get a Groq API key
Add the key to your .env
Restart SAFIA
Verify in the logs
Photos of receipts are not being processed
Photos of receipts are not being processed
LLM_API_KEYis missing — without a valid API key, photo scanning is disabled entirely- The image is too blurry, dark, or cropped to extract text reliably
VISION_MODELis set to a model that doesn’t support vision inputs
Confirm LLM_API_KEY is set
LLM_API_KEY must be present and valid. If it’s empty, photo scanning will always report that it’s not enabled.Check VISION_MODEL
mistralai/mistral-small-3.2-24b-instruct. If you’ve changed VISION_MODEL to a text-only model, vision extraction will fail. Reset it or choose a model your provider confirms supports image input.Improve photo quality
Check the logs for API errors
Admin Dashboard
Admin dashboard is not accessible at http://127.0.0.1:5454
Admin dashboard is not accessible at http://127.0.0.1:5454
http://127.0.0.1:5454.Likely causes:- The admin dashboard daemon is not running
- Another process is already using port 5454
- You are trying to access it from a remote machine (the dashboard only binds to localhost)
Check daemon status
Check whether the port is in use
Confirm you're accessing it from the same machine
127.0.0.1 and is only reachable from the machine running SAFIA. If you need remote access, set up an SSH tunnel:http://127.0.0.1:5454 in your local browser.Check the logs
Admin dashboard login is not working
Admin dashboard login is not working
ADMIN_USERNAME, ADMIN_PASSWORD, or FLASK_SECRET_KEY is not set in .env, or the values don’t match what you’re entering.Steps to fix:Check your .env credentials
ADMIN_USERNAME and ADMIN_PASSWORD are both set to non-empty values. If they are blank, the dashboard may not enforce authentication correctly.Set a Flask secret key
FLASK_SECRET_KEY can break session handling. Add a long random string to your .env:Restart after changes
Rate Limits
'Rate limit exceeded' — reached the daily message cap
'Rate limit exceeded' — reached the daily message cap
- Wait until UTC midnight — the counter resets automatically and you can send messages again.
- Increase the limit — if you host SAFIA yourself and want a higher cap, update
DAILY_MESSAGE_LIMITin your.env:Then restart: - Reset manually — an admin can clear a user’s rate-limit counter from the dashboard at http://127.0.0.1:5454 (under Users → Reset rate limit), or by deleting the cached counter directly from the persisted cache database: