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

ForeignKeyViolation in operationplanresource_operationplan_id_fkey #578

Open
zipus opened this issue Nov 18, 2022 · 1 comment
Open

ForeignKeyViolation in operationplanresource_operationplan_id_fkey #578

zipus opened this issue Nov 18, 2022 · 1 comment

Comments

@zipus
Copy link
Contributor

zipus commented Nov 18, 2022

INFO Finished 'Generate supply plan' at 08:10:57 

INFO Start step 400 'Erasing previous plan' at 08:10:57
INFO Finished 'Erasing previous plan' at 08:10:58 

INFO Start step 401 'Export plan' at 08:10:58
INFO Start step export2 1 'Exporting resource plans' at 08:10:58
INFO Start step export1 1 'Exporting operationplans' at 08:10:58
INFO Finished 'Exporting resource plans' at 08:10:58 
INFO Start step export2 2 'Exporting problems' at 08:10:58
INFO Finished 'Exporting problems' at 08:10:58 
INFO Start step export2 3 'Exporting constraints' at 08:10:58
INFO Finished 'Exporting constraints' at 08:10:58 
INFO Finished 'Exporting operationplans' at 08:10:58 
INFO Start step export1 2 'Exporting operationplan materials' at 08:10:58
INFO Finished 'Exporting operationplan materials' at 08:10:58 
INFO Start step export1 3 'Exporting operationplan resources' at 08:10:58
ERROR Exception caught on thread export1
Error during planning: insert or update on table "operationplanresource" violates foreign key constraint "operationplanresource_operationplan_id_fkey"
DETAIL:  Key (operationplan_id)=(47227) is not present in table "operationplan".

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/freppledb/common/commands.py", line 546, in <module>
    register.run(database=database)
  File "/usr/lib/python3/dist-packages/freppledb/common/commands.py", line 489, in run
    cls.reg.run(**cls.arguments)
  File "/usr/lib/python3/dist-packages/freppledb/common/commands.py", line 217, in run
    step.run(**PlanTaskRegistry.getArguments())
  File "/usr/lib/python3/dist-packages/freppledb/common/commands.py", line 336, in run
    raise t.exception
  File "/usr/lib/python3/dist-packages/freppledb/common/commands.py", line 298, in run
    self.seq.run(**self.kwargs)
  File "/usr/lib/python3/dist-packages/freppledb/common/commands.py", line 217, in run
    step.run(**PlanTaskRegistry.getArguments())
  File "/usr/lib/python3/dist-packages/freppledb/output/commands.py", line 1178, in run
    sep="\v",
psycopg2.errors.ForeignKeyViolation: insert or update on table "operationplanresource" violates foreign key constraint "operationplanresource_operationplan_id_fkey"
DETAIL:  Key (operationplan_id)=(47227) is not present in table "operationplan".

Error: Error executing Python command
@zipus
Copy link
Contributor Author

zipus commented Feb 16, 2023

The same sale orders is well planned when plan.administrativeLeadtime is set to 0, but when setting to 999 results in this crash.
Now that is isolated that this parameter is causing this, do you have any ideas about the cause?

Attached log result with 999 parameter.
frepple-20230216101844.log

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

No branches or pull requests

1 participant