Author Topic: Scheduled task error for expression script  (Read 1794 times)

Offline Oblivion11

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Scheduled task error for expression script
« on: September 17, 2015, 09:19:03 am »
Hello,

I created the following expression scripts:

CREATELOCK
@execute D:\Tools\ServerTools\create_lightsout_lock.bat
@error @email "Failed to create lightsout lock file!"

CLEANUPLOCK
@execute D:\Tools\ServerTools\delete_lightsout_lock.bat
@error @email "Failed to delete lightsout lock file!"

RUNUPDATE
@config Vault
@queued true
@execute @task update

UPDATE
@run CREATELOCK
@success @run RUNUPDATE
@success @run CLEANUPLOCK
@error @run CLEANUPLOCK

Then I created a scheduled task for the UPDATE script. However every time the execution fails with the following error:

Code: [Select]
[2015-09-17 16:14:32,249] ERROR: Duplicate entry error for ScriptModel
java.sql.SQLException: Duplicate entry error for ScriptModel
at com.tchegbe.lib.ext.service.CommonPersistenceService.find(Unknown Source)
at com.tchegbe.flexraid.main.b.L.a(Unknown Source)
at com.tchegbe.a.a.c.a.<unknown>(Unknown Source)
at com.tchegbe.a.a.c.a.<unknown>(Unknown Source)
at com.tchegbe.flexraid.main.b.L.executeScript(Unknown Source)
at com.tchegbe.flexraid.server.scheduler.job.ScriptJob.execute(Unknown Source)
at org.quartz.core.JobRunShell.run(Unknown Source)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(Unknown Source)
[2015-09-17 16:14:32,249] ERROR: Duplicate entry error for ScriptModel
java.lang.RuntimeException: Duplicate entry error for ScriptModel
at com.tchegbe.flexraid.main.b.L.a(Unknown Source)
at com.tchegbe.a.a.c.a.<unknown>(Unknown Source)
at com.tchegbe.a.a.c.a.<unknown>(Unknown Source)
at com.tchegbe.flexraid.main.b.L.executeScript(Unknown Source)
at com.tchegbe.flexraid.server.scheduler.job.ScriptJob.execute(Unknown Source)
at org.quartz.core.JobRunShell.run(Unknown Source)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(Unknown Source)
Caused by: java.sql.SQLException: Duplicate entry error for ScriptModel
at com.tchegbe.lib.ext.service.CommonPersistenceService.find(Unknown Source)
... 7 more

I have this issue since I upgraded to the lastest version 2.1
In previous versions this worked as expected.

Any ideas what is going wrong? I already tried deleting the scripts and recreating / scheduling, but without result.

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: Scheduled task error for expression script
« Reply #1 on: September 17, 2015, 09:37:52 am »
Sounds as if there was a bug that allowed you to save more than one script under the same name.

Make copies of your scripts and then delete them to try to clear up the database.
Afterward, recreate your scripts.

Offline Oblivion11

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Scheduled task error for expression script
« Reply #2 on: September 17, 2015, 10:16:46 am »
I already tried that. Deleted scripts, restarted flexraid service, recreated, but without success.

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: Scheduled task error for expression script
« Reply #3 on: September 17, 2015, 10:52:50 am »
1. When you deleted, did you reload the UI to see if the duplicate showed up?

2. Also, delete the schedule jobs for the scripts.

Offline Oblivion11

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Scheduled task error for expression script
« Reply #4 on: September 18, 2015, 03:22:52 am »
1. When you deleted, did you reload the UI to see if the duplicate showed up?

Yes I did, and the duplicates didn't show up.

2. Also, delete the schedule jobs for the scripts.

Also did this.

Is doing a reinstall or deleting the current configuration database an option to fix this? Did a reinstall after deleting the config database. Reinitializing the parity data at the moment. Will report back this evening when it is done.
« Last Edit: September 18, 2015, 03:44:00 am by Oblivion11 »

Offline Oblivion11

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Scheduled task error for expression script
« Reply #5 on: September 18, 2015, 05:32:03 pm »
Ok, the reinstall and deletion of config database didn't work  :-\

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: Scheduled task error for expression script
« Reply #6 on: September 18, 2015, 06:09:38 pm »
That's non-descriptive. What did not work. Logs?

Offline Oblivion11

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Scheduled task error for expression script
« Reply #7 on: September 21, 2015, 02:31:50 am »
The reinstall didn't solve my problem.

Steps I did:
  • uninstall flexraid
  • delete leftover files including the config database
  • install flexraid
  • recreated the raid-f storage pool
  • recreated the expression scripts (the list of scripts was empty after the install)
  • added schedules

I still get the same error as in my opening post.

I experimented a bit, creating all different kinds of scripts and for each script I get the duplicate error. Without being able to look at the database contents, it seems that the script is added twice to the database upon creation/saving?
« Last Edit: September 21, 2015, 05:05:13 am by Oblivion11 »

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: Scheduled task error for expression script
« Reply #8 on: September 21, 2015, 06:46:56 am »
This is now fixed in the latest build (2015-09-21).

Offline Oblivion11

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Scheduled task error for expression script
« Reply #9 on: September 21, 2015, 07:43:39 am »
Tested with the latest build and the issue is indeed resolved  :)