Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] EnsureHttpCache::getTraceKey() does not throw exception#58921

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

lyrixx
Copy link
Member

@lyrixxlyrixx commentedNov 19, 2024
edited
Loading

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
Issues-
LicenseMIT

We have such logs in our logs. It's in our raw PHP logs. They are not caught by monolog, it's too early

[11-Oct-2024 01:23:33 UTC] PHP Fatal error:  Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: Invalid method override "__CONSTRUCT". in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php:1234Stack trace:#0 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(728): Symfony\Component\HttpFoundation\Request->getMethod()#1 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/HttpCache/HttpCache.php(207): Symfony\Component\HttpKernel\HttpCache\HttpCache->getTraceKey()#2 /var/www/redirection.io/backend/blue/vendor/symfony/http-kernel/Kernel.php(188): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()#3 /var/www/redirection.io/backend/blue/web/app.php(9): Symfony\Component\HttpKernel\Kernel->handle()#4 {main}  thrown in /var/www/redirection.io/backend/blue/vendor/symfony/http-foundation/Request.php on line 1234

I managed to reproduced locally.

  • Before the patch, without the http_cache, symfony returns a 405
  • After the patch, without the http_cache, symfony returns a 405
  • Before the patch, with the http_cache, symfony returns a 500, without any information (too early)
  • After the patch, with the http_cache, symfony returns a 405

@carsonbotcarsonbot added this to the5.4 milestoneNov 19, 2024
@lyrixxlyrixx changed the title[HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception[HttpKernel] EnsureHttpCache::getTraceKey() does not throw exceptionNov 19, 2024
@lyrixxlyrixxforce-pushed theSuspiciousOperationException-and-cache branch from7566856 to3e931d8CompareNovember 19, 2024 09:22
try {
return $request->getMethod().' '.$path;
} catch (SuspiciousOperationException $e) {
return '_INVALID_ '.$path;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

to make it clear it's the method?

Suggested change
return'_INVALID_'.$path;
return'_BAD_METHOD_'.$path;

@nicolas-grekasnicolas-grekasforce-pushed theSuspiciousOperationException-and-cache branch from3e931d8 toa2ebbe0CompareNovember 20, 2024 10:47
@nicolas-grekas
Copy link
Member

Thank you@lyrixx.

@nicolas-grekasnicolas-grekas merged commit32d55d7 intosymfony:5.4Nov 20, 2024
10 of 12 checks passed
@lyrixxlyrixx deleted the SuspiciousOperationException-and-cache branchNovember 20, 2024 12:41
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

3 participants
@lyrixx@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp