OTRS 5.0.3 - SetPermissions always report files got the wrong permissions

Moderator: crythias

Locked
Lure79
Znuny newbie
Posts: 11
Joined: 13 Aug 2013, 08:33
Znuny Version: 3.2.9
Real Name: Anderas Larsson
Company: Consid AB

OTRS 5.0.3 - SetPermissions always report files got the wrong permissions

Post by Lure79 »

We have a strange problem in our OTRS 5.0.3 installation where OTRS crash most of the time you enter the SysConfig. The current workaround we have is that between each reload of the SysConfig view you have to clear the cache with:

Code: Select all

sudo -u otrs /opt/otrs/bin/otrs.Console.pl Maint::Cache::Delete
I think the problem might have something to do with the file rights/groups in the OTRS installation.
The SetPermissions script always think the cache files have the wrong user rights. This is the output just a few seconds after clearing the cache (new files are already created):

Code: Select all

sudo /opt/otrs/bin/otrs.SetPermissions.pl --web-group=www-data --otrs-user=otrs --skip-article-dir --dry-run
Setting permissions on /opt/otrs
/var/tmp/CacheFileStorable/SystemData/9/b permissions 2770 -> 2775
/var/tmp/CacheFileStorable/SystemData/3/5 permissions 2770 -> 2775
/var/tmp/CacheFileStorable/SystemData/5/9 permissions 2770 -> 2775
/var/tmp/CacheFileStorable/SystemData/5/9 ownership 33:33 -> 999:33
/var/tmp/CacheFileStorable/SystemData/5/9/598526e36f91d07a932f6f62a3b3e7ee ownership 33:33 -> 999:33
/var/tmp/CacheFileStorable/XMLParse/1/b permissions 2770 -> 2775
/var/tmp/CacheFileStorable/XMLParse/1/b ownership 33:33 -> 999:33
/var/tmp/CacheFileStorable/XMLParse/1/b/1b18a5a794261a551b7f573ccc2b9097 ownership 33:33 -> 999:33
Skipping /var/article
(The output above is slightly confusing, the files are actually in /opt/otrs/var/tmp)

I also noticed that each time you change a setting in the sysconfig the setPermission script complains that the ZZZ files in /opt/otrs/Kernel/Config/Files have the wrong permissions.

After running the SetPermissions script:

Code: Select all

/opt/otrs/Kernel/Config/Files$ ls -l
totalt 1480
-rw-rw---- 1 otrs www-data   2458 nov  2 19:42 CloudServices.xml
-rw-rw---- 1 otrs www-data  35151 nov  2 19:42 Daemon.xml
-rw-rw---- 1 otrs www-data 337884 nov 11 19:59 Framework.xml
-rw-rw---- 1 otrs www-data  27123 nov  2 19:42 GenericInterface.xml
-rw-rw---- 1 otrs www-data  84796 dec  3 10:32 OTRSBusiness.xml
-rw-rw---- 1 otrs www-data   3943 dec  3 10:05 OTRSEscalationSuspend.xml
-rw-rw---- 1 otrs www-data  28544 dec  3 10:05 OTRSMasterSlave.xml
-rw-rw---- 1 otrs www-data  11963 dec  3 10:05 OTRSTicketWatchlist.xml
-rw-rw---- 1 otrs www-data  24385 nov  2 19:42 ProcessManagement.xml
-rw-rw---- 1 otrs www-data 604265 nov 11 19:59 Ticket.xml
-rw-rw---- 1 otrs www-data 245618 dec  9 17:13 ZZZAAuto.pm
-rw-rw---- 1 otrs www-data    804 dec  7 13:54 ZZZACL.pm
-rw-rw---- 1 otrs www-data  20822 dec  9 17:08 ZZZAuto.pm
-rw-rw---- 1 otrs www-data  29846 dec  3 09:48 ZZZAuto.pm.back
-rw-rw---- 1 otrs www-data    473 dec  3 10:32 ZZZOTRSBusiness.pm
-rw-rw---- 1 otrs www-data  32071 dec  3 12:25 ZZZProcessManagement.pm
After saving something in SysConfig:

Code: Select all

/opt/otrs/Kernel/Config/Files$ ls -l
totalt 1480
-rw-rw---- 1 otrs     www-data   2458 nov  2 19:42 CloudServices.xml
-rw-rw---- 1 otrs     www-data  35151 nov  2 19:42 Daemon.xml
-rw-rw---- 1 otrs     www-data 337884 nov 11 19:59 Framework.xml
-rw-rw---- 1 otrs     www-data  27123 nov  2 19:42 GenericInterface.xml
-rw-rw---- 1 otrs     www-data  84796 dec  3 10:32 OTRSBusiness.xml
-rw-rw---- 1 otrs     www-data   3943 dec  3 10:05 OTRSEscalationSuspend.xml
-rw-rw---- 1 otrs     www-data  28544 dec  3 10:05 OTRSMasterSlave.xml
-rw-rw---- 1 otrs     www-data  11963 dec  3 10:05 OTRSTicketWatchlist.xml
-rw-rw---- 1 otrs     www-data  24385 nov  2 19:42 ProcessManagement.xml
-rw-rw---- 1 otrs     www-data 604265 nov 11 19:59 Ticket.xml
-rw-rw---- 1 www-data www-data 245618 dec  9 18:39 ZZZAAuto.pm
-rw-rw---- 1 otrs     www-data    804 dec  7 13:54 ZZZACL.pm
-rw-rw---- 1 otrs     www-data  20822 dec  9 17:08 ZZZAuto.pm
-rw-rw---- 1 otrs     www-data  29846 dec  3 09:48 ZZZAuto.pm.back
-rw-rw---- 1 otrs     www-data    473 dec  3 10:32 ZZZOTRSBusiness.pm
-rw-rw---- 1 otrs     www-data  32071 dec  3 12:25 ZZZProcessManagement.pm
We are running Ubuntu 12 and the the linux user otrs is a member of the www-data group.

My questions:
Why is the owner of ZZZAAuto.pm now "www-data"?
What are the correct file rights in /opt/otrs/var/tmp and /opt/otrs/Kernel/Config/Files ?
Lure79
Znuny newbie
Posts: 11
Joined: 13 Aug 2013, 08:33
Znuny Version: 3.2.9
Real Name: Anderas Larsson
Company: Consid AB

Re: OTRS 5.0.3 - SetPermissions always report files got the wrong permissions

Post by Lure79 »

Just a followup for anyone interested:

The changing file rights in the /opt/otrs/Kernel/Config/Files directory seems normal.

The problem with the crashing SysConfig was never resolved but we are moving the system to a new server so we are hoping a fresh Ubuntu installation running on a new VM host will solve the problem.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: OTRS 5.0.3 - SetPermissions always report files got the wrong permissions

Post by RStraub »

Do you use a symlink for /opt/otrs? There's an open bug about setpermission and symlinks:
https://github.com/OTRS/otrs/pull/875
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Locked