Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2018-12-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

screenshot.png (72.8 KB) screenshot.png Joerg Boesche, 2018-12-19 16:02

Related issues 6 (0 open6 closed)

Related to TYPO3 Core - Bug #87261: Upgrade wizard for scheduler tasks with invalid Logger instance pathsClosedJoerg Boesche2018-12-21

Actions
Related to TYPO3 Core - Bug #87780: Extbase Task should call parents __sleep and __wakeup MethodsClosed2019-02-25

Actions
Related to TYPO3 Core - Bug #86941: Logger instances in scheduler tasks are deserialized with outdated pathsClosed2018-11-16

Actions
Related to TYPO3 Core - Task #90415: Clarify change "Important: #86785 - Calling scheduler command on CLI throws error if not in /var/www/html" ?Closed2020-02-18

Actions
Has duplicate TYPO3 Core - Bug #87715: Exception while deserialization of a task objectClosed2019-02-14

Actions
Has duplicate TYPO3 Core - Bug #87094: A Symfony Console based scheduler task can't be executed and breaks the scheduler moduleClosed2018-12-07

Actions
Actions #1

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?

Actions #2

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.

Actions #3

Updated by Joerg Boesche almost 6 years ago

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.

Actions #4

Updated by Wolfgang Wagner almost 6 years ago

Same problem here with 9.5.3, deploying to another server is a problem.

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

Updated by Joerg Boesche almost 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Joerg Boesche almost 6 years ago

  • Related to Bug #87261: Upgrade wizard for scheduler tasks with invalid Logger instance paths added
Actions #11

Updated by Georg Ringer almost 6 years ago

  • Has duplicate Bug #87715: Exception while deserialization of a task object added
Actions #12

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
Actions #13

Updated by Achim Fritz over 5 years ago

  • Related to Bug #87780: Extbase Task should call parents __sleep and __wakeup Methods added
Actions #14

Updated by Benni Mack over 5 years ago

  • Related to Bug #86941: Logger instances in scheduler tasks are deserialized with outdated paths added
Actions #15

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions #16

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
Actions

Also available in: Atom PDF