Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 220553

Summary: www-apps/otrs: fails to install with correct permissions when using webapp-config
Product: Gentoo Linux Reporter: Thomas Beutin <tb>
Component: Current packagesAssignee: Gentoo Web Application Packages Maintainers <web-apps>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: alexanderyt, ferimy, jesse, kspy, lists, patrick, scen
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: otrs-2.3.3_bin_fix.patch
webapp-config error "could not set permissions" + "failed to write content"

Description Thomas Beutin 2008-05-06 10:56:07 UTC
When i try to install www-apps/otrs by using webapp-config the installation raises the following error:

******

Could not set permissions

******

* /usr/share/webapps/otrs/2.2.6/hooks/reconfig-2: line 22: /var/www/AUTOMATIC/ticket.zapiff.de/otrs-2.2.6/bin/SetPermissions.sh: Permission denied
* 


Reproducible: Always

Steps to Reproduce:
# nice -n 19 webapp-config -I -h my.host.name -d '' otrs 2.2.6
* 
* You may be installing into the website's root directory.
* Is this what you meant to do?
* 
*   Creating required directories
*   Linking in required files
*     This can take several minutes for larger apps
*   Files and directories installed
******

Could not set permissions

******

* /usr/share/webapps/otrs/2.2.6/hooks/reconfig-2: line 22: /var/www/my.host.name/otrs-2.2.6/bin/SetPermissions.sh: Permission denied
* 

=================================================================
POST-INSTALL INSTRUCTIONS
=================================================================


Your installation is almost complete.
1. You now need to edit /var/www/my.host.name/otrs-2.2.6/Kernel/Config.pm
and set some Kernel::Config options (FQDN, SystemID, TicketHook, Home, ...).

2. Configure and restart your webserver.
Read /usr/share/doc/otrs-2.2.6/README.webserver.bz2.
Sample config files are in /var/www/my.host.name/otrs-2.2.6/scripts

If you are using FastCGI, don't forget to add -D FASTCGI
to your Apache options.

3. Setup your database. Read /usr/share/doc/otrs-2.2.6/README.database.bz2

4. Read /usr/share/doc/otrs-2.2.6/INSTALL.gz , pp. 9-12,
to finish the installation.

If you are upgrading, read /usr/share/doc/otrs-2.2.6/UPGRADING.bz2

=================================================================

* Install completed - success



Expected Results:  
installation without errors is expected

suggestion for solution:
either: chmod u+s /var/www/my.host.name/otrs-2.2.6/bin/SetPermissions.sh
or: change line 22 in /usr/share/webapps/otrs/2.2.6/hooks/reconfig-2 to
sh ${VHOST_ROOT}/${PF}/bin/SetPermissions.sh  ${VHOST_ROOT}/${PF} otrs apache apache apache > /dev/null || die "Could not set permissions"
(all in one single line)
Comment 1 Jesse Adelman 2008-06-20 18:28:10 UTC
I just got this as well.
Comment 2 Thomas Beutin 2008-11-02 15:06:57 UTC
This bug still exists in version 2.3.3
Comment 3 Davide Cendron (RETIRED) gentoo-dev 2009-06-15 15:52:06 UTC
Created attachment 194800 [details, diff]
otrs-2.3.3_bin_fix.patch

Here's a trivial (maybe not elegant) patch to fix this problem :-)
Comment 4 John L. Poole 2010-08-21 14:29:29 UTC
Created attachment 243857 [details]
webapp-config error "could not set permissions" + "failed to write content"
Comment 5 John L. Poole 2010-08-22 10:53:22 UTC
I altered
  /usr/share/webapps/otrs/2.2.6/hooks/reconfig-2
per the initial comment to the Bug and removed the two directories previously created.  Reran the installer, this time no error re: Permissions.

However, I did have the error (below modified by replacing real domain with "xxx.domain"):
  Failed to write content file /var/www/xxx.domain/htdocs/ot/.webapp-otrs-2.3.3!
  * Error was: 'ascii' codec can't encode characters in position 18434-18437: ordinal not in range(128)
Comment 6 John L. Poole 2010-08-22 11:21:18 UTC
I just realized OTRS is now in version 2.4.7, so I'm backing out my install and going the route of creating a custom ebuild so I pull in 2.4.7.  Therefore, my previous participation in the bug should be ignored.
Comment 7 Stefan G. Weichinger 2011-09-22 11:41:09 UTC
www-apps/otrs-3.0.10 still does not install correctly.

No files get to /usr/share/webapps so webapp-config can't use them.

I might try some of your old patches now. Wondering.
Comment 8 Anthony Basile gentoo-dev 2011-12-30 16:58:21 UTC
I'm pretty sure a fix should be applied to otrs and not webapp-config.  I'm going to change the title to reflect that.
Comment 9 tazinblack 2013-11-12 06:58:21 UTC
Here it's even not possible to emerge it:






