Skip to content

[Installer] | Setup - Page, files dir path not set on first installation when default path is not edited #11171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
ronste opened this issue Mar 25, 2025 · 3 comments
Assignees
Milestone

Comments

@ronste
Copy link

ronste commented Mar 25, 2025

Valid Title

  • I have updated the title to accurately reflect the bug description

Description

When the installer is run for the first time and the default value of files dir is not edited, the files dir internally is not set correctly despite being shown on the installer page as "/var/www/html/files" (seems to be the default value on the installer page).

The value "/var/www/html/files" is written as such into the config file, however, internally it still is "files" (probably loaded from config.inc.php):

Image

Subsequently this reults in the following errors:

PHP Warning:  mkdir(): Permission denied in /var/www/html/ojs/lib/pkp/classes/file/FileManager.php on line 424
PHP Fatal error:  Uncaught TypeError: Cannot assign null to property PKP\\scheduledTask\\ScheduledTask::$executionLogFile of type string in /var/www/html/ojs/lib/pkp/classes/scheduledTask/ScheduledTask.php:68

When ignoring the errors and calling http://localhost:7020 again OJS shows a blanck page and additional PHP errors:

PHP Fatal error:  Uncaught Error: Call to a member function getVersionString() on null in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php:244
PHP Fatal error:  Uncaught Error: Call to a member function getContext() on null in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php:487

When setting config.inc.php back to installed = off and run it again it works fine (as the correct value of files dir is loaded from config.inc.php).

I never edited the input field for the files folder since it was correct from the beginning. It seems there is a syncing issue between config file and default value on the install screen.

Steps to Reproduce

  1. Start a new installation of OJS on a system where the files dir is created as "/var/www/html/files"
  2. Finish the installation screen without editing the files dir value (i.e. using the default value)
  3. Look at PHP error log

Expected Result

OJS should start up an run.

Actual Result

White screen and PHP errors.

Environment Details

Debian GNU/Linux 12

Application Version

OJS 3.5rc2

Logs

Full error logs

[Tue Mar 25 08:48:25.573670 2025] [php:warn] [pid 10:tid 10] [client 127.0.0.1:55724] PHP Warning:  mkdir(): Permission denied in /var/www/html/ojs/lib/pkp/classes/file/FileManager.php on line 424, referer: http://localhost:7020/index.php/index/de/install
[Tue Mar 25 08:48:25.573770 2025] [php:error] [pid 10:tid 10] [client 127.0.0.1:55724] PHP Fatal error:  Uncaught TypeError: Cannot assign null to property PKP\\scheduledTask\\ScheduledTask::$executionLogFile of type string in /var/www/html/ojs/lib/pkp/classes/scheduledTask/ScheduledTask.php:68\nStack trace:\n#0 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(952): PKP\\scheduledTask\\ScheduledTask->__construct()\n#1 [internal function]: PKP\\install\\Installer->updateRorRegistryDataset()\n#2 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(490): call_user_func()\n#3 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(297): PKP\\install\\Installer->executeAction()\n#4 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(206): PKP\\install\\Installer->executeInstaller()\n#5 /var/www/html/ojs/lib/pkp/classes/install/form/InstallForm.php(198): PKP\\install\\Installer->execute()\n#6 /var/www/html/ojs/lib/pkp/pages/install/InstallHandler.php(93): PKP\\install\\form\\InstallForm->execute()\n#7 [internal function]: PKP\\pages\\install\\InstallHandler->install()\n#8 /var/www/html/ojs/lib/pkp/classes/core/PKPRouter.php(327): call_user_func()\n#9 /var/www/html/ojs/lib/pkp/classes/core/PKPPageRouter.php(249): PKP\\core\\PKPRouter->_authorizeInitializeAndCallRequest()\n#10 /var/www/html/ojs/lib/pkp/classes/core/Dispatcher.php(157): PKP\\core\\PKPPageRouter->route()\n#11 /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php(422): PKP\\core\\Dispatcher->dispatch()\n#12 /var/www/html/ojs/index.php(21): PKP\\core\\PKPApplication->execute()\n#13 {main}\n  thrown in /var/www/html/ojs/lib/pkp/classes/scheduledTask/ScheduledTask.php on line 68, referer: http://localhost:7020/index.php/index/de/install
[Tue Mar 25 08:49:38.502381 2025] [php:error] [pid 9:tid 9] [client 127.0.0.1:35818] PHP Fatal error:  Uncaught Error: Call to a member function getVersionString() on null in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php:244\nStack trace:\n#0 /var/www/html/ojs/classes/core/Application.php(47): PKP\\core\\PKPApplication->__construct()\n#1 /var/www/html/ojs/lib/pkp/includes/bootstrap.php(37): APP\\core\\Application->__construct()\n#2 /var/www/html/ojs/index.php(18): require_once('...')\n#3 {main}\n  thrown in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php on line 244
[Tue Mar 25 08:49:38.512007 2025] [php:error] [pid 9:tid 9] [client 127.0.0.1:35818] PHP Fatal error:  Uncaught Error: Call to a member function getContext() on null in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php:487\nStack trace:\n#0 /var/www/html/ojs/lib/pkp/classes/plugins/PluginRegistry.php(238): PKP\\core\\PKPApplication->getEnabledProducts()\n#1 /var/www/html/ojs/lib/pkp/classes/plugins/PluginRegistry.php(127): PKP\\plugins\\PluginRegistry::loadFromDatabase()\n#2 /var/www/html/ojs/lib/pkp/classes/plugins/PluginRegistry.php(194): PKP\\plugins\\PluginRegistry::loadCategory()\n#3 [internal function]: PKP\\plugins\\PluginRegistry::PKP\\plugins\\{closure}()\n#4 /var/www/html/ojs/lib/pkp/classes/plugins/PluginRegistry.php(194): array_reduce()\n#5 /var/www/html/ojs/lib/pkp/classes/scheduledTask/PKPScheduler.php(129): PKP\\plugins\\PluginRegistry::loadAllPlugins()\n#6 /var/www/html/ojs/lib/pkp/classes/core/ScheduleServiceProvider.php(87): PKP\\scheduledTask\\PKPScheduler->registerPluginSchedules()\n#7 [internal function]: PKP\\core\\ScheduleServiceProvider->PKP\\core\\{closure}()\n#8 {main}\n  thrown in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php on line 487

