Common Issues
This guide covers the most common issues you might encounter when using Geni and how to resolve them.Error: No database url found
Error: No database url found
Error message:Cause: The Alternatively, export it in your shell:
DATABASE_URL environment variable is not set or is empty.Solution:
Set the DATABASE_URL environment variable before running any Geni command:Error: Didn't find any files ending with .up.sql
Error: Didn't find any files ending with .up.sql
Error message:Cause: The migrations folder is empty or doesn’t exist, or you’re running Geni from the wrong directory.Solution:
- Create your first migration:
- If migrations exist elsewhere, set the correct path:
- Verify the migrations folder exists:
Error: Connection timeout
Error: Connection timeout
Error message:Cause: Database is not running, incorrect connection string, or network issues.Solution:
- Verify the database is running:
- Increase the wait timeout:
- Check your connection string format matches your database:
- PostgreSQL:
postgres://user:password@host:port/database - MySQL:
mysql://user:password@host:port/database - MariaDB:
mariadb://user:password@host:port/database - SQLite:
sqlite://./path/to/file.db - LibSQL:
https://your-instance.turso.io
Error: No rollback file found
Error: No rollback file found
Error message:Cause: The corresponding
.down.sql file is missing for a migration that’s been applied.Solution:- Check if the down migration file exists:
- If missing, recreate it with the same timestamp. For migration
1709123456_create_users.up.sql, create:
- Add the rollback SQL that reverses the up migration:
Error: Transaction deadlock or lock timeout
Error: Transaction deadlock or lock timeout
Error message:Cause: Migration is trying to modify a table that’s locked by another process, or a long-running migration is blocking others.Solution:
- Run migrations outside of transactions for DDL operations that can’t be rolled back:
- Check for blocking queries:
- Ensure migrations run during low-traffic periods for production databases.
LibSQL/Turso authentication fails
LibSQL/Turso authentication fails
Error message:Cause: Missing or invalid
DATABASE_TOKEN for LibSQL/Turso databases.Solution:- Get your Turso database token:
- Set both
DATABASE_URLandDATABASE_TOKEN:
- For local LibSQL instances, ensure the URL matches your server configuration.
Schema dump fails
Schema dump fails
Error message:Cause: Required database tools (
pg_dump, mysqldump, mariadb-dump) are not installed.Solution:- Install the required tools:
- Use the slim Docker image if you don’t need schema dumps:
- Disable schema dumping:
SQLite and LibSQL don’t require external tools for schema dumping - it’s handled natively.
Migration file naming issues
Migration file naming issues
Error message:Cause: Migration files don’t follow the required naming convention.Solution:Migration files must follow this pattern:Examples:
- ✅
1709123456_create_users.up.sql - ✅
1709123456_create_users.down.sql - ❌
create_users.up.sql(missing timestamp) - ❌
1709123456-create-users.up.sql(using hyphens) - ❌
1709123456_create_users.sql(missing direction)
geni new to generate properly named files:Database-Specific Issues
PostgreSQL
SSL connection required
SSL connection required
If your PostgreSQL server requires SSL, add For development, you can disable SSL verification:
sslmode=require to your connection string:Permission denied to create database
Permission denied to create database
Ensure your database user has Or connect as a superuser:
CREATEDB privileges:MySQL/MariaDB
Authentication plugin error
Authentication plugin error
For MySQL 8.0+, you might need to use the legacy authentication:
Character set issues
Character set issues
Specify the charset in your connection string:
SQLite
Database is locked
Database is locked
SQLite doesn’t handle concurrent writes well. Ensure:
- Only one process is running migrations
- Close all connections before running migrations
- Use WAL mode for better concurrency:
File path issues
File path issues
Use absolute paths or
./ prefix for SQLite files:Debugging Tips
Enable Verbose Logging
Check pending migrations with verbose output:Verify Migration State
Check which migrations have been applied:Test Migrations Locally
- Create a test database:
- Run migrations:
- Test rollback:
- Clean up:
Validate Migration Files
Before applying migrations, validate the SQL syntax:Getting Help
If you’re still experiencing issues:- Check the GitHub issues for similar problems
- Verify you’re using the latest version:
geni --version - Review your database logs for detailed error messages
- Create a minimal reproduction case with a test database
Report an Issue
Found a bug or need help? Open an issue on GitHub with your database type, Geni version, and error message.