incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Question][config-ui] devlake admin background suddenly prompts [New Migration Scripts Detected]

Open SxjAccount opened this issue 1 year ago • 10 comments

Question

devlake has been in use for some time devlake admin background suddenly prompts [New Migration Scripts Detected]

Screenshots

24-09-03_1 24-09-03_2

Additional context

After using Devlake for a while, it was able to enter the page normally before. Today, it suddenly appeared with 'New Migration Scripts Detected'. What is the reason for the appearance of 'New Migration Scripts Detected'. I have added some tables and data to the database generated by devlake. Will clicking on 'Proceed to Database Migration' on the screen cause changes to these tables and data?

SxjAccount avatar Sep 03 '24 03:09 SxjAccount

Hey @SxjAccount! I'm here to help you with any issues or questions you have regarding the repository. I can assist with bugs, answer questions, and help you become a contributor.

I found a similar closed issue where a user encountered a problem with launching DevLake. The issue was resolved by ensuring the database was empty and redoing the installation from scratch [1].

The "New Migration Scripts Detected" notification appears because DevLake has identified new migration scripts that need to be executed to update the database schema. Clicking "Proceed to Database Migration" will execute these migration scripts. The migration process involves checking the migration_history table, sorting the scripts by Version and Name, executing them, and saving the results in the migration_history table [2].

Regarding the impact on custom tables and data you have added to the database, the migration scripts are designed to modify the database schema as defined by the scripts. If your custom tables and data are not referenced or affected by these scripts, they should remain unaffected. However, if the migration scripts include changes that impact your custom tables or data, those changes will be applied. To ensure your custom tables and data are not affected, you should review the migration scripts before proceeding [2].

For more detailed examples and best practices, you can refer to the DevLake migration documentation [2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 03 '24 03:09 dosubot[bot]

The screenshot indicates an uptime of 4 hours, suggesting a recent restart. Have you made any changes to the database during this time? Perhaps modified records in the _devlake_migration_history table?

klesh avatar Sep 03 '24 03:09 klesh

The screenshot indicates an uptime of 4 hours, suggesting a recent restart. Have you made any changes to the database during this time? Perhaps modified records in the _devlake_migration_history table?

My computer is set to turn on at 8 am and turn off at 6 PM every day. 24-09-03_3 That's my database up there, and now all of a sudden it's not working.

SxjAccount avatar Sep 03 '24 04:09 SxjAccount

How about other tables? any record? Seems like the database is corrupted. 😂

klesh avatar Sep 03 '24 06:09 klesh

How about other tables? any record? Seems like the database is corrupted. 😂

Do you know how the above situation came about? I didn't do anything with the server where devlake was installed, just set up an automatic shutdown.

SxjAccount avatar Sep 03 '24 06:09 SxjAccount

No idea, it is likely caused by your server setup.

klesh avatar Sep 03 '24 06:09 klesh

Try removing the automatic shutdown.

klesh avatar Sep 04 '24 06:09 klesh

Try removing the automatic shutdown.

I deployed and set up EC2 automatic power on/off on AWS, but this situation suddenly occurred. I would like to observe the situation further and see if it is necessary to disable the automatic power on/off function

SxjAccount avatar Sep 04 '24 06:09 SxjAccount

Absolutely! I'm genuinely curious about the outcome—please feel free to share it when you can. 🌟

klesh avatar Sep 04 '24 06:09 klesh

The screenshot indicates an uptime of 4 hours, suggesting a recent restart. Have you made any changes to the database during this time? Perhaps modified records in the _devlake_migration_history table?

My computer is set to turn on at 8 am and turn off at 6 PM every day. 24-09-03_3 That's my database up there, and now all of a sudden it's not working.

@SxjAccount From your screenshot, lots of records have gone in table _devlake_migration_history. I think it's the root cause. You can try to find why records are missing.

I am not an expert on MySQL but here are some possible reasons:

  1. There are many records but your db tool shows some of them only.
  2. They are deleted by yourself/ some cronjobs/other people.

d4x1 avatar Sep 19 '24 04:09 d4x1

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Nov 19 '24 00:11 github-actions[bot]

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Jan 19 '25 00:01 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar Jan 27 '25 00:01 github-actions[bot]