Additional Information

No response

Related Issues

  1. [OMP] | Installation - 3.5 RC2 installation ends with error 500 #11343

PRs

Stable-3.5.0

pkp-lib --> #11295
ojs --> pkp/ojs#4842 [TEST ONLY]
omp --> pkp/omp#1969 [TEST ONLY]
ops --> pkp/ops#968 [TEST ONLY]

@asmecher asmecher added this to the 3.5 Internal milestone Mar 25, 2025
@Tribunal33 Tribunal33 self-assigned this Mar 25, 2025
@jonasraoni
Copy link
Contributor

jonasraoni commented Mar 28, 2025

Just sharing an extra error from the thread:

PHP Fatal error:  Uncaught TypeError: Cannot assign null to property PKP\scheduledTask\ScheduledTask::$executionLogFile of type string in /var/www/html/ojs/lib/pkp/classes/scheduledTask/ScheduledTask.php:68
Stack trace:
#0 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(952): PKP\scheduledTask\ScheduledTask->__construct()
#1 [internal function]: PKP\install\Installer->updateRorRegistryDataset()
#2 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(490): call_user_func()
#3 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(297): PKP\install\Installer->executeAction()
#4 /var/www/html/ojs/lib/pkp/classes/install/Installer.php(206): PKP\install\Installer->executeInstaller()
#5 /var/www/html/ojs/lib/pkp/classes/install/form/InstallForm.php(198): PKP\install\Installer->execute()
#6 /var/www/html/ojs/lib/pkp/pages/install/InstallHandler.php(93): PKP\install\form\InstallForm->execute()
#7 [internal function]: PKP\pages\install\InstallHandler->install()
#8 /var/www/html/ojs/lib/pkp/classes/core/PKPRouter.php(327): call_user_func()
#9 /var/www/html/ojs/lib/pkp/classes/core/PKPPageRouter.php(249): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest()
#10 /var/www/html/ojs/lib/pkp/classes/core/Dispatcher.php(157): PKP\core\PKPPageRouter->route()
#11 /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.php(422): PKP\core\Dispatcher->dispatch()
#12 /var/www/html/ojs/index.php(21): PKP\core\PKPApplication->execute()
#13 {main}
  thrown in /var/www/html/ojs/lib/pkp/classes/scheduledTask/ScheduledTask.php on line 68, referer: http://localhost:7020/index.php/index/de/install

@touhidurabir
Copy link
Member

I looked into the issue it seems this runs much deeper than it seems . The problem generated form <code function="updateRorRegistryDataset"/> which in return get called to method updateRorRegistryDataset which in return via a scheduler task called at PKP\scheduledTask\ScheduledTask::__construct where it get the wrong files_dir path and rise a assert(false) .

However it seems that at the installation phase , after the config file update via PKP\install\Installer::updateConfig, we are still getting the initial config data . for example , if set files_dir = files and form install form , set it /Users/abir/Sites/code/files, still get the files for Config::getVar('files_dir') .

I think after a successful write and update to config in the install phase , we need to immediately reset to config data in registry to get the latest updated details .

@asmecher @jonasraoni what do you think ? I have added a PR at #11171 (comment) . However my main concern is from where and when this has been starting to behave like this ?

@touhidurabir touhidurabir self-assigned this Apr 21, 2025
touhidurabir added a commit to touhidurabir/pkp-lib that referenced this issue Apr 30, 2025
@asmecher
Copy link
Member

asmecher commented May 2, 2025

@touhidurabir, the fix looks harmless enough, and it tests working for me on an install that recently encountered the same problem. I've also forward-ported this to main.

@asmecher asmecher closed this as completed May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants