Generic Agent not running [SOLVED]

Moderator: crythias

Locked
SLESSARD
Znuny advanced
Posts: 119
Joined: 12 Jan 2011, 22:35
Znuny Version: 4.x.x.x.x
Company: Self-Employed

Generic Agent not running [SOLVED]

Post by SLESSARD »

I have read different post and couldn't pin point my problem.

I have a simple Generic Agent Job setup and scheduled to run every 10 minutes of every hour and every day (All Minutes, Hours, Days selected). When executing the job manually all affected tickets are flagged and modified on exeuciton. But the job just won't run automatically.

Not sure how the configuration of the GenericAgent from the admin page relates to system cron jobs ?! There are currently no cron job set to run (Would that be the problem? if so what's the value of setting a schedule in the GenericAgent admin page??)

The following errors seems to appear in system log when the GenericAgent is suppose to run but they don't seem to related (maybe just coincidence)Mon Feb 14 13:53:08 2011 error OTRS-CGI-10 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, ' at line 1, SQL: 'SELECT DISTINCT count(*) FROM ticket st, queue sq , ticket_watcher tw WHERE sq.id = st.queue_id AND st.id = tw.ticket_id AND st.ticket_state_id IN ( ) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26) AND tw.user_id IN (3) AND st.until_time <= 1297709528 LIMIT 10000'
Mon Feb 14 13:53:08 2011 error OTRS-CGI-10 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND st.responsible_user_id IN (3) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16' at line 1, SQL: 'SELECT DISTINCT count(*) FROM ticket st, queue sq WHERE sq.id = st.queue_id AND st.ticket_state_id IN ( ) AND st.responsible_user_id IN (3) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26) AND st.until_time <= 1297709528 LIMIT 10000'
Mon Feb 14 13:53:08 2011 error OTRS-CGI-10 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND st.queue_id IN (999999) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, ' at line 1, SQL: 'SELECT DISTINCT count(*) FROM ticket st, queue sq WHERE sq.id = st.queue_id AND st.ticket_state_id IN ( ) AND st.queue_id IN (999999) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26) AND st.until_time <= 1297709528 LIMIT 10000'
Mon Feb 14 13:53:08 2011 error OTRS-CGI-10 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND st.ticket_lock_id IN (2) AND st.user_id IN (3) AND sq.group_id IN (1, 2, ' at line 1, SQL: 'SELECT DISTINCT count(*) FROM ticket st, queue sq WHERE sq.id = st.queue_id AND st.ticket_state_id IN ( ) AND st.ticket_lock_id IN (2) AND st.user_id IN (3) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26) AND st.until_time <= 1297709528 LIMIT 10000'
Mon Feb 14 13:53:08 2011 error OTRS-CGI-10 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, ' at line 1, SQL: 'SELECT DISTINCT count(*) FROM ticket st, queue sq WHERE sq.id = st.queue_id AND st.ticket_state_id IN ( ) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26) AND st.until_time <= 1297709528 LIMIT 10000'
Mon Feb 14 13:53:08 2011 error OTRS-CGI-10 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND st.ticket_lock_id IN (2) AND st.user_id IN (3) AND sq.group_id IN (1, 2, ' at line 1, SQL: 'SELECT DISTINCT st.id, st.tn, st.until_time FROM ticket st, queue sq WHERE sq.id = st.queue_id AND st.ticket_state_id IN ( ) AND st.ticket_lock_id IN (2) AND st.user_id IN (3) AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26) AND st.until_time <= 1297709528 ORDER BY st.until_time DESC LIMIT 10'


Any link to docs or tips on how exactly the GenericAgent is suppose to work would be appreciated.
Last edited by SLESSARD on 22 Feb 2011, 18:28, edited 1 time in total.
OTRS 4.0.11
Ubuntu 15.04
MySQL Database, PHP5, Apache (LAMP server bundle)
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Generic Agent not running

Post by crythias »

I can't tell for sure, but it *appears* to be balking at no state.

Code: Select all

SELECT DISTINCT count(*) 
   FROM ticket st, queue sq , ticket_watcher tw 
   WHERE sq.id = st.queue_id 
        AND st.id = tw.ticket_id 
        AND st.ticket_state_id IN ( ) <== this parenthesis is where it's croaking.
        AND sq.group_id IN (1, 2, 3, 10, 12, 14, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26) 
        AND tw.user_id IN (3) 
        AND st.until_time <= 1297709528 LIMIT 10000
Likewise:
st.ticket_state_id IN ( ) AND st.responsible_user_id IN (3)
st.ticket_state_id IN ( ) AND st.queue_id IN (999999)
st.ticket_state_id IN ( ) AND st.ticket_lock_id IN (2)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
SLESSARD
Znuny advanced
Posts: 119
Joined: 12 Jan 2011, 22:35
Znuny Version: 4.x.x.x.x
Company: Self-Employed

Re: Generic Agent not running

Post by SLESSARD »

Thanks Crythias.

The only issue I could think of regarding the state is that I had a current_state and current_queue set in my job and only a new_queue set ... maybe it required a new_state because I specified it as a criteria, tested it and not working still.

But like I said if I run the job manually it flags tickets and the changes are implemented on execution but it just won't execute based on the set scheduled.

I also added the genericagent in the cron kob at the server level to run every 5 minutes ... no go still!

I'll keep testing and post a solution when found, if you guys have other idea please send them over.
OTRS 4.0.11
Ubuntu 15.04
MySQL Database, PHP5, Apache (LAMP server bundle)
SLESSARD
Znuny advanced
Posts: 119
Joined: 12 Jan 2011, 22:35
Znuny Version: 4.x.x.x.x
Company: Self-Employed

Re: Generic Agent not running

Post by SLESSARD »

I am still troubleshooting this and to be honest I doubt the SQL errors are related to the generic agent issue I am having - But I'm keeping an eye on it

I added the generic agent to cron and getting the following error when genericagent.pl runs

[/opt/otrs/Kernel]:# /opt/otrs/bin/GenericAgent.pl
Useless use of a constant in void context at /opt/otrs-2.4.9/Kernel/Config.pm line 85.
Useless use of anonymous list ([]) in void context at /opt/otrs-2.4.9/Kernel/Config.pm line 85.


line 85 being the start of the MAP block (Map => [) of the CustomerCompany section copied from defaults.pm

Not sure what's the link but it's coming up when running genericagent.pl

?! Anyone seen this ?
OTRS 4.0.11
Ubuntu 15.04
MySQL Database, PHP5, Apache (LAMP server bundle)
SLESSARD
Znuny advanced
Posts: 119
Joined: 12 Jan 2011, 22:35
Znuny Version: 4.x.x.x.x
Company: Self-Employed

Re: Generic Agent not running

Post by SLESSARD »

Fixed it by reading, reading and reading ... turns out the cron jobs were not set correctly

My solution was found here
Section 3.2.5. Setting up the cron jobs for OTRS - http://doc.otrs.org/2.1/en/html/x325.html

generic_agent = This script executes the jobs of the GenericAgent that are not stored in the database but in own config files.
generic_agent-database = This script executes the jobs of the GenericAgent that are stored in the database.


PROBLEM: my Generic Agent jobs were set in the db and generic_agent was running instead of generic_agent-database

Now configured the Cron jobs as per documentation and all is working
OTRS 4.0.11
Ubuntu 15.04
MySQL Database, PHP5, Apache (LAMP server bundle)
Locked