Skip to content
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

Reset password throws error since 2.2.6 #18256

Closed
edwinbos opened this issue Sep 26, 2018 · 46 comments
Closed

Reset password throws error since 2.2.6 #18256

edwinbos opened this issue Sep 26, 2018 · 46 comments

Comments

@edwinbos
Copy link

@edwinbos edwinbos commented Sep 26, 2018

Preconditions

Magento 2.2.6 (clean installation)

Steps to reproduce

  1. Clicked on "Reset password" on the login page
  2. Entered e-mailadres and submitted form
  3. Clicked on link in the password reset mail
  4. Entered password two times and submit form by clicking "reset password"

Expected result

  1. Password is changed and the user can login with the new password

Actual result

  1. Error occurred "something went wrong while saving the new password".

schermafbeelding 2018-09-26 om 11 53 58

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Sep 26, 2018

Hi @edwinbos. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@edwinbos do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no
@engcom-backlog-nazar engcom-backlog-nazar self-assigned this Sep 26, 2018
@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Sep 26, 2018

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 26, 2018

Hi @edwinbos I'm not able to reproduce following steps you described. see attachments
46073905-d5209800-c18e-11e8-88d1-25869a3e2bde

@edwinbos

This comment has been minimized.

Copy link
Author

@edwinbos edwinbos commented Sep 26, 2018

You have forgotten step 3 and step 4:
3. Clicked on link in the password reset mail
4. Entered password two times and submit form by clicking "reset password"

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 26, 2018

@edwinbos Can you confirm it on vanilla instance ?
selection_140

@edwinbos

This comment has been minimized.

Copy link
Author

@edwinbos edwinbos commented Sep 26, 2018

I can confirm it's a vanilla Magento 2.2.6 instance.
Also with two real shops (on a test environment) the same problem.

@magento-engcom-team give me 2.2.6 instance

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Sep 26, 2018

Hi @edwinbos. Thank you for your request. I'm working on Magento 2.2.6 instance for you

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Sep 26, 2018

Hi @edwinbos, here is your Magento instance.
Admin access: https://i-18256-2-2-6.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 26, 2018

@edwinbos So can you reproduce this on vanilla instance ?

@julianvdrielen

This comment has been minimized.

Copy link
Contributor

@julianvdrielen julianvdrielen commented Sep 26, 2018

@engcom-backlog-nazar I was able to reproduce this issue on a clean Magento 2.2.6 instance.
image

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 26, 2018

@edwinbos But why i'm able to reset password on this instance ?
selection_142

@edwinbos

This comment has been minimized.

Copy link
Author

@edwinbos edwinbos commented Sep 26, 2018

Found it. It doesn't work on PHP7.0.30 on my local instance, but it's working on PHP7.1.
Which version of PHP is this instance using?

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 26, 2018

@edwinbos Supported version 7.1 7.0 only for 2.1-*

@edwinbos

This comment has been minimized.

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 26, 2018

@edwinbos I'm tested with php 7.0 and have no issue passwords reset correctly, maybe some problem in you environment ?

@hostep

This comment has been minimized.

Copy link
Contributor

@hostep hostep commented Sep 26, 2018

Can reproduce on a clean Magento 2.2.6 installed using composer.
Error happens both in PHP 7.0.32 as 7.1.22, I don't think the PHP version matters here.

The exception message which happens is: Warning: SessionHandler::destroy(): Session is not active in vendor/magento/framework/Session/SaveHandler.php on line 116

Stacktrace:

