Closed devinbost closed 1 day ago
The error you're encountering seems to be related to an incorrect handling of database connections, specifically with the on_connection
method in the DatabaseService
class. This method is trying to access sqlite
attributes even though you're using PostgreSQL, which is causing the AttributeError
.
Here's a potential solution to address this issue:
Check the on_connection
Method: Ensure that the on_connection
method in your codebase is correctly handling the database connection type. It should only apply SQLite-specific settings when the connection is indeed an SQLite connection. The method should look something like this:
@event.listens_for(Engine, "connect")
def on_connection(dbapi_connection, connection_record):
from sqlite3 import Connection as sqliteConnection
if isinstance(dbapi_connection, sqliteConnection):
logger.info("sqlite connect listener, setting pragmas")
cursor = dbapi_connection.cursor()
try:
cursor.execute("PRAGMA synchronous = NORMAL")
cursor.execute("PRAGMA journal_mode = WAL")
cursor.close()
except OperationalError as oe:
logger.warning("Failed to set PRAGMA: ", {oe})
Ensure that this method is not being called or attempting to set SQLite-specific settings when using PostgreSQL.
Database URL Configuration: Double-check your LANGFLOW_DATABASE_URL
environment variable to ensure it is correctly set to use PostgreSQL. It should be in the format postgresql://user:password@host:port/dbname
.
Dependencies: Make sure that your environment does not have any unnecessary SQLite dependencies that might be causing conflicts. Since you're using PostgreSQL, these should not be required.
By ensuring that the on_connection
method is correctly implemented and that your environment is properly configured for PostgreSQL, you should be able to resolve this issue. If the problem persists, consider reviewing the initialization logic to ensure that it correctly distinguishes between different database backends [1].
To continue talking to Dosu, mention @dosu.
I think this may be caused by a dependency conflict from adding packages after the image is built. I'm investigating further.
same error
same error
same
I'm also getting this issue on v1.1.0
@italojohnny ?
I verified that it's not caused by any dependency issues. Even a clean build is causing this.
The problem is with the new 1.1.0 version, rollback to: FROM langflowai/langflow:v1.0.19.post2 and it works.
@zzzming FYI
Same here, trying an older version
The problem is with the new 1.1.0 version, rollback to: FROM langflowai/langflow:v1.0.19.post2 and it works.
Solved, thanks
Will there be a patch version for 1.1.0 ? And when? Thanks
Please update the docker image as soon as possible :) This is currently breaking things
Bug Description
When I try starting Langflow on my Mac (latest version) when Langflow is configured to use Postgres, I get the following exception:
Reproduction
Start langflow by starting the following docker compose file:
Expected behavior
Langflow should start normally and use Postgres, not crash due to a missing sqlite dependency.
Who can help?
No response
Operating System
Mac M1 (Apple Silicon)
Langflow Version
bleeding edge (after 1.0.19.post2)
Python Version
None
Screenshot
No response
Flow File
No response