Project

General

Profile

Actions

Bug #69296

closed

Error when adding first new page after fresh install

Added by Thomas Mayer over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
Start date:
2015-08-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Reproduce with:

After fresh install of TYPO3 CMS and very first backend-login

  • Wait for the kickstart templates to appear (but don't install one)
  • Click "Page" in the bar to the very left
  • Right click root element in page tree
  • Click "New"
  • 7.4.0 -> Error occurs: Oops, an error occurred! The CSRF protection token for the requested module is missing or invalid
  • 7.5.0-dev -> The requested resource "/record/editu0026token=9ee8e6699739a74a930722b88cc8585de87714eeu0026edit[pages]0=newu0026returnNewPageId=1u0026returnUrl=' '/typo3/index.php?route=%2Frecord%2Fnew&token=d98fa3b7e8c371688d6b101f97541ae399332ac4&id=0&pagesOnly=1" was not found

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #66704: The CSRF protection token for the requested module is missing or invalid - template tab in backendClosed2015-05-01

Actions
Related to TYPO3 Core - Bug #69021: Pagetree context menu show preview button returns Invalid CSRF TokenClosedOliver Hader2015-08-13

Actions
Actions #1

Updated by Thomas Mayer over 8 years ago

There's other user complaining in 66704:

d bart wrote:

I get this error message in 7.3.1.

Fresh install from typo3_src-7.3.1.tar.gz. When I want to add a new page I get this error.

"The CSRF protection token for the requested module is missing or invalid"

Server is Linux, Debian 8, PHP 5.6.7

d bart wrote:

I get the same error in 7.4 commit 2ec24139462

Reproduce:

1. clone from https://github.com/TYPO3/TYPO3.CMS.git
2. run composer install
3. setup is workin, backend running
4. click on "New TYPO3 site", click on "New"

----> error

Server is Linux, Debian 8, PHP 5.6.7, running in virtualBox

Actions #2

Updated by Thomas Mayer over 8 years ago

There is no head TYPO3_7-4 according to https://git.typo3.org/Packages/TYPO3.CMS.git/heads

reproduced against 7.4.0-tagged version c3ae8d677d59439777121b32548004ef4a8838ea with 4 hits out of 4 tries (including installation)

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1417988921: The CSRF protection token for the requested module is missing or invalid
TYPO3\CMS\Core\Exception thrown in file /var/webadmin/typo3_src/typo3/sysext/backend/Classes/Http/BackendModuleRequestHandler.php in line 76.
Requested URL: http://172.17.0.4/typo3/index.php?M=record_editu0026moduleToken=8de19b18123ff83f4ace68aa3c739c5654f8591du0026edit[pages][0]=newu0026returnNewPageId=1u0026returnUrl=%27+%27%2Ftypo3%2Findex.php%3FM%3Ddb_new%26moduleToken%3Dc5e9cf8ac19482653deda755a08aad63daf4838a%26id%3D0%26pagesOnly%3D1

And a stacktrace:

#1417988921: The CSRF protection token for the requested module is missing or invalid (More information)

TYPO3\CMS\Core\Exception thrown in file
/var/webadmin/typo3_src/typo3/sysext/backend/Classes/Http/BackendModuleRequestHandler.php in line 76.

5 TYPO3\CMS\Backend\Http\BackendModuleRequestHandler::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/webadmin/typo3_src/typo3/sysext/core/Classes/Core/Bootstrap.php:
00286: 
00287:   // Execute the command which returns a Response object or NULL
> 00288:   $this->response = $requestHandler->handleRequest($request);
00289:   return $this;
00290:  }

