-
Notifications
You must be signed in to change notification settings - Fork 50
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
openedx/ecommerce-job: django.db.utils.IntegrityError: (1062, "Duplicate entry '1' for key 'default_site_id'") #25
Comments
this is addressed in #27, which removes the site-id input param from ./manage.py create_or_update_site |
Hi Lawrence, sorry about the delayed answer. I think that removing the
This is what's causing the ecommerce job to fail. Sure, removing the
Then, all existing ecommerce objects will no longer be associated to that site. This situation is a real pain to resolve for platform administrators. I understand that you are facing this issue because you have existing data. To resolve this situation, may I suggest that you modify your existing partner codes ? for site ID 1 it should be "dev" and for site ID 2 "openedx". |
Closing this for now. Feel free to re-open if the issue is still affecting you. |
This is not resolved. Anyone migrating an ecommerce database from pre-tutor will be affected by this problem. i followed your suggestion above for my most recent project. that worked, thanks. however .... this problem exists because the plugin forcefully and explicitly adds a dev site as site_id = 1, which, as one might reasonably assume, is probably going to be the existing site_id for any legacy db being migrated. your suggestion worked, but it's cumbersome and aggressive. i'd very much like to not have to repeat it for future migrations. maybe a more graceful solution would be to make the dev site an option that's defaulted to true? i'm happy to do that work, and submit it as a PR, provided however that you're already on board with the strategy, conceptually. |
I agree that hard-coding the site ID is inappropriate; unfortunately I don't have time right now to have a more in-depth look at this issue. I'll re-open this and will take some time to figure out whether removing the --site-id option is the right solution for everyone. |
FTR, this same error was also reported here: https://discuss.openedx.org/t/ecommerce-plugin-error-duplicate-entry-1-for-key-default-site-id/9463 |
The ecommerce job does not take upgrades into consideration. In my case the ecommerce database comes from a native installation of Lilac and contains considerable transaction data that i definitely do not want to have to attempt to migrate table-by-table given the complexity of the oscar db.
openedx/ecommerce-job raises the following error:
The text was updated successfully, but these errors were encountered: