Skip to content
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

Add migration plugin-name to hdiconfig #1453

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nils-Schiwek
Copy link

add plugin-name to .hdiconfig for migration

Without this, the migration will not work and deployment will show the following error:
Error: "src/.hdiconfig": Configuration does not define a build plugin for file suffix "hdbmigrationtable"

For me it was hard to find this information and I think it is missing in the documentation.

add  plugin-name to hdiconfig for migration
@renejeglinsky
Copy link
Contributor

Thanks @Nils-Schiwek for opening this PR. I assigned a reviewer and will keep you posted.

@LotharBender
Copy link
Contributor

LotharBender commented Nov 20, 2024

@Nils-Schiwek - just found out that cds build is adding the required .hdbmigrationtable plugin entry to the wrong .hdiconfig file. Instead of adding the entry to the .hdiconfig file generated in the db/src/gen folder, the entry must be added to the .hdiconfig file located at db/src.
On the other hand, the existing one should already contain the .hdbmigrationtable entry - do you have an idea why this isn't the case?

Note: cds add hana --for production will create a .hdiconfig file in the db/src folder for you containing all known plugin entries.

@renejeglinsky - I think we should mention this command instead of describing how to manually add this entry to the .hdiconfig file or even better a combination of both.

@renejeglinsky
Copy link
Contributor

Thanks @LotharBender ! In this guide we already mention cds add hana: https://cap.cloud.sap/docs/guides/databases-hana#configure-hana

Should we add a hint at the Schema Evolution?

@LotharBender
Copy link
Contributor

LotharBender commented Nov 20, 2024

Thanks @LotharBender ! In this guide we already mention cds add hana: https://cap.cloud.sap/docs/guides/databases-hana#configure-hana

Should we add a hint at the Schema Evolution?

@renejeglinsky - I think this would be a good idea. To be honest, I was struggling, why Capire suggests to add hana for the [hybrid] profile instead of the [production] profile - this might totally confuse users, at least myself ;-)

@Nils-Schiwek
Copy link
Author

On the other hand, the existing one should already contain the .hdbmigrationtable entry - do you have an idea why this isn't the case?

In our project, we did not yet have a migration, also no @cds.persistence.journal. It was a bit fiddly to build it in at this stage of the project. We are still on v7.9.5 so, that might also have some influence. I was impended by error messages on jenkins as my build was failing due to missing .hdiconfig entry for migration and it was hard to find that information. So I would like to improve doc with the information to keep in mind, that the .hdiconfig needs that information to run migrations.

@renejeglinsky
Copy link
Contributor

In our project, we did not yet have a migration, also no @cds.persistence.journal. It was a bit fiddly to build it in at this stage of the project. We are still on v7.9.5 so, that might also have some influence. I was impended by error messages on jenkins as my build was failing due to missing .hdiconfig entry for migration and it was hard to find that information. So I would like to improve doc with the information to keep in mind, that the .hdiconfig needs that information to run migrations.

Maybe we could add that as troubleshooting information in our troubleshooting section. Could you provide an error message we could attach this information to?

@Nils-Schiwek
Copy link
Author

In our project, we did not yet have a migration, also no @cds.persistence.journal. It was a bit fiddly to build it in at this stage of the project. We are still on v7.9.5 so, that might also have some influence. I was impended by error messages on jenkins as my build was failing due to missing .hdiconfig entry for migration and it was hard to find that information. So I would like to improve doc with the information to keep in mind, that the .hdiconfig needs that information to run migrations.

Maybe we could add that as troubleshooting information in our troubleshooting section. Could you provide an error message we could attach this information to?

Yes, the logs from btp look like this:

Error: "src/secretEntity.hdbmigrationtable": could not create a compile unit for the file [8211714] (STDERR, APP/TASK/deploy)#

Error: "src/.hdiconfig": Configuration does not define a build plugin for file suffix "hdbmigrationtable" [8210015] (STDERR, APP/TASK/deploy)#

Error: Adding "src/secretEntity.hdbmigrationtable" for deploy... failed [8211700] (STDERR, APP/TASK/deploy)#

@renejeglinsky
Copy link
Contributor

Hi @Nils-Schiwek ,
I'm still struggling to understand what happened. Have you ever executed cds add hana in your project?
I mean even if my project is new, if I add hana, then I get an db/src/.hdiconfig file with hdbmigrationtable in it. And I think this has also been the case for cds7. So does it really play a role that your project hasn't had a migration yet?
To understand it helps to write a proper troubleshooting information, so thanks for taking the time to engage with us.
Best,
René

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants