Skip to content

Creating a location group copied from another CWMS instance fails with Cannot insert NULL error #1658

@DanielTOsborne

Description

@DanielTOsborne

Inserting the following fails on CWBI-dev, using /cwms-data/location/group endpoint:

{
	"office-id": "SPK",
	"id": "Tulare",
	"location-category": 
	{
		"office-id": "SPK",
		"id": "Basin"
	},
	"description": "Tulare Basin",
	"assigned-locations": 
	[
		{"location-id": "Isabella Dam",	"office-id": "SPK", "attribute": 0},
		{"location-id": "Pine Flat Dam", "office-id": "SPK", "attribute": 1},
		{"location-id": "Success Dam", "office-id": "SPK", "attribute": 2},
		{"location-id": "Terminus Dam", "office-id": "SPK", "attribute": 3},
		{"location-id": "Lake Isabella-Pool West", "office-id": "SPK"},
		{"location-id": "Lake Isabella", "office-id": "SPK"},
		{"location-id": "Lake Isabella-PC05", "office-id": "SPK"},
		{"location-id": "Lake Isabella-PC06", "office-id": "SPK"},
		{"location-id": "Lake Isabella-PC09", "office-id": "SPK"}
	]
}

Error:

26-Mar-2026 18:20:36.210 WARNING [http-nio-7000-exec-673] cwms.cda.ApiServlet.lambda$init$8 error on request[58a2d0e3-8a9f-4833-816d-b19ef6c2b821]: /cwms-data/location/group 
warn 
		at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:83) 
		at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509) 
		at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461) 
		at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104) 
	Caused by: Error : 1400, Position : 0, Sql = BEGIN "CWMS_20"."CWMS_LOC"."ASSIGN_LOC_GROUPS3" (:1 , :2 , :3 , :4 ) ; END;, OriginalSql = { call "CWMS_20"."CWMS_LOC"."ASSIGN_LOC_GROUPS3" (?, ?, ?, ?) }, Error Msg = ORA-01400: cannot insert NULL into ("CWMS_20"."AT_LOC_GROUP_ASSIGNMENT"."LOCATION_CODE") 
error 
		at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513) 

This location data was taken from the T7, so I don't know what is missing.

Image

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