4 TYPO3\CMS\Core\Core\Bootstrap::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/webadmin/typo3_src/typo3/sysext/backend/Classes/Http/Application.php:
00090:   */
00091:  public function run(callable $execute = NULL) {
> 00092:   $this->bootstrap->handleRequest($this->request);
00093: 
00094:   if ($execute !== NULL) {

3 TYPO3\CMS\Backend\Http\Application::run()

/var/webadmin/typo3_src/typo3/index.php:
00018: call_user_func(function() {
00019:  $classLoader = require __DIR__ . '/vendor/autoload.php';
> 00020:  (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
00021: });

2 {closure}()
> 1 call_user_func(Closure)

/var/webadmin/typo3_src/typo3/index.php:
00019:  $classLoader = require __DIR__ . '/vendor/autoload.php';
00020:  (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
> 00021: });

Reproduce with:
After git-checkout, clean up composer:

rm composer.lock
git checkout composer.lock
rm -rf vendor/ typo3/vendor/ bin/ Packages/Libraries/

Follow steps at https://github.com/thomaszbz/native-dockerfiles-typo3/tree/ec1f42855ec48cf8ef3fb45012d6480f034b4c7a
with provisioning https://github.com/thomaszbz/native-dockerfiles-typo3/blob/ec1f42855ec48cf8ef3fb45012d6480f034b4c7a/typo3-debian-latest/Dockerfile ,
but with no extensions installed. Note that all of TYPO3's system checks go green in this scenario.

After fresh install of TYPO3 CMS and very first backend-login
  • Wait for the kickstart templates to appear (but don't install one)
  • Click "Page" in the bar to the very left
  • Right click root element in page tree
  • Click "New"
  • -> Error occurs: Oops, an error occurred! The CSRF protection token for the requested module is missing or invalid

Using composer install --optimize-autoloader (aka -o) does not have an effect on this issue.

==============================

Also tested 7.5.0-dev, commit-id 8f540ffbf880691a17d6d4c3ca4f184abba84d22 (latest master) with 3 hits out of 3 tries (including installation)
with exactly the same setup (from https://github.com/thomaszbz/native-dockerfiles-typo3/tree/ec1f42855ec48cf8ef3fb45012d6480f034b4c7a)

During the installation procedure all (install tool) system tests went green for 7.5.0-dev.

For exactly the same reproduction steps I got a

Oops, an error occurred!

The requested resource "/record/editu0026token=9ee8e6699739a74a930722b88cc8585de87714eeu0026edit[pages][0]=newu0026returnNewPageId=1u0026returnUrl=' '/typo3/index.php?route=%2Frecord%2Fnew&token=d98fa3b7e8c371688d6b101f97541ae399332ac4&id=0&pagesOnly=1" was not found.

with log entry:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: 
#1425389240: The requested resource "/record/editu0026token=9ee8e6699739a74a930722b88cc8585de87714eeu0026edit[pages][0]=newu0026returnNewPageId=1u0026returnUrl=' '/typo3/index.php?route=%2Frecord%2Fnew&token=d98fa3b7e8c371688d6b101f97541ae399332ac4&id=0&pagesOnly=1" was not found.
TYPO3\CMS\Backend\Routing\Exception\ResourceNotFoundException thrown in file /var/webadmin/typo3_src/typo3/sysext/backend/Classes/Routing/Router.php in line 78.
Requested URL: http://172.17.0.8/typo3/index.php?route=%2Frecord%2Feditu0026token=9ee8e6699739a74a930722b88cc8585de87714eeu0026edit[pages][0]=newu0026returnNewPageId=1u0026returnUrl=%27+%27%2Ftypo3%2Findex.php%3Froute%3D%252Frecord%252Fnew%26token%3Dd98fa3b7e8c371688d6b101f97541ae399332ac4%26id%3D0%26pagesOnly%3D1 

And stack trace:

#1425389240: The requested resource "/record/editu0026token=f3e3930537f2ba47af14b0805c210d30fe71ad84u0026edit[pages][0]=newu0026returnNewPageId=1u0026returnUrl=' '/typo3/index.php?route=%2Frecord%2Fnew&token=b33bd1b33c695a1c7c1ab3d74d4c1ad993f36e58&id=0&pagesOnly=1" was not found. (More information)

TYPO3\CMS\Backend\Routing\Exception\ResourceNotFoundException thrown in file
/var/webadmin/typo3_src/typo3/sysext/backend/Classes/Routing/Router.php in line 78.

8 TYPO3\CMS\Backend\Routing\Router::match("/record/editu0026token=f3e3930537f2ba47af14b0805c2…33c695a1c7c1ab3d74d4c1ad993f36e58&id=0&pagesOnly=1")

/var/webadmin/typo3_src/typo3/sysext/backend/Classes/Routing/Router.php:
00086:   */
00087:  public function matchRequest(ServerRequestInterface $request) {
> 00088:   return $this->match($request->getAttribute('routePath'));
00089:  }
00090: }

7 TYPO3\CMS\Backend\Routing\Router::matchRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/webadmin/typo3_src/typo3/sysext/backend/Classes/Http/RequestHandler.php:
00175:   /** @var Route $route */
00176:   $router = GeneralUtility::makeInstance(Router::class);
> 00177:   $route = $router->matchRequest($request);
00178:   $request = $request->withAttribute('route', $route);
00179:   if (!$this->isValidRequest($request)) {

6 TYPO3\CMS\Backend\Http\RequestHandler::dispatch(TYPO3\CMS\Core\Http\ServerRequest)

/var/webadmin/typo3_src/typo3/sysext/backend/Classes/Http/RequestHandler.php:
00090:   // Check if the router has the available route and dispatch.
00091:   if ($routingEnabled) {
> 00092:    return $this->dispatch($request);
00093:   }
00094: 

5 TYPO3\CMS\Backend\Http\RequestHandler::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/webadmin/typo3_src/typo3/sysext/core/Classes/Core/Bootstrap.php:
00286: 
00287:   // Execute the command which returns a Response object or NULL
> 00288:   $this->response = $requestHandler->handleRequest($request);
00289:   return $this;
00290:  }

4 TYPO3\CMS\Core\Core\Bootstrap::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/webadmin/typo3_src/typo3/sysext/backend/Classes/Http/Application.php:
00090:   */
00091:  public function run(callable $execute = NULL) {
> 00092:   $this->bootstrap->handleRequest($this->request);
00093: 
00094:   if ($execute !== NULL) {

3 TYPO3\CMS\Backend\Http\Application::run()

/var/webadmin/typo3_src/typo3/index.php:
00018: call_user_func(function() {
00019:  $classLoader = require __DIR__ . '/../vendor/autoload.php';
> 00020:  (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
00021: });

2 {closure}()
1 call_user_func(Closure)

/var/webadmin/typo3_src/typo3/index.php:
00019:  $classLoader = require __DIR__ . '/../vendor/autoload.php';
00020:  (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
> 00021: });

==============================

PHP 5.6.9-0+deb8u1, Debian 8, running with Docker in native mode (without virtualization, Host Kernel 3.19 provided by ubuntu 14.04.3)

To sum up:

  • It's a reproducable bug (and a showstopper)
  • Affected versions: 7.4.0 and 7.5.0-dev (current master)
  • Errors messages of 7.4.0 and current master are different => maybe this issue requires two fixes.
  • If there was a fix for this between 7.4.0 and current master, then it is not a valid one (does not fix the issue) or something else broke in the meantime
  • TYPO3 6.2.14 is not affected.
Actions #3

Updated by Thomas Mayer over 8 years ago

Workaround, which applies for

  • 7.4.0
  • 7.5.0-dev 8f540ffbf880691a17d6d4c3ca4f184abba84d22:
  • Export (to .t3d) a single leaf page from another TYPO3 CMS instance (mine was 6.2)
  • Right click root element in page tree => Import from .t3d (I imported only page properties)
  • Now I can append other pages to that page by using the "New" operation (which failed before)
  • I can even add pages (with "New" to the root element which did not work before.

Still, none of my pages is tagged as "Use as Root Page" in page properties/"Behaviour" => It does not have to do with "Root Page". Instead, at least one page must exist to get rid of the Bug (as a workaround).

Limitation: When I delete all pages in the page tree, and then try to right-click-"New" => I hit the error again. Basically this means that this workaround only works as long as you don't delete all pages.

===========

Another workaround for 7.4.0 (which I found at https://wiki.typo3.org/Exception/CMS/1417988921) is to
Create your first page in the List-tab. Afterwards it will work in the Page-tab too. Copied from this german thread: https://forum.typo3.org/index.php/t/210486/
The relevant step here is to

  • "Create a new page -> Page (inside)" and
  • not "create a new page -> Page (select position)" because with that I get the error again.

===========

Another workaround for 7.4.0 is to use the drag & drop objects above the page tree.

Actions #4

Updated by Stephan Großberndt over 8 years ago

  • Target version set to 7 LTS
Actions #5

Updated by Mathias Schreiber over 8 years ago

  • Status changed from New to Resolved

fixed on master

Actions #6

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF