USACE / USACE/cwms-data-api

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

Open
#1,658 2 comments 1 reaction 2 assignees View on GitHub

@adamkorynta is already working on this.

Since May 4, 2026.

bug needs-follow-up
Dominant language
Java
Stars
28
Forks
25
Avg merge
4d 22h
Merged PRs (30d)
20

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.