bin/otrs.SetPermissions.pl - set OTRS file permissions
Copyright (C) 2001-2013 OTRS AG, http://otrs.com/
Setting permissions on /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10
Error in chown 101 81 /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10: Operation not permitted
 * ERROR: www-apps/otrs-3.2.10::gentoo failed (prepare phase):
 *   Could not set permissions
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_prepare
 *   environment, line 2558:  Called die
 * The specific snippet of code:
 *       perl "${S}"/bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=apache --otrs-group=apache --web-group=apache "${S}" || die "Could not set permissions";
 * 
 * If you need support, post the output of `emerge --info '=www-apps/otrs-3.2.10::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=www-apps/otrs-3.2.10::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/www-apps/otrs-3.2.10/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apps/otrs-3.2.10/temp/environment'.
 * Working directory: '/var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10/Kernel/Config'
 * S: '/var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10'


Looks like 3.2.10 and all older versions in portage are affected :-(


I think this line above 

chown 101 81 /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10

should look like 

chown 101:81 /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10


But I'm not able to fix this since I don't speak perl by now.
Please someone fix this. It's unusable like this.

By the way webapp-config support would be great!
Comment 10 Kspy 2013-12-19 18:01:41 UTC
The same problem on version 3.2.12.

* otrs-3.2.12.tar.bz2 SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                   [ ok ]
>>> Unpacking source...
>>> Unpacking otrs-3.2.12.tar.bz2 to /var/tmp/portage/www-apps/otrs-3.2.12/work
>>> Source unpacked in /var/tmp/portage/www-apps/otrs-3.2.12/work
>>> Preparing source in /var/tmp/portage/www-apps/otrs-3.2.12/work/otrs-3.2.12 ...
bin/otrs.SetPermissions.pl - set OTRS file permissions
Copyright (C) 2001-2013 OTRS AG, http://otrs.com/
Setting permissions on /var/tmp/portage/www-apps/otrs-3.2.12/work/otrs-3.2.12
Error in chown 102 81 /var/tmp/portage/www-apps/otrs-3.2.12/work/otrs-3.2.12: Operation not permitted
 * ERROR: www-apps/otrs-3.2.12::gentoo failed (prepare phase):
 *   Could not set permissions
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_prepare
 *   environment, line 2616:  Called die
 * The specific snippet of code:
 *       perl "${S}"/bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=apache --otrs-group=apache --web-group=apache "${S}" || die "Could not set permissions";
 * 
 * If you need support, post the output of `emerge --info '=www-apps/otrs-3.2.12::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=www-apps/otrs-3.2.12::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/www-apps/otrs-3.2.12/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apps/otrs-3.2.12/temp/environment'.
 * Working directory: '/var/tmp/portage/www-apps/otrs-3.2.12/work/otrs-3.2.12/Kernel/Config'
 * S: '/var/tmp/portage/www-apps/otrs-3.2.12/work/otrs-3.2.12'

>>> Failed to emerge www-apps/otrs-3.2.12, Log file:

>>>  '/var/tmp/portage/www-apps/otrs-3.2.12/temp/build.log'

 * Messages for package www-apps/otrs-3.2.12:

 * ERROR: www-apps/otrs-3.2.12::gentoo failed (prepare phase):
 *   Could not set permissions
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_prepare
 *   environment, line 2616:  Called die
 * The specific snippet of code:
 *       perl "${S}"/bin/otrs.SetPermissions.pl --otrs-user=otrs --web-user=apache --otrs-group=apache --web-group=apache "${S}" || die "Could not set permissions";
 * 
 * If you need support, post the output of `emerge --info '=www-apps/otrs-3.2.12::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=www-apps/otrs-3.2.12::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/www-apps/otrs-3.2.12/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apps/otrs-3.2.12/temp/environment'.
 * Working directory: '/var/tmp/portage/www-apps/otrs-3.2.12/work/otrs-3.2.12/Kernel/Config'
 * S: '/var/tmp/portage/www-apps/otrs-3.2.12/work/otrs-3.2.12'
Comment 11 Devan Franchini (RETIRED) gentoo-dev 2013-12-20 08:23:59 UTC
(In reply to tazinblack from comment #9)
> Here it's even not possible to emerge it:
> 
> 
> 
> 
> 
> 
> bin/otrs.SetPermissions.pl - set OTRS file permissions
> Copyright (C) 2001-2013 OTRS AG, http://otrs.com/
> Setting permissions on /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10
> Error in chown 101 81
> /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10: Operation not
> permitted
>  * ERROR: www-apps/otrs-3.2.10::gentoo failed (prepare phase):
>  *   Could not set permissions
>  * 
>  * Call stack:
>  *     ebuild.sh, line  93:  Called src_prepare
>  *   environment, line 2558:  Called die
>  * The specific snippet of code:
>  *       perl "${S}"/bin/otrs.SetPermissions.pl --otrs-user=otrs
> --web-user=apache --otrs-group=apache --web-group=apache "${S}" || die
> "Could not set permissions";
>  * 
>  * If you need support, post the output of `emerge --info
> '=www-apps/otrs-3.2.10::gentoo'`,
>  * the complete build log and the output of `emerge -pqv
> '=www-apps/otrs-3.2.10::gentoo'`.
>  * The complete build log is located at
> '/var/tmp/portage/www-apps/otrs-3.2.10/temp/build.log'.
>  * The ebuild environment file is located at
> '/var/tmp/portage/www-apps/otrs-3.2.10/temp/environment'.
>  * Working directory:
> '/var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10/Kernel/Config'
>  * S: '/var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10'
> 
> 
> Looks like 3.2.10 and all older versions in portage are affected :-(
> 
> 
> I think this line above 
> 
> chown 101 81 /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10
> 
> should look like 
> 
> chown 101:81 /var/tmp/portage/www-apps/otrs-3.2.10/work/otrs-3.2.10
> 
> 
> But I'm not able to fix this since I don't speak perl by now.
> Please someone fix this. It's unusable like this.
> 
> By the way webapp-config support would be great!

webapp-config developers do what they can to assist. The issue doesn't seem to be with webapp-config though, at least...what you're showing here. I'll try what I can to reproduce but as Anthony said, it looks like there is an issue with the ebuild.
Comment 12 Pacho Ramos gentoo-dev 2015-10-26 15:10:35 UTC
4.0.13 looks to install