GenericAgent: can't open .../DynamicField/....

Moderator: crythias

Locked
Eraserhead
Znuny newbie
Posts: 33
Joined: 05 Apr 2011, 05:28
Znuny Version: 3.0.5

GenericAgent: can't open .../DynamicField/....

Post by Eraserhead »

Hi,

I'm getting these errors via cron mail:

Code: Select all

ERROR: OTRS-otrs.GenericAgent.pl-10 Perl: 5.18.2 OS: linux Time: Tue Aug 18 15:40:02 2015

 Message: Can't write '/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7/6732332f2164b22a374a2cd7c080aea3': Permission denied

 Traceback (10963):
   Module: Kernel::System::Main::FileWrite Line: 462
   Module: Kernel::System::Cache::FileStorable::Set Line: 98
   Module: Kernel::System::Cache::Set Line: 179
   Module: Kernel::System::DynamicField::DynamicFieldGet Line: 325
   Module: Kernel::System::DynamicField::DynamicFieldListGet Line: 1015
   Module: Kernel::System::GenericAgent::new Line: 69
   Module: Kernel::System::ObjectManager::_ObjectBuild Line: 227
   Module: Kernel::System::ObjectManager::Get Line: 181
   Module: main::ExecuteDBJobs Line: 175
   Module: /opt/otrs//bin/otrs.GenericAgent.pl Line: 136
Did anyone ever find a fix for this? So many people seem to have the same problem but the thread was never solved?

I migrated this weekend from 3.0 > 3.1 > 3.2 > 3.3 > 4.0

And i'm getting these cron messages as well. I deleted the files manually and also used:

Code: Select all

bin/otrs.DeleteCache.pl --expired
bin/otrs.LoaderCache.pl -o delete
But i keep getting these cron warnings. Any suggestions?

Mod: reference: viewtopic.php?f=62&p=57616#p57616
Last edited by Eraserhead on 18 Aug 2015, 16:25, edited 3 times in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: GenericAgent: can't open .../DynamicField/....

Post by crythias »

All the suggestions are already in this thread.
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
Eraserhead
Znuny newbie
Posts: 33
Joined: 05 Apr 2011, 05:28
Znuny Version: 3.0.5

Re: GenericAgent: can't open .../DynamicField/....

Post by Eraserhead »

Well, i've read through the entire thread again. This is what i have:

No duplicate entries in cron:

Code: Select all

 crontab -l -u otrs
# Who gets the cron emails?
#MAILTO="info@xxxxx.xx"

# delete expired cache weekly (Sunday mornings)
20 0 * * 0  $HOME/bin/otrs.DeleteCache.pl --expired >> /dev/null
30 0 * * 0  $HOME/bin/otrs.LoaderCache.pl -o delete >> /dev/null

# fetch every 5 minutes emails via fetchmail
#*/5 * * * * [ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null
#*/5 * * * *    /usr/bin/fetchmail -a --ssl >> /dev/null

# generate dashboard stats every hour
5 * * * *    $HOME/bin/otrs.GenerateDashboardStats.pl >> /dev/null

# start generic agent every 20 minutes
*/20 * * * *    $HOME/bin/otrs.GenericAgent.pl >> /dev/null

# example to execute otrs.GenericAgent.pl on 23:00 with
# Kernel::Config::GenericAgentMove job file
#0 23 * * * $HOME/bin/otrs.GenericAgent.pl -c "Kernel::Config::GenericAgentMove" >> /dev/null

# start generic agent every 10 minutes
*/10 * * * *    $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null

# check every 120 min the pending jobs
45 */2 * * *    $HOME/bin/otrs.PendingJobs.pl >> /dev/null

# check daily the spool directory of OTRS
10 0 * * *  $HOME/bin/otrs.ReprocessMails.pl >> /dev/null

# fetch emails every 1 minute
*/1 * * * *    $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null

# just every day
01 01 * * * $HOME/bin/otrs.RebuildTicketIndex.pl >> /dev/null

# check scheduler status
*/5 * * * *    $HOME/bin/otrs.Scheduler.pl -w 1 >> /dev/null

# delete every 120 minutes old/idle session ids
55 */2 * * *    $HOME/bin/otrs.DeleteSessionIDs.pl --expired >> /dev/null

# unlock every hour old locked tickets
35 * * * *  $HOME/bin/otrs.UnlockTickets.pl --timeout >> /dev/null
I checked which user is running cron:

Code: Select all

cd /var/spool/cron/crontabs
grep otrs *
otrs:20 0 * * 0  $HOME/bin/otrs.DeleteCache.pl --expired >> /dev/null
otrs:30 0 * * 0  $HOME/bin/otrs.LoaderCache.pl -o delete >> /dev/null
otrs:5 * * * *    $HOME/bin/otrs.GenerateDashboardStats.pl >> /dev/null
otrs:*/20 * * * *    $HOME/bin/otrs.GenericAgent.pl >> /dev/null
otrs:# example to execute otrs.GenericAgent.pl on 23:00 with
otrs:#0 23 * * * $HOME/bin/otrs.GenericAgent.pl -c "Kernel::Config::GenericAgentMove" >> /dev/null
otrs:*/10 * * * *    $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null
otrs:45 */2 * * *    $HOME/bin/otrs.PendingJobs.pl >> /dev/null
otrs:10 0 * * *  $HOME/bin/otrs.ReprocessMails.pl >> /dev/null
otrs:*/1 * * * *    $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
otrs:01 01 * * * $HOME/bin/otrs.RebuildTicketIndex.pl >> /dev/null
otrs:*/5 * * * *    $HOME/bin/otrs.Scheduler.pl -w 1 >> /dev/null
otrs:55 */2 * * *    $HOME/bin/otrs.DeleteSessionIDs.pl --expired >> /dev/null
otrs:35 * * * *  $HOME/bin/otrs.UnlockTickets.pl --timeout >> /dev/null
This is what i have in /opt/otrs/var/cron:

Code: Select all

/opt/otrs/var/cron# ls
aaa_base       cache.dist      generate_dashboard_stats       generic_agent-database       pending_jobs       postmaster.dist          rebuild_ticket_index       scheduler_watchdog.dist  unlock
aaa_base.dist  fetchmail       generate_dashboard_stats.dist  generic_agent-database.dist  pending_jobs.dist  postmaster_mailbox       rebuild_ticket_index.dist  session                  unlock.dist
cache          fetchmail.dist  generic_agent                  generic_agent.dist           postmaster         postmaster_mailbox.dist  scheduler_watchdog         session.dist
Finally this is an example of the permissions on what of the files that gives the cron error:

Code: Select all

root@backup:/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7# ls -l
total 4
-rw-rw---- 1 www-data www-data 306 Aug 18 14:35 6732332f2164b22a374a2cd7c080aea3
I'm on Ubuntu 14 and i used this to set the permissions:

Code: Select all

bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=www-data --otrs-group=www-data --web-group=www-data /opt/otrs
I was also getting cron e-mails about the files ZZZAuto.pm and ZZZAAuto.pm saying Access Denied.
However i got rid of those errors when i did chmod 664 on them.

Where did i go wrong?

Update:

I did this according to the Ubuntu guide:
https://help.ubuntu.com/community/OTRS

Code: Select all

root@backup:/opt/otrs/bin# sudo ./otrs.SetPermissions.pl --otrs-user=otrs --otrs-group=otrs --web-user=www-data --web-group=www-data /opt/otrs
Unknown option: otrs-group
Unknown option: web-user
Setting permissions on /opt/otrs
What do the unknown option messesages mean?

It seems to change the permission of the cache file anyway:

Code: Select all

cd /opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7
ls -l
-rw-rw---- 1 otrs www-data 306 Aug 18 14:35 6732332f2164b22a374a2cd7c080aea3
update2:

I was silently hoping that the permissions change fixed it but i just got another cron e-mail again:

Code: Select all

ERROR: OTRS-otrs.GenericAgent.pl-10 Perl: 5.18.2 OS: linux Time: Tue Aug 18 15:40:02 2015

 Message: Can't write '/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7/6732332f2164b22a374a2cd7c080aea3': Permission denied
This is what the file looks like:

Code: Select all

/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7# ls -l
total 4
-rw-rw---- 1 www-data www-data 306 Aug 18 15:36 6732332f2164b22a374a2cd7c080aea3
root@backup:/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7#
So when i ran the otrs.SetPermissions.pl script it had set otrs as the owner of the file and now the new cache files that have been generated are owned by apache www-data. Would this be the cause of the problem?
Last edited by Eraserhead on 18 Aug 2015, 16:24, edited 4 times in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: GenericAgent: can't open .../DynamicField/....

Post by crythias »

Please also provide the error messages you have received. I've split your topic because it's your thread and not the OP.
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
Eraserhead
Znuny newbie
Posts: 33
Joined: 05 Apr 2011, 05:28
Znuny Version: 3.0.5

Re: GenericAgent: can't open .../DynamicField/....

Post by Eraserhead »

Thanks Crythias. I've added the original error to my OP and please also see at the bottom of the post before yours (update2) i was just editing it when you split this topic.

edit: just received this error:

Code: Select all

mkdir /opt/otrs/var/tmp/CacheFileStorable/Group/7/f: Permission denied at /opt/otrs/Kernel/System/Cache/FileStorable.pm line 88.
Last edited by Eraserhead on 18 Aug 2015, 16:20, edited 1 time in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: GenericAgent: can't open .../DynamicField/....

Post by crythias »

Please use markup instead of [quote][/quote] markup for code and errors.
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
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: GenericAgent: can't open .../DynamicField/....

Post by crythias »

Eraserhead wrote:What do the unknown option messesages mean?
\
It means what it says. Those options are no longer valid options.
Eraserhead wrote:Finally this is an example of the permissions on what of the files that gives the cron error:

root@backup:/opt/otrs/var/tmp/CacheFileStorable/DynamicField/6/7# ls -l
total 4
-rw-rw---- 1 www-data www-data 306 Aug 18 14:35 6732332f2164b22a374a2cd7c080aea3
runs as otrs.
doesn't have permission.
make otrs a member of www-data group
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
Eraserhead
Znuny newbie
Posts: 33
Joined: 05 Apr 2011, 05:28
Znuny Version: 3.0.5

Re: GenericAgent: can't open .../DynamicField/....

Post by Eraserhead »

Thanks. I did:

Code: Select all

sudo usermod -a -G www-data otrs
Waiting to see if i get any more errors.

Also fixed the code tags. :)
Eraserhead
Znuny newbie
Posts: 33
Joined: 05 Apr 2011, 05:28
Znuny Version: 3.0.5

Re: GenericAgent: can't open .../DynamicField/....

Post by Eraserhead »

Just posting back that i'm not getting any errors anymore, i guess i must have missed that step during the installation, thanks again Crythias! Case closed.
Locked