Bug #86785
closed
Calling scheduler command on CLI throws error if not in /var/www/html
Added by Chris Müller about 6 years ago.
Updated over 5 years ago.
Description
Calling the scheduler command on CLI throws an error, if the TYPO3 installation is not running in /var/www/html/
.
Given the installation, e.g., in /var/www/example.org
and calling on CLI
/var/www/example.org/public/typo3/sysext/core/bin/typo3 scheduler:run
the following error is given back:
In GeneralUtility.php line 2172:
Could not create directory "/var/www/html/var/log/"!
Yes, the script has no right to write there, but it is also the wrong directory. It should write into /var/www/example.org/var/log/
.
Files
I could not reproduce that with current master. Could you elaborate a bit on your environment?
Maybe you could debug what's going on in typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2172 in your case?
I can reproduce the problem with TYPO3 9.5.1 on a Ubuntu 16.04 box.
When I create the folder /var/www/html/var/log
and give write access to the user, who executes the script, the log file is written in this directory. But this is wrong, it should be written in /var/www/example.org/var/log
.
So check, if you have such a folder and the executing user has write access. If yes, remove the write access and try it again - this should give you the error.
Chris Müller wrote:
I can reproduce the problem with TYPO3 9.5.1 on a Ubuntu 16.04 box.
When I create the folder /var/www/html/var/log
and give write access to the user, who executes the script, the log file is written in this directory. But this is wrong, it should be written in /var/www/example.org/var/log
.
So check, if you have such a folder and the executing user has write access. If yes, remove the write access and try it again - this should give you the error.
Might be an issue with the scheduler tasks. The serialized task object in table "tx_scheduler_task" has entries with the Logger and its logFile paths. If you add an scheduler task on a different environment and import the database structure with data to another server, you will get into trouble with the path. See attached screenshot.
See: /typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php:907
We should not save file paths to database tables, because of migration/deployments to other server and paths.
Same problem here with 9.5.3, deploying to another server is a problem.
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Related to Bug #87261: Upgrade wizard for scheduler tasks with invalid Logger instance paths added
- Has duplicate Bug #87715: Exception while deserialization of a task object added
- Has duplicate Bug #87094: A Symfony Console based scheduler task can't be executed and breaks the scheduler module added
- Related to Bug #87780: Extbase Task should call parents __sleep and __wakeup Methods added
- Related to Bug #86941: Logger instances in scheduler tasks are deserialized with outdated paths added
- Status changed from Resolved to Closed
- Related to Task #90415: Clarify change "Important: #86785 - Calling scheduler command on CLI throws error if not in /var/www/html" ? added
Also available in: Atom
PDF