Magento\Customer\Controller\Account\ResetPasswordPost\Interceptor->execute (vendor/magento/module-customer/Controller/Account/ResetPasswordPost.php:103)
Magento\Customer\Controller\Account\ResetPasswordPost\Interceptor->execute (generated/code/Magento/Customer/Controller/Account/ResetPasswordPost/Interceptor.php:24)
Magento\Customer\Controller\Account\ResetPasswordPost\Interceptor->dispatch (vendor/magento/framework/App/Action/Action.php:107)
Magento\Customer\Controller\Account\ResetPasswordPost\Interceptor->___callParent (vendor/magento/framework/Interception/Interceptor.php:58)
Magento\Customer\Controller\Account\ResetPasswordPost\Interceptor->Magento\Framework\Interception\{closure} (vendor/magento/framework/Interception/Interceptor.php:138)
Magento\Customer\Controller\Account\ResetPasswordPost\Interceptor->___callPlugins (vendor/magento/framework/Interception/Interceptor.php:153)
Magento\Customer\Controller\Account\ResetPasswordPost\Interceptor->dispatch (generated/code/Magento/Customer/Controller/Account/ResetPasswordPost/Interceptor.php:39)
Magento\Framework\App\FrontController\Interceptor->dispatch (vendor/magento/framework/App/FrontController.php:55)
Magento\Framework\App\FrontController\Interceptor->___callParent (vendor/magento/framework/Interception/Interceptor.php:58)
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure} (vendor/magento/framework/Interception/Interceptor.php:138)
Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch (vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:94)
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure} (vendor/magento/framework/Interception/Interceptor.php:135)
Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch (vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:73)
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure} (vendor/magento/framework/Interception/Interceptor.php:135)
Magento\Framework\App\FrontController\Interceptor->___callPlugins (vendor/magento/framework/Interception/Interceptor.php:153)
Magento\Framework\App\FrontController\Interceptor->dispatch (generated/code/Magento/Framework/App/FrontController/Interceptor.php:26)
Magento\Framework\App\Http\Interceptor->launch (vendor/magento/framework/App/Http.php:135)
Magento\Framework\App\Http\Interceptor->launch (generated/code/Magento/Framework/App/Http/Interceptor.php:24)
Magento\Framework\App\Bootstrap->run (vendor/magento/framework/App/Bootstrap.php:257)
{main} (pub/index.php:37)

Exact steps to reproduce:

  1. Setup clean Magento 2.2.6 installation
  2. Create a new account in the frontend
  3. Logout
  4. Go to the password reset page
  5. Enter your email address and the captcha
  6. Click on the link you've received
  7. Enter a new password in the two fields
  8. Getting error Something went wrong while saving the new password.
@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 27, 2018

Hi @hostep Thank you for your explanation now i'm able to reproduce on composer version, but on 2.2-dev this works perfectly.

@hostep

This comment has been minimized.

Copy link
Contributor

@hostep hostep commented Sep 27, 2018

@engcom-backlog-nazar: ok, great!
Please in the future, always try to test with composer based installs, it's how the real world uses Magento, we don't clone from a git repo (well most of us, some actually do it like that).

I really hope this won't turn out to be caused by one of the CBE's again, because otherwise this is getting quite ridiculous...

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 27, 2018

@hostep, Ok thanks that be my mistake to not use composer version.

@salikahmed

This comment has been minimized.

Copy link

@salikahmed salikahmed commented Sep 27, 2018

@engcom-backlog-nazar I have the same issue found on composer version cloud instance 2.2.6, I have submitted the internal ticket with the issue I found the issue missing customer id lines of code in the Controller "ResetPasswordPost.php" which may cause the issue, I fixed the temp solution override the core .

@engcom-backlog-nazar

This comment has been minimized.

Copy link
Contributor

@engcom-backlog-nazar engcom-backlog-nazar commented Sep 27, 2018

@hostep I'm disabled Amazon module, and have success result.

@hostep

This comment has been minimized.

Copy link
Contributor

@hostep hostep commented Sep 27, 2018

@engcom-backlog-nazar: I cannot confirm this, disabling all Amazon modules still triggers the problem over here.
As a next test, I've disabled all CBE's: Amazon_Core, Klarna_Core, Amazon_Login, Amazon_Payment, Klarna_Ordermanagement, Klarna_Kp, Dotdigitalgroup_Email, Temando_Shipping, Vertex_Tax.
But still the error can be reproduced, so it looks like the CBE's have nothing to do with this for once.

@salikahmed: can you share your solution? Or maybe even better, create a pull request with the fix if you believe it is correct? Thanks!

@hostep

This comment has been minimized.

Copy link
Contributor

@hostep hostep commented Sep 27, 2018

Some extra useful information from @webspeaks from #18297:

This issue seems to occur only for new users who register after upgrading to 2.2.6.

(not verified if this is true)

@webspeaks

This comment has been minimized.

Copy link

@webspeaks webspeaks commented Sep 27, 2018

A temporary fix is to modify the vendor\magento\module-customer\Model\AccountManagement.php.
Go to function resetPassword() and
Replace following lines (around line # 673):

        $this->sessionManager->destroy();
        $this->destroyCustomerSessions($customer->getId());

with following lines

        try {
            $this->sessionManager->destroy();
            $this->destroyCustomerSessions($customer->getId());
        } catch (\Exception $e) {}

Note: We have modified core file which is not recommended. But its a temporary fix and not a permanent solution.

@paco44

This comment has been minimized.

Copy link

@paco44 paco44 commented Oct 26, 2018

#Mm18mx

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Oct 26, 2018

@paco44 thank you for joining. Please accept team invitation here and self-assign the issue.

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Oct 26, 2018

Hi @paco44. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@paco44

This comment has been minimized.

Copy link

@paco44 paco44 commented Oct 26, 2018

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Oct 26, 2018

Hi @paco44. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Oct 26, 2018

Hi @paco44, here is your Magento instance.
Admin access: http://ec2-34-228-235-121.compute-1.amazonaws.com/i-18256-2-3-develop//admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@paco44 paco44 removed their assignment Oct 26, 2018
@nahidacm

This comment has been minimized.

Copy link
Member

@nahidacm nahidacm commented Oct 31, 2018

Updating PHP version from 7.0 to 7.1 fixed the issue for me.

@p-bystritsky p-bystritsky self-assigned this Nov 2, 2018
@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

@magento-engcom-team magento-engcom-team commented Nov 2, 2018

Hi @p-bystritsky. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@sidolov

This comment has been minimized.

Copy link
Contributor

@sidolov sidolov commented Nov 6, 2018

Hi @edwinbos. Thank you for your report.
The issue has been fixed in #19026 by @p-bystritsky in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@sidolov sidolov closed this Nov 6, 2018
@nuwaus

This comment has been minimized.

Copy link

@nuwaus nuwaus commented Nov 7, 2018

How can we override this class without modifying the core class?
I tried to override with di.xml but then I get an error while sending the reset email.

@tonycr7

This comment has been minimized.

Copy link

@tonycr7 tonycr7 commented Nov 16, 2018

Hi @nuwaus,

I tried overriding the 'AccountManagement' Class and its working fine. Please make sure the private functions which are using 'resetPassword' function are also included in the extended class. In addtion to this if you are overriding the whole file then please make sure all class has namespace because in core 'AccountManagement' class excluded some class namespace which are in the same directory.

@nuwaus

This comment has been minimized.

Copy link

@nuwaus nuwaus commented Nov 16, 2018

@tonycr7

So far I managed to fix it by removing the module-customer module from composer and adding a clone of it with changes again via composer, eg: module-customer-temp

That way I managed to get it working, but I'll try as you mentioned and write the outcome here, soon..

@peterjaap

This comment has been minimized.

Copy link
Contributor

@peterjaap peterjaap commented Nov 29, 2018

@nuwaus @tonycr7 the recommended way is to make a composer patch file to use with for example https://github.com/cweagans/composer-patches

@josefbehr

This comment has been minimized.

Copy link
Contributor

@josefbehr josefbehr commented Dec 11, 2018

Seems to also be fixed in 2.2-develop already, but not in 2.2.7

@jhart-efaktory

This comment has been minimized.

Copy link
Member

@jhart-efaktory jhart-efaktory commented Jan 3, 2019

Seems to also be fixed in 2.2-develop already, but not in 2.2.7

Yes I can see this has been fixed in the 2.2-develop branch on 05/11/2018 ( 7443dc3 )but it wasn't included in 2.2.7. @magento-engcom-team will this fix be included in 2.2.8 ?

Thank you !

@DanielRuf

This comment has been minimized.

Copy link
Member

@DanielRuf DanielRuf commented Jan 3, 2019

included in 2.2.7. @magento-engcom-team will this fix be included in 2.2.8 ?

Yes as not all commits made it into the planned release (the bot who gives the info about the version is still not very accurate / correct).

@maartenwolfsen

This comment has been minimized.

Copy link

@maartenwolfsen maartenwolfsen commented Apr 15, 2019

@peterjaap @nuwaus @tonycr7 I created a patch for the fix: https://gist.githubusercontent.com/maartenatmarissen/b8e41e15f8a0597cf510a84be56b65c5/raw/cdf2be8cfcdf6b08c884d7b751b1c21e5a7078d7/AccountManagement.php.patch

Can be applied using https://github.com/cweagans/composer-patches :
"magento/module-customer": {
"18256": "https://gist.githubusercontent.com/maartenwolfsen/b8e41e15f8a0597cf510a84be56b65c5/raw/cdf2be8cfcdf6b08c884d7b751b1c21e5a7078d7/AccountManagement.php.patch"
}

@lewisje

This comment has been minimized.

Copy link

@lewisje lewisje commented Dec 10, 2019

Apparently you changed your username, so the gist is now at https://gist.githubusercontent.com/maartenwolfsen/b8e41e15f8a0597cf510a84be56b65c5/raw/cdf2be8cfcdf6b08c884d7b751b1c21e5a7078d7/AccountManagement.php.patch with more information at https://gist.github.com/maartenwolfsen/b8e41e15f8a0597cf510a84be56b65c5/ and composer-patch code

"magento/module-customer": {
    "18256": "https://gist.githubusercontent.com/maartenwolfsen/b8e41e15f8a0597cf510a84be56b65c5/raw/cdf2be8cfcdf6b08c884d7b751b1c21e5a7078d7/AccountManagement.php.patch"
}
@peterjaap

This comment has been minimized.

Copy link
Contributor

@peterjaap peterjaap commented Dec 10, 2019

@lewisje might be better to use https://github.com/magento/magento2/commit/bc8d3d5d0ead9779cb22d19201cd731719a79b0c.patch (use patch level 5 when using https://github.com/vaimo/composer-patches);

{
  "patches": {
    "magento/module-customer": {
      "Reset password throws error since 2.2.6.": {
        "link": "https://github.com/magento/magento2/issues/18256",
        "source": "https://github.com/magento/magento2/commit/bc8d3d5d0ead9779cb22d19201cd731719a79b0c.patch",
        "level": 5,
        "depends": {
          "magento/product-community-edition": ">=2.2.6 <2.3.1"
        }
      }
    }
  }
}
@maartenwolfsen

This comment has been minimized.

Copy link

@maartenwolfsen maartenwolfsen commented Dec 11, 2019

Apparently you changed your username, so the gist is now at https://gist.githubusercontent.com/maartenwolfsen/b8e41e15f8a0597cf510a84be56b65c5/raw/cdf2be8cfcdf6b08c884d7b751b1c21e5a7078d7/AccountManagement.php.patch with more information at https://gist.github.com/maartenwolfsen/b8e41e15f8a0597cf510a84be56b65c5/ and composer-patch code

"magento/module-customer": {
    "18256": "https://gist.githubusercontent.com/maartenwolfsen/b8e41e15f8a0597cf510a84be56b65c5/raw/cdf2be8cfcdf6b08c884d7b751b1c21e5a7078d7/AccountManagement.php.patch"
}

Thank you for noticing, I´ve also changes the link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.