Bug #86785
closedCalling scheduler command on CLI throws error if not in /var/www/html
0%
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
Updated by Jonas Eberle about 6 years ago
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?
Updated by Chris Müller about 6 years ago
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.
Updated by Joerg Boesche almost 6 years ago
- File screenshot.png screenshot.png added
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.
Updated by Wolfgang Wagner almost 6 years ago
Same problem here with 9.5.3, deploying to another server is a problem.
Updated by Gerrit Code Review almost 6 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59237
Updated by Gerrit Code Review almost 6 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59237
Updated by Gerrit Code Review almost 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59237
Updated by Gerrit Code Review almost 6 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59253
Updated by Joerg Boesche almost 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6342c0037a8c82d1f2fb0621a05b84c3588b8403.
Updated by Joerg Boesche almost 6 years ago
- Related to Bug #87261: Upgrade wizard for scheduler tasks with invalid Logger instance paths added
Updated by Georg Ringer almost 6 years ago
- Has duplicate Bug #87715: Exception while deserialization of a task object added
Updated by Georg Ringer almost 6 years ago
- Has duplicate Bug #87094: A Symfony Console based scheduler task can't be executed and breaks the scheduler module added
Updated by Achim Fritz over 5 years ago
- Related to Bug #87780: Extbase Task should call parents __sleep and __wakeup Methods added
Updated by Benni Mack over 5 years ago
- Related to Bug #86941: Logger instances in scheduler tasks are deserialized with outdated paths added
Updated by Susanne Moog over 4 years ago
- Related to Task #90415: Clarify change "Important: #86785 - Calling scheduler command on CLI throws error if not in /var/www/html" ? added