-
Notifications
You must be signed in to change notification settings - Fork 70
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
I can't login admin panel #79
Comments
no error report in excetion.log |
Hi, that is quite odd behavior we haven't experienced before. I'm guessing there must be some error happening causing this logout. I've checked on a production server running 2.4.2-p1 and it has no problems keeping me logged in in the backend. |
I have the same problem: i can log in but after the first click in the backend menu i get logged out. But the frontend works fine. In the Magento debug.log i see:
Phalcon is just found in vendor/php-http/discovery:
As soon as i remove the "sentry" configuration from app/etc/env.php Phalcon doesn't appear in the debug log anymore. I use |
@dzschille oh,guys,thanks for your info,I've been so busy lately that haven't time to give more info to @indykoning. |
I am experiencing the same problem in the logs - magento 2.4.4 and php8.1:
when i remove the sentry config from the .env then the logs disappear... |
We have also updated to Magento 2.4.4 and have still the same error:
When i remove the sentry config from app/etc/env.php then the logs disappears. |
For now i just created this composer patch...
|
I think this may have to do with Sentry's dependency on php-http/discovery which may cause issues. I know the Magento integration does not need any of these classes itself. I'm afraid i can't reproduce these debug logs on either environment |
We've done some more digging and sadly we're completely unable to fix this from our side. The log spam should not cause any problems though. Because of Magento's automatic Factory generation while developer mode is active it will try to generate factories for classes that don't exist, for packages that don't exist if you try to call class_exists Magento tries to generate the class when you call it using the folowing function: Which fails and throws an exception. It's all because of quirks and "features" of Magento's code and factory generation not playing too nice with class_exists. |
To the point of this specific issue, are there still any problems logging into the admin pannel? |
Hello, THIS PR broke e7015f5 it looks like sentry module trying to get context user before set area code it causing issue that variable $userContexts is empty public function __construct(CompositeHelper $compositeHelper, $userContexts = [])
{
$userContexts = $compositeHelper->filterAndSortDeclaredComponents($userContexts);
foreach ($userContexts as $userContext) {
$this->add($userContext['type']);
}
} $userContexts variable is injected by di.xml (only with specified area code) that's why session is empty and we cannot login to admin panel How to FIX:
|
Awesome! Thank you for pointing this out, i haven't been running into this nor have others i've asked to test out this code so i'm glad you let me know! I'm assuming it's caused by this Dependency Injection. And i should move this to later in the code when canGetUserData has already determined we should be able to get the user's data, correct? |
@indykoning exactly this dependency injection causing invoke __construct without data in $userContexts (because of no area set) |
I've created #152 in an attempt to fix it. Could you try it as well? 🙂 |
@indykoning after applied your fix all works perfectly :) |
Do you want to request a feature or report a bug?
bug
Bug: What is the current behavior?
When I enable this module,the admin panel will sign out soon after sign in.But the website front is normal.
Bug: What is the expected behavior?
sign in normal.
Bug: What is the proposed solution?
What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.
Magento version:2.4.2
sentry version:2.6
The text was updated successfully, but these errors were encountered: