-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrading 0.5.12 to 0.6.4 failed, and directly using 0.6.4 to start the program also failed. #1274
Comments
🤖 Hi @lsg328! I'm Dosu, a friendly bot here to lend a hand. While you're waiting for a human maintainer, I'll do my best to help you solve bugs, answer queries, and guide you on your journey as a contributor. Let's iron out these wrinkles together! Based on the information you've provided, it seems like the issue you're experiencing is related to the database migration scripts between versions 0.5.12 and 0.6.4. The error "Target database is not up to date" could be due to several changes made in the migration scripts. For instance, the script tries to drop two indexes and two tables, alter a column to be non-nullable, add two new columns, and recreate the dropped tables and indexes. If any of these operations fail, it could result in the error you're seeing. You can find more details about these changes in the migration script. The SQL command "ALTER TABLE apikey ALTER COLUMN name SET NOT NULL" seems to be causing an issue. This command is trying to alter the 'name' column of the 'apikey' table to be not nullable. If there are any rows in the 'apikey' table where the 'name' column is null, this operation will fail because it would violate the new constraint of the 'name' column being not nullable. To fix this issue, you could modify the def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
try:
op.execute("UPDATE apikey SET name = 'default' WHERE name IS NULL")
with op.batch_alter_table('apikey', schema=None) as batch_op:
batch_op.alter_column('name',
existing_type=sa.VARCHAR(),
nullable=False)
except Exception as e:
pass
# ### end Alembic commands ### In this example, any null values in the 'name' column are updated to 'default' before the column is altered to be not nullable. Please adjust the default value ('default' in this case) to fit your application's needs. There are also similar solved issues in the langflow repository that you might find helpful:
I hope this helps! If you need further assistance, please provide more specific information about the database state and the exact error message. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Manually executing the SQL statement "ALTER TABLE apikey ALTER COLUMN name SET NOT NULL" can be executed normally. And if you use the new database directly (no tables exist), you will also get an error. |
@ogabrielluiz Versions after langflow0.5.12 will have this problem when using postgreSQL, whether it is an upgrade or a new environment |
🤖 Based on the information you've provided and the context from the langflow repository, it seems like you're encountering a series of errors related to database migrations when upgrading Langflow from version 0.5.12 to 0.6.4 or starting directly with version 0.6.4 with a new database. The errors you're encountering could be due to several reasons:
To resolve these issues, you could try the following:
Please note that without more specific information about your database schema and the exact errors you're encountering, it's hard to provide a more precise solution. Regarding the changes made in the migration scripts between versions 0.6.0 and 0.6.4 of Langflow, you can refer to the migration script for more details. Lastly, there are similar issues that have been solved in the langflow repository. You might find the discussions and solutions in these issues helpful:
I hope this information helps you in resolving the issues you're facing. If you need further assistance, please provide more details about your database schema and the exact errors you're encountering. Sources
|
Problems still exist with the latest version |
🤖 It seems like this issue requires a deeper look, @ogabrielluiz could you please lend your expertise? |
We will work on that ASAP. Probably today or tomorrow. |
@lsg328 Could you test version 0.6.9 if it is working on your end? |
Describe the bug
When starting Langflow with PostgreSQL, an error occurs when upgrading from 0.5.12 to 0.6.4. Even when attempting to start directly with version 0.6.4 and a new database, errors persist, specifically between versions 0.6.0 - 0.6.4.
Version
Log
upgrading from 0.5.12 to 0.6.4
start directly with version 0.6.4 and a new database
[SQL: ALTER TABLE apikey ALTER COLUMN name SET NOT NULL]
(Background on this error at: https://sqlalche.me/e/20/2j85)
Screenshots
upgrading from 0.5.12 to 0.6.4
start directly with version 0.6.4 and a new database
The text was updated successfully, but these errors were encountered: