Hello, Magento Buddies!
As against Magento 1, Magento 2 is more robust and comes with a splendid layout and design and an orderly user interface. Despite that, admins face many difficulties in the backend.
Nevertheless, we will be thoroughly diving into the problems confronted by the admin users in the backend administration of Magento 2 and will aim to solve each one of those troubles entirely in this tutorial blog. Also, catch a glimpse of this blog. It will be of much help – How to Fix 404 Error Page Not Found in Admin URL in Magento 2.
So, why are we biding the time? Let’s start!
Contents
- 1 Fixed: Magento 2 Backend Not Working
- 1.1 Problem 1: After Update or Migration to Magento 2
- 1.2 Problem 2: After Installing or Upgrading New Third Party Module
- 1.3 Problem 3: Due to Wrong Admin URL
- 1.4 Problem 4: User reset the permission role of your administrator
- 1.5 Problem 5: New Install on Ubuntu/Centos/Debian
- 1.6 Problem 6: Due to Production Mode
- 1.7 Problem 7: Incorrect Admin URL
- 1.8 Problem 8: This is not Implemented
Fixed: Magento 2 Backend Not Working
Problem 1: After Update or Migration to Magento 2
If the backend gets inoperative after you have updated or you have migrated to the Magento 2 store, then you can apply the following SQL command:
Solution:
1 2 3 4 5 6 7 8 9 10 11 |
SET FOREIGN_KEY_CHECKS=0; UPDATE 'store' SET store_id = 0 WHERE code='admin'; UPDATE 'store_group' SET group_id = 0 WHERE name='Default'; UPDATE 'store_website' SET website_id = 0 WHERE code='admin'; UPDATE 'customer_group' SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN'; SET FOREIGN_KEY_CHECKS=1; |
Problem 2: After Installing or Upgrading New Third Party Module
You might encounter an error message after installing an extension or upgrading to a new third-party module. In that case, the solution is to flush the Magento 2 cache using the terminal. Include the below-given code:
Solution:
1 2 3 4 5 6 7 |
php bin/magento cache:clean php bin/magento cache:flush rm -rf var/cache/* rm -rf var/generation/* |
OR
1 |
rm -rf generated/* (For Magento 2.1.8 After) |
Problem 3: Due to Wrong Admin URL
It can be a case that you have been stressing to arrive at the backend with an incorrect URL. for that you can get the correct Admin URL with the help of the below command:
Solution:
1 |
php bin/magento info:adminuri |
Problem 4: User reset the permission role of your administrator
Perform the below steps to solve this problem:
Solution:
Step 1: Go to the Admin Panel -> Systems -> Permission -> User Roles
Step 2: Select the role name that needs to be edited, e.g. ‘Administrators’
Step 3: Switch to the ‘Role Resources’ menu
Step 4: Set the ‘Resource Access’ to ‘All’;
Step 5: Save the role and clear Magento 2 cache after the settings are completed.
Problem 5: New Install on Ubuntu/Centos/Debian
Sometimes, when you install Ubuntu/Centos/Debian then you might get an error message showing “Not Found”.
Solution:
For Ubuntu Users, modify the file /etc/apache2/apache2.conf
In order to edit this file, run the below-given command:
1 |
sudo vi /etc/apache2/apache2.conf |
Modify from:
1 2 3 4 5 6 7 8 9 |
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> |
To:
1 2 3 4 5 6 7 8 9 |
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> |
After changing the above code, add the below command to restart Apache :
1 |
sudo a2enmod rewrite |
1 |
sudo service apache2 restart |
Problem 6: Due to Production Mode
if Magento 2 production mode so reset the production mode again via the Command line. check below :
Solution:
1 |
php bin/magento deploy:mode:show |
If the currently applied mode is production so run below the command :
1 |
php -dmemory_limit=-1 bin/magento deploy:mode:set production |
Problem 7: Incorrect Admin URL
Error: The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.
if the above error gets then run the below command :
Solution:
1 |
php bin/magento admin:user:unlock user-name |
Otherwise, you can create a new admin user using following command:
1 |
php -dmemory_limit=-1 bin/magento admin:user:create --admin-user="admin" --admin-password="admin@123" --admin-email="test@gmail.com" --admin-firstname="admin" --admin-lastname="tester" |
Problem 8: This is not Implemented
Issue: This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP (create a user in terminal)
This error occurs with Magento 2.4.2 when PHP does not include the sodium PHP extension You can check if this extension is installed with the below command :
Solution:
1 |
php -i | grep sodium |
Output :
1 2 3 |
sodium support => enabled libsodium headers version => 1.0.16 |
To fix this problem install/activate the sodium php extension.
For Server in php.ini add (or uncomment)
extension=sodium;
Or
1 |
sudo apt-get install php-libsodium |
NOTE: the supported PHP version for Magento 2.4 is PHP 7.4
Winding Up!
Hence, the above-mentioned were the possible problems of the Magento 2 Backend Not Working. And we have given the solutions to the respective problems. Send this article to your Magento buddies. In case you encounter any problems in applying the codes, reach out to us through the comments below.
Happy Reading!