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

Unable to create a metadata record using template #8310

Open
JoseSanchezMoralesIDOX opened this issue Aug 23, 2024 · 0 comments
Open

Unable to create a metadata record using template #8310

JoseSanchezMoralesIDOX opened this issue Aug 23, 2024 · 0 comments

Comments

@JoseSanchezMoralesIDOX
Copy link

Describe the bug

Create metadata error
could not execute batch; SQL [insert into Metadata (data, changeDate, createDate, displayorder, doctype, extra, popularity, rating, root, schemaId, title, isTemplate, isHarvested, harvestUri, harvestUuid, groupOwner, owner, source, uuid, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute batch

To Reproduce
Steps to reproduce the behavior:

  1. Go to Contribute -> Add new record
  2. Click on 'Dataset' and 'Template for Vector data in ISO19139 (preferred!)'
  3. Click on any group for the 'In ..' option.
  4. See error in the top-left

Expected behavior
Before we were able to create new records, so something must have changed

In detail, from the browser, this is the request URL:
http://geonetwork-tmc-prod.thinkwhere-labs.com:8080/geonetwork/srv/api/records/duplicate?metadataType=METADATA&sourceUuid=2010&isChildOfSource=false&group=2&isVisibleByAllGroupMembers=false&targetUuid=&hasCategoryOfSource=true
(this is url is not public)

And the response is:

{
    "message": "InvalidDataAccessResourceUsageException",
    "code": "runtime_exception",
    "description": "could not execute batch; SQL [insert into Metadata (data, changeDate, createDate, displayorder, doctype, extra, popularity, rating, root, schemaId, title, isTemplate, isHarvested, harvestUri, harvestUuid, groupOwner, owner, source, uuid, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute batch"
}

We are using VERSION geonetwork:3.12.8-postgres, running in Docker.

As other posts suggest, we have checked the hibernate_sequence in the database, and the count of records in the 'metadata' TABLE.

hibernate_sequence:
Current value: 5734
Increment: 1
Start: 100
Minimum: 1
Maximum: 9223372036854775807
Cache: 1

The last ID in the metadata table was 4250

Every time we tried adding a new record to the table, the above sequence was adding 1 (5734, 5735, 5736, ..) which proves the sequence works?

WHAT WE HAVE TRIED SO FAR:

  • Rebuild the index using the GUI.
  • Restarting the docker container
  • Updating the Start sequence (e.g., 100) to be higher than the current value (e.g., 5741)

Lack of more ideas.

Thanks in advance,

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