Skip to main content
Solved

FME Server jobs keeps running (cannot cancel the job)


stefanh
Contributor
Forum|alt.badge.img+8

On FME Server there is a job running in some kind of loop. 

I am not able to cancel the job; even when I cancel the jobs it keeps running. I have tried many things:

- disabling the automation

- removing the workspace

 

We restarted the Server, but the job just started immediately. 

 

I find this information in the System Events:

Event Description: Triggered whenever an error message is logged to fmeserver.log.

Event Title: Error Message Logged

Message: ERROR: duplicate key value violates unique constraint "fme_job_history_pkey" Detail: Key (job_id)=(37020) already exists.

 

Does someone has an idea how I can fix the issue?

Best answer by merlinegeorge

Hello @stefanh​ ,

 

The duplicate key value violates unique constraint error usually occurs when two jobs are submitted under the same job ID. When the first job completes, this is recorded in the fme_job_history table in the System Database, then when the second job completes it also tries to add a record to this table, but cannot because the ID already exists, hence a duplicate key value error. 

To resolve this error, you could first try and delete the record from the fme_job_history table. This should allow the second record to be entered and things should continue running as normal. 

 

If the issue persists then there may be something out of sync with the assignment of job IDs, in which case please follow the instructions on the best answer to this post: https://community.safe.com/s/question/0D54Q000080h97mSAA/error-throwing-a-duplicate-user-key-error-when-trying-to-create-a-new-account-in-fme-server but using the fme_job_history_pkey value instead of the user account. 

View original
Did this help you find an answer to your question?

2 replies

merlinegeorge
Safer
Forum|alt.badge.img+5

Hello @stefanh​ ,

 

The duplicate key value violates unique constraint error usually occurs when two jobs are submitted under the same job ID. When the first job completes, this is recorded in the fme_job_history table in the System Database, then when the second job completes it also tries to add a record to this table, but cannot because the ID already exists, hence a duplicate key value error. 

To resolve this error, you could first try and delete the record from the fme_job_history table. This should allow the second record to be entered and things should continue running as normal. 

 

If the issue persists then there may be something out of sync with the assignment of job IDs, in which case please follow the instructions on the best answer to this post: https://community.safe.com/s/question/0D54Q000080h97mSAA/error-throwing-a-duplicate-user-key-error-when-trying-to-create-a-new-account-in-fme-server but using the fme_job_history_pkey value instead of the user account. 


stefanh
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • June 13, 2022

Thanks for the reply.

In the end we removed the specific job (id = 37020) from the database table 'fme_jobs'.

A delete of the specific row was not possible (probably the same query when request from the FME Server interface). There was only one job (the job with id = 37020) so we did a truncate on the table.

Everything is working fine again.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings