-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Call to a member function isActive() on null after update to 3.3.11 Symfony version #24934
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
Comments
@fjpalacios thanks for reporting this issue and for providing all that information! I'd like to ask you which was the last Symfony version where your application worked. You said that the error happens after upgrading to 3.3.11. Were you using 3.3.10 before or it was an older version? I'd also like to know if any of the external conditions changed after the upgrade (the PHP version, the php.ini config, the execution environment (docker or not), etc.) You probably didn't change anything ... but we need to be sure. Thanks! |
@javiereguiluz yes, previously this update to 3.3.11 my project was in 3.3.10. I didn't change anything at all compared to how it was before, I don't use Docker, I don't upgraded PHP or nginx, nor changed my php.ini. Just a To ensure that the problem was the update I did |
Perhaps not sufficiently explained what I wanted to say in the last paragraph (my English should be improved). When I returned to 3.3.10 to test everything worked fine, but if I upgrade to 3.3.11 the same 500 error is still there. Sorry if my previous message was well understood, but I preferred to be sure. |
@fjpalacios you explained yourself perfectly: the application works with Symfony 3.3.10 but, if you upgrade to 3.3.11 and change nothing else, the application fails. |
Can you share a bit more context of the code where this call is made? Where is the session attribute in your code set, for example? |
We also experienced the same issue, due to this commit introduced in the 2.7.36 release: symfony/http-foundation@0d84932 For some reasons, the php session is active but the sessionHandler is not set, and this commit prevent the storage handler from setting the save handler if a session is active. This only break in the context of unit tests after instantiating a Symfony\Component\HttpKernel\Client and triggering a request. To move on, we had to use explicitely I noticed the session is artificially created by injecting a cookie in our unit tests, which might explain the trick: `// Get a test user to login to the system with
` |
@xabbuh my project is open source, maybe you can find useful to have all of the code. Just in case: https://github.com/sargantanacode/sargantanacode |
I've updated an app to 3.3.11 and I can't reproduce this or #24941. But we're not dealing with cookies in the tests of that app, which is what causes problems for @damienthiesson. |
Hello, I had a similar issue today after updating from 2.8.28 to 2.8.29. I got this error:
This is the part of clases.php file that cause it:
|
Hello, |
Hey, i use the code: $session = new Session();
return $session; greetings |
I am using Laravel 5.5. |
That's a good point... This will happen if your PHP session is already opened. We've decided not to call the |
@damienthiesson could you confirm that this issue is gone with the following PR? If this solves it (which I guess), we can merge to the 3.x branches and this should be solved for the rest of you. |
I had the same problem. Downgrading back to 3.3.10 fixed it. |
Hi, |
We need people testing the fix from #24946 before merging and making new releases and confirming that this fixes this issue. Thanks for your help and sorry for the inconvenience. |
This seems to work for me |
…kas, sroze) This PR was merged into the 2.7 branch. Discussion ---------- [HttpFoundation] Fix session-related BC break | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24941, #24934, #24947 and #24946 | License | MIT | Doc PR | - Conservative fix. Commits ------- 38186aa [HttpFoundation] Add test 3eaa188 [HttpFoundation] Fix session-related BC break
It's the first time that I reported a possible bug to Symfony and English isn't my mother tongue, so I want to apologize if I can't explain something clearly.
After upgrading to Symfony 3.3.11 failed all the battery of tests for my project. Among other failures, the most repeated is that the status code of the client wasn't 200 but 500, I then manually checked the project and whenever there is written this code:
It's true that there is a 500 error. And the Symfony error message is: Call to a member function isActive() on null.
The line of the log with the critical error is:
The Stack Trace offered is:
If I can do something more and it's within my ability just let me know.
The text was updated successfully, but these errors were encountered: