-
Notifications
You must be signed in to change notification settings - Fork 2
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
SQLite Error 19: 'FOREIGN KEY constraint failed #8
Comments
Hey, so the only foreign key constraint on the email template should be the store ID. This would suggest that maybe the store wasn't deployed. Have you tried re-exporting from the deploy dashboard in settings to make sure all uda files are on disk? |
@mattbrailsford Thanks for the reply. I went ahead and wipes out the stores on my dev environment and local. I also removed all store udas. I'm now getting this error when attempting to restore locally:
This is a weird once since it seems related to the shipping method, but the shipping method .uda looks fine. Any guidance as to what I might be missing on this? thanks again, Raymond |
Well of course minutes after I post this I found the solution. Looks like I need to assign a country to the shipping method and it seemed to work. |
Ok, I think I know where the issue lies here. We've recently done some updates around Shipping Methods so I think this is from these updates. It looks like we don't null check a new property and so it fails when it attempts to serialize it. I'll prep a nightly build and you can test that to see if it resolves things for you. |
So there is a 13.1.1--preview2 on the nightly feed now. If you'd like to give that a try and see if it resolves the issue for you. Details on how to use the nightly feed can be found here https://docs.umbraco.com/umbraco-cms/fundamentals/setup/install/installing-nightly-builds |
@mattbrailsford Really appreciate the quick response. I removed the package for now so my team can continue development. I will re-try later tonight and give you an update. thanks! |
@mattbrailsford sorry for the late response. I managed to get around to this just now and installed the nightly package on my project. I don't see the error occurring locally, however I still can't seem to get the store to show in our cloud dev environment. The deployment operation completes just fine, and the .uda's seem to exist on the server. I'm wondering if it has something to do with it being a nightly package in cloud? |
@rcisneros138 are there any errors in the tracelog? Also, if you check the dev db, is there a store entry in the database? |
@mattbrailsford So we already have a store on each environment. Before I pushed the change to my project to include the deploy package, I deleted the store in dev through back office. I then Created a new store locally, ensuring that all of the .uda were generated and pushed that up to dev. Once on dev, the deploy occurs just fine and I see the .uda's on the server, but no store will load in the settings section. I didn't think to check the DB. So i'm going to go through the process again tonight and cross reference what exists in the DB each step of the way. |
I’ve got a feeling that because we soft delete entities when the store is deploying it might be deploying to a deleted store with the same ID. |
@mattbrailsford I think you might be onto something. I'm obviously not familiar with how the source code works, but it seems like like "deleting" a store isn't removing it from the DB. I created a "demo store" and then deleted it. In the DB I queried the stores table and not only see the "demo store", but all of the stores I had created and deleted. Can you provide guidance on how to delete or remove stores completely so that I can have a sort of "clean slate"? Could I simply delete the entry in the store table? thanks, Raymond |
Also, I would like to mention that the latest build has allowed me to create a store and sync it between environments. I create a store with an alias I had not used before and it seems to function now. |
Hey Raymond, You'd need to delete all the linked entities too, so all the order statuses, payment methods, shipping methods, countries, currencies, tax classes etc. If you are right at the start of your setup, it might be easier to drop all the database tables and rerun the migration scripts to recreate the tables from fresh. We soft delete these as we need to ensure data integrity so if an order was placed with a payment method that was later deleted, we still need to display the payment method for the historic data. This usually means if you query for an entity explicitly via it's ID, it will return it if it's deleted or not. So I can see why that would be a problem here, as Umbraco Commerce Deploy will load the store explicitly and so could be loading the deleted store. I'm glad the latest release is working well for you 👍 |
Hello,
We have an Umbraco Commerce instance for an Umbraco cloud implementation.
We are running into an issue where the deploy package breaks the ability for us to create a store or update the Umbraco Schema. Here is the error we are getting on run locally.
{ "Date": "2024-02-22T10:16:53.273691-06:00", "Message": "SQLite Error 19: 'FOREIGN KEY constraint failed'.", "Ex": { "SqliteErrorCode": 19, "SqliteExtendedErrorCode": 787, "IsTransient": false, "SqlState": null, "BatchCommand": null, "ErrorCode": -2147467259, "Message": "SQLite Error 19: 'FOREIGN KEY constraint failed'.", "Data": {}, "InnerException": null, "HelpLink": null, "Source": "Umbraco.Commerce.Infrastructure", "HResult": -2147467259, "StackTrace": " at Umbraco.Commerce.Infrastructure.Resiliency.PollyExecutionStrategyBase.Execute[TResult](Func
1 operation, Func1 verifySucceeded)\n at Umbraco.Commerce.Core.UmbracoCommerceUnitOfWorkProvider.Execute(IUnitOfWorkOptions options, Action
1 action)\n at Umbraco.Commerce.Core.UmbracoCommerceUnitOfWorkProvider.Execute(Action1 action)\n at Umbraco.Commerce.Deploy.Connectors.ServiceConnectors.UmbracoCommerceEmailTemplateServiceConnector.Pass2(ArtifactDeployState
2 state, IDeployContext context)\n at Umbraco.Commerce.Deploy.Connectors.ServiceConnectors.UmbracoCommerceEmailTemplateServiceConnector.Process(ArtifactDeployState2 state, IDeployContext context, Int32 pass)\n at Umbraco.Deploy.Infrastructure.Connectors.ServiceConnectors.ServiceConnectorBase
3.Process(ArtifactDeployState dart, IDeployContext context, Int32 pass)\n at Umbraco.Deploy.Infrastructure.Environments.CurrentEnvironment.ProcessArtifacts(IEnumerable1 arts, String ownerEmail, IDeployContext context, CancellationToken token)" }, "Sender": "Umbraco.Deploy.Infrastructure.Work.WorkItems.DiskReadWorkItem" }
A few notes. We are on the latest packages for commerce and deploy. We also were forced to split the sqlite DB locally due to the ongoing Lock issue that occurs when using a sinple sqlite db.
I would appreciate any help on this as I would like to have a single store instance to pass along our environments.
Raymond
The text was updated successfully, but these errors were encountered: