Skip to content

Cannot Store Forecast After Initial Store #1618

@rma-bryson

Description

@rma-bryson

Describe the bug
After initial creation of a forecast instance, any subsequent patch will fail. Issue appears to be related to storing a null spec-id.

Expected behavior
This should update the existing forecast instance, rather than failing with an exception.

To Reproduce
Steps to reproduce the behavior:

  1. Create a forecast instance and store
  2. Attempt to store the same forecast instance
  3. See error

Logs/Incident Identifier
3-Mar-2026 10:10:15.876 WARNING [http-nio-auto-1-exec-10] cwms.cda.ApiServlet.lambda$init$8 error on request[2db143e2-a925-488b-a62e-34716aa1ab9b]: /cwms-data/forecast-instance/
org.jooq.exception.IntegrityConstraintViolationException: SQL [{ call "CWMS_20"."CWMS_FCST"."STORE_FCST" (?, ?, cast(? as date), cast(? as date), ?, ?, ?, ?, ?, ?, ?, ?) }]; ORA-01400: cannot insert NULL into ("CWMS_20"."AT_FCST_INST"."FCST_SPEC_CODE")

Additional context
This is blocking work for Extract/Post enhancements, which requires storing a forecast instance more than once. There is an existing integration test for create/update, but it is disabled with a comment describing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions