Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Watermark is missing in sub-prod instance for newly generated emails after clone from prod to sub-prod - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Watermark is missing in sub-prod instance for newly generated emails after clone from prod to sub-prod
KB0725880

Watermark is missing in sub-prod instance for newly generated emails after clone from prod to sub-prod


993 Views Last updated : Oct 13, 2023 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


Watermarks will be missing in newly generated emails and you can see unique key violation error in system logs.

Example error:

FAILED TRYING TO EXECUTE ON CONNECTION 10: INSERT INTO sys_watermark (`number`,`sys_id`,`sys_updated_by`,`sys_created_on`,`sys_mod_count`,`source_id`,`sys_updated_on`,`source_table`,`email`,`sys_created_by`) VALUES('MSG495258698','2435f2b8db272b00c70cfff31d9619d6','system','2019-02-08 15:23:01',0,'8dc3fa70db272b00c70cfff31d961916','2019-02-08 15:23:01','sys_progress_worker','ec35f2b8db272b00c70cfff31d9619d6','system') /* <Instancename>019, gs:glide.scheduler.worker.4, tx:20353e78db272b00c70cfff31d9619c4 */ 
Unique Key violation detected by database (Duplicate entry 'MSG495258698' for key 'sys_watermark_index1')
: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'MSG495258698' for key 'sys_watermark_index1': org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:132)
org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
org.mariadb.jdbc.MySQLStatement.executeQueryEpilog(MySQLStatement.java:274)
org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:302)
org.mariadb.jdbc.MySQLStatement.execute(MySQLStatement.java:393)

Release

Applicable for all

Cause

During clone, if the number maintenance table is not excluded, all the watermarks in Production instance will be carried out to sub-prod instance.

OR

If the sys_number_counter table is added in Preserve data, then number count will be out of sync between two instances, source and target.

So in the sub-prod instance when an email is generated new watermark will be inserted into the sys_watermark table, and at that point, if the newly generated watermark does exist in the sub-prod instance which is carried from prod we will see unique key violation error in system logs and email will be generated without watermarks.

Resolution

  • Login the production instance from where you did the clone.
  • Go to the sys_number_counter table and check for watermark under the table column.
  • Check the current number for watermark table and add +10 to that number, for example, if the number is 564534 add 10 to this number which will be 564544.
  • Login the sub-prod target instance.
  • Go to Number maintenance table and check for MSG under Prefix column.
  • Open that MSG record and update the Number field with 564544. So from now whatever the email generated it will be carried out with watermark from 564544+ which is randomized and incremental.

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.