Solved

FME Server jobs keeps running (cannot cancel the job)


Badge +2

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?

icon

Best answer by merlinegeorge 9 June 2022, 18:47

View original

2 replies

Badge +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. 

Badge +2

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.

Reply