View Issue Details

This bug affects 1 person(s).
 20
IDProjectCategoryView StatusLast Update
09984Bug reportsInstallationpublic2015-12-15 13:15
Reporteralansz Assigned ToLouisGac 
PriorityurgentSeverityblock 
Status closedResolutionfixed 
Product Version2.06+ 
Summary09984: opendir(/var/www/limesurvey/tmp/assets/69cb2cf3): failed to open dir: No such file or directory
Description

I am seeing the same bug as 9746, using 2.06+ build151018
2.05+ works fine.

Note that on my system (apache2.2), /var/www is the DocumentRoot,
but Apache's config is:

Alias /limesurvey /home/limesurvey

and limesurvey is installed under /home/limesurvey (and /home/limesurvey/tmp/assets/69cb2cf3 is created during the install)

/var/www is not at all involved in my limesurvey, and 2.05+ does not display this issue.

So whatever is calling this opendir is not going through apache2 properly.

Steps To Reproduce

Clean install of 2.06+
Visit http://host/limesurvey/index.php/admin page to try to complete install
Redirects to http://host/limesurvey/index.php?r=installer/welcome
Fails with above error.

Additional Information

Priority urgent in recognition of the security advisory for 2.05+

TagsNo tags attached.
Attached Files
limesurvey206plus-build151018_orig_patch (3,088 bytes)   
*** limesurvey206plus-build151018_orig/application/extensions/ExtendedClientScript/ExtendedClientScript.php	2015-10-19 02:52:38.000000000 +0900
--- limesurvey206plus-build151018/application/extensions/ExtendedClientScript/ExtendedClientScript.php	2015-11-05 09:55:58.565082210 +0900
***************
*** 201,209 ****
  	*/
  	private function combineAndCompress($type, $urls, $pos)
  	{
! 		$this->fileUrl or $this->fileUrl = $this->getCoreScriptUrl();
! 		$this->basePath or $this->basePath = realpath($_SERVER['DOCUMENT_ROOT']);
! 		$this->filePath or $this->filePath = $this->basePath.$this->fileUrl;
  
  		$optionsHash = ($type == 'js') ? md5($this->basePath . $this->compressJs . $this->ttlDays . $this->prefix)
  												 : md5($this->basePath . $this->compressCss . $this->ttlDays . $this->prefix . serialize($this->cssMinFilters) . serialize($this->cssMinPlugins));
--- 201,209 ----
  	*/
  	private function combineAndCompress($type, $urls, $pos)
  	{
!                 $this->fileUrl or $this->fileUrl = $this->getCoreScriptUrl();
!                 $this->basePath or $this->basePath = ROOT;
!                 $this->filePath or $this->filePath = $this->basePath.DIRECTORY_SEPARATOR.substr($this->fileUrl, strlen($_SERVER['CONTEXT_PREFIX']));
  
  		$optionsHash = ($type == 'js') ? md5($this->basePath . $this->compressJs . $this->ttlDays . $this->prefix)
  												 : md5($this->basePath . $this->compressCss . $this->ttlDays . $this->prefix . serialize($this->cssMinFilters) . serialize($this->cssMinPlugins));
***************
*** 228,234 ****
  
  		$fileName = $this->prefix.md5($combineHash.$optionsHash.$this->_changesHash).".$type";
  
! 		$this->_renewFile = (file_exists($this->filePath.'/'.$fileName)) ? false : true;
  
  		if ($this->_renewFile)
  		{
--- 228,234 ----
  
  		$fileName = $this->prefix.md5($combineHash.$optionsHash.$this->_changesHash).".$type";
  
! 		$this->_renewFile = (file_exists($this->filePath.DIRECTORY_SEPARATOR.$fileName)) ? false : true;
  
  		if ($this->_renewFile)
  		{
***************
*** 236,242 ****
  			$combinedFile = '';
  
  			foreach ($urls as $key => $file)
! 				$combinedFile .= file_get_contents($this->basePath.'/'.$file);
  
  			if ($type == 'js' && $this->compressJs)
  				$combinedFile = $this->minifyJs($combinedFile);
--- 236,242 ----
  			$combinedFile = '';
  
  			foreach ($urls as $key => $file)
! 				$combinedFile .= file_get_contents($this->basePath.substr($file, strlen($_SERVER['CONTEXT_PREFIX'])));
  
  			if ($type == 'js' && $this->compressJs)
  				$combinedFile = $this->minifyJs($combinedFile);
***************
*** 244,250 ****
  			if ($type == 'css' && $this->compressCss)
  				$combinedFile = $this->minifyCss($combinedFile);
  
! 			file_put_contents($this->filePath.'/'.$fileName, $combinedFile);
  		}
  
  		foreach ($urls as $url)
--- 244,250 ----
  			if ($type == 'css' && $this->compressCss)
  				$combinedFile = $this->minifyCss($combinedFile);
  
! 			file_put_contents($this->filePath.DIRECTORY_SEPARATOR.$fileName, $combinedFile);
  		}
  
  		foreach ($urls as $url)
Bug heat20
Complete LimeSurvey version number (& build)151018
I will donate to the project if issue is resolvedYes
BrowserChrome
Database type & versionmysql 5.5.44
Server OS (if known)Debian 8.2
Webserver software & version (if known)Apache 2.2
PHP Version5.6.12

Relationships

has duplicate 10027 closedc_schmitz Installation doesn't work in /app 
related to 10009 closedLouisGac limesurvey206plus-build151018 Installation Issue on Linux directory configured with Apache alias 

Users monitoring this issue

There are no users monitoring this issue.

Activities

atisne

atisne

2015-10-30 17:04

reporter   ~33470

Same issue on RedHat 5.4, Postgresql, apache 2.2.3, PHP 5.4.45
Same apache configuration as described in the bug report.
The asset is looked for in the wrong location. It is not under the DocumentRoot path but under the Alias path.

2.0.5+ installation was OK.

I'm agree with alansz on the criticity: we cannot upgrade to patch the security alert.

atisne

atisne

2015-10-30 17:09

reporter   ~33471

seems similar to 09746

freelancerdev

freelancerdev

2015-11-02 07:00

reporter   ~33474

Same issue with me. I tried to fix it for me may be it helps you.

https://bugs.limesurvey.org/view.php?id=10009

saito

saito

2015-11-05 05:45

reporter   ~33507

I have encountered the same problem in the arrangement of the alias and sub directories. then, resolve the problem at this patch. Does this help you?
https://bugs.limesurvey.org/view.php?id=9984

DenisChenu

DenisChenu

2015-11-07 01:29

developer   ~33530

I think this can be fixed with Yii config somewhere ... then in config.php

For url:
// Enforce a certain base URL
'request' => array(
'hostInfo' => 'http://www.example.org/alias'
),

ANd for path
At start of config.php:
return array(
'basePath' => dirname(dirname(FILE)),
'runtimePath' => dirname(dirname(dirname(FILE))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'runtime',
'name' => 'LimeSurvey',

Alternative : https://manual.limesurvey.org/Optional_settings#Advanced_Path_Settings

<b>But more </b>: in config.php : deactivate js/css compression :
'clientScript'=>array(
'combineJs'=>false,
'compressJs'=>false,
),

DenisChenu

DenisChenu

2015-11-07 01:32

developer   ~33531

PS : it's more a bug on http://www.yiiframework.com/extension/extendedclientscript/

Actual solution : deactivate this extension
'clientScript'=>array(
'combineJs'=>false,
'compressJs'=>false,
),

ANd send a request here : http://www.yiiframework.com/forum/index.php?/topic/1058-extension-extendedclientscript-reduce-your-page-loading-times/

atisne

atisne

2015-11-10 14:42

reporter   ~33551

I don't understand how to disable the extension.

If I add:

$config['clientScript'] = array(
'combineJs'=>false,
'compressJs'=>false,
);

in config-defaults.php, the issue persist.

I cannot add:

'clientScript'=>array(
'combineJs'=>false,
'compressJs'=>false,
)

in config.php since it does not yet exist. I must run the installer to have one.

How to do?

DenisChenu

DenisChenu

2015-11-10 15:03

developer   ~33552

You have to add it ....
example : https://framabin.org/?ebdb1749da794796#/EbSURaRAcrsceDzlB8tcq0dcx1j+tLmYV3YUvwSL88=

atisne

atisne

2015-11-16 17:57

reporter   ~33572

It's OK building the config.php manually.

The 'clientScript' parameter must be added in the array 'components'.

In application/config/config.php:

return array(
'name' => 'LimeSurvey',
'components' => array(

    'db' => array(
        ...
    ),

    'urlManager' => array(
        ....
    ),
    'clientScript'=>array( 'combineJs'=>false,
                           'compressJs'=>false )
),

...

This issue prohibits the use of the installer to build the file config.php which is, in my opinion, easier and safer.

c_schmitz

c_schmitz

2015-12-15 13:15

administrator   ~33942

2.06+ Build 151215 released

Issue History

Date Modified Username Field Change
2015-10-20 23:51 alansz New Issue
2015-10-30 17:04 atisne Note Added: 33470
2015-10-30 17:09 atisne Note Added: 33471
2015-11-02 07:00 freelancerdev Note Added: 33474
2015-11-02 09:41 Mazi Relationship added related to 10009
2015-11-02 09:41 Mazi Assigned To => LouisGac
2015-11-02 09:41 Mazi Status new => assigned
2015-11-05 05:44 saito File Added: limesurvey206plus-build151018_orig_patch
2015-11-05 05:45 saito Note Added: 33507
2015-11-07 01:18 DenisChenu Relationship added has duplicate 10027
2015-11-07 01:29 DenisChenu Note Added: 33530
2015-11-07 01:32 DenisChenu Note Added: 33531
2015-11-09 10:36 user45005 Issue Monitored: user45005
2015-11-10 14:42 atisne Note Added: 33551
2015-11-10 15:03 DenisChenu Note Added: 33552
2015-11-16 17:57 atisne Note Added: 33572
2015-12-09 15:53 LouisGac Status assigned => resolved
2015-12-09 15:53 LouisGac Resolution open => fixed
2015-12-15 13:15 c_schmitz Note Added: 33942
2015-12-15 13:15 c_schmitz Status resolved => closed
2021-08-02 20:28 guest Bug heat 18 => 20