8000 500 error in Web Debug Toolbar · Issue #31476 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

500 error in Web Debug Toolbar #31476

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
j4nr6n opened this issue May 10, 2019 · 3 comments
Closed

500 error in Web Debug Toolbar #31476

j4nr6n opened this issue May 10, 2019 · 3 comments

Comments

@j4nr6n
Copy link
Contributor
j4nr6n commented May 10, 2019

Symfony version(s) affected: 4.3.0-BETA1, 4.4.0-dev

Description
When running the latest dev code, a 500 error is thrown in /_wdt/{identifier}.

Screenshot from 2019-05-10 15-51-07

How to reproduce

  • composer create-project symfony/website-skeleton
  • add "minimum-stability": "beta" to composer.json
  • change extra.symfony.require to ^4.2 in composer.json
  • composer update

See reproducer app here: https://github.com/j4nr6n/reproducerApp

Possible Solution

Additional context
Screenshot from 2019-05-10 16-04-03

@Simperfit
Copy link
Contributor

I can reproduce this and confirm the issue:
It seems that the generated twig is properly calling the object to get the errors, but this object has been serialized (I didn't found why):

  dump($context["collector"] );
        echo ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["collector"]) || array_key_exists("collector", $context) ? $context["collector"] : (function () { throw new RuntimeError('Variable "collector" does not exist.', 31, $this->source); })()), "data", [], "any", false, false, false, 31), "nb_errors", [], "any", false, false, false, 31)) ? ("error") : (""));
        echo " ";

it dumps:

6c09583e532550a4b8998db060b8e5ee1657e79eb109632ad1215ffad785babe.php on line 142:
FormDataCollector^ {#883 ▼
  -dataExtractor: null
  -dataByForm: null
  -dataByView: null
  -formsByView: null
  #data: "O:39:"Symfony\Component\VarDumper\Cloner\Data":6:{s:45:"\x00Symfony\Component\VarDumper\Cloner\Data\x00data";a:2:{i:0;a:1:{i:0;a:1:{i:1;i:1;}}i:1;a:3:{s:5:"form ▶"
  -cloner: null
}

The collector in the controller have non serialized data.

@j4nr6n j4nr6n changed the title 500 error in web debug toolbar 500 error in Web Debug Toolbar May 13, 2019
@Simperfit
Copy link
Contributor

I found the rootcase and I'm going to send a PR !

@Simperfit
Copy link
Contributor

Tested with the reproducer, the linked bugfix is fixing the bug properly ;)

@fabpot fabpot closed this as completed May 18, 2019
fabpot added a commit that referenced this issue May 18, 2019
…erialized data (Simperfit)

This PR was merged into the 4.3 branch.

Discussion
----------

[WebProfilerBundle][Form] The form data collector return serialized data

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #31476 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- required for new features -->

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the master branch.
-->

This bug occurs because at some point the FormDataCollector was returning serialized data, this has been changed in the upcoming branches but it seems that the bug occurs when using different version of the form component and the WebProfilerBundle.

This bugfix add a conflict param on the WebProfilerBundle to avoid using version of the form component who still serialize the data.

Commits
-------

70fdafd [WebProfilerBundle][Form] The form data collector return serialized object when profiler bundle attends object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0