Magento2: Magento 2.2 upgrade issue

Created on 28 Sep 2017  路  25Comments  路  Source: magento/magento2

issue

Preconditions


Magento 2.2
Php 7.0
Appache 2.4
Ubuntu 16
MySQL 5.7



    1. 2.

Steps to reproduce

  1. composer require magento/product-community-edition 2.2 --no-update
  2. composer update
  3. php bin/magento setup:upgrade

Expected result

  1. complete upgrade

Actual result

  1. Running schema recurring...We can't find the role for the user you wanted.
  2. In exeption.log:

Format is valid needs update

Most helpful comment

Disable the Shopial_Facebook module it is causing your error.
bin/magento module:uninstall Shopial_Facebook

All 25 comments

Well, error message is quite clear. Do you have customer_group table in fact?

Not table customer_group in my database

Well, it should be there, I don't see this table was ever removed in app/code/Magento/Customer/Setup.

Try restoring database from your latest backup, check customer_group table is in place and perform an upgrade one more time.

Thank you but whent i launch tollback db process, i have this error:

SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint, query was: CREATE TABLE IF NOT EXISTS customer_group (
customer_group_id smallint UNSIGNED NOT NULL auto_increment COMMENT 'Customer Group Id' ,
customer_group_code varchar(32) NOT NULL COMMENT 'Customer Group Code' ,
tax_class_id int UNSIGNED NOT NULL default '0' COMMENT 'Tax Class Id' ,
PRIMARY KEY (customer_group_id)
) COMMENT='Customer Group' ENGINE=innodb charset=utf8 COLLATE=utf8_general_ci

error

Not sure what it means. Can you maybe just import an SQL dump of previously working version?

yes but i have the same error with command

sudo cat var/backups/1506547954_db.sql|mysql -u root magentodb -p

Not easy lol

I have perform a fresh install of magento 2.2 and a fresh empty database.

After, all rollback work. I am on my previous version 2.1.9. I stop to try to update to 2.2. I have worrie to lose all.

All is ok. Thank you for your time.

I've got the same issue. I used the web upgrade tool, and as it didn't work, the rollback. Unfortunately, the rollback didn't work, same error.

Could it be related? https://github.com/magento/magento2/issues/9694

The solution that worked for you, @achatpc was to make a fresh install and then rollback the backups? Please explain a bit more.

This error in M2.2 is coming from Magento Social Integration. When trying to update DB the code searches for the (integration) role and ACL but since you haven't setup Magento Social integration this user and role do not exist yet and thus throws an exception (/module-authorization/Model/Acl/AclRetriever.php:88)

So either set it up before using setup:upgrade OR as a workaround you can change:
magento/module-integration/Model/ConfigBasedIntegrationManager.php (processConfigBasedIntegrations method) around line 130

From:
$originalResources = $this->aclRetriever->getAllowedResourcesByUser( UserContextInterface::USER_TYPE_INTEGRATION, $integration->getId() );

To:
$originalResources = []; if ($integration->getStatus()) { $originalResources = $this->aclRetriever->getAllowedResourcesByUser( UserContextInterface::USER_TYPE_INTEGRATION, $integration->getId() ); }

(sorry, idk how to style the code in this editor)

@arielmorry, your proposal seems to solve that specific issue. Thanks.

why is this issue closed ? Changing things on magento core does not resolve this?

Hi @xhallix, as you can see this issue was closed by reporter. Please report a new one with exact steps to reproduce (feel free to take them from this issue) if you experience the same issue.

+1

+2

After edited my code with @arielmorry suggestion.
I still got the message "we can't find the role for the user you wanted"
Magento 2.2.2

I am also getting this error on CENTOS 7.4 when I try to run command

php bin/magento setup:upgrade

I get following message:
cant-find-the-role

I am at Magento 2.2.2 CE. My site is currently hosted at some other host and I am planning it to migrate it to VPS from other host. I copied my current production code to the new host where i am testing the site. When I run upgrade command in my new VPS account, I get this error as shown in attached snapshot. Further, there is no error shown in exception.log . Only debug.log is being updated with some debug information.

I also have the table customer_group in my database. See snapshot below.
image

Whats going wrong here. Any input on this?

Thanks

Disable the Shopial_Facebook module it is causing your error.
bin/magento module:uninstall Shopial_Facebook

Thank you i got same issue and after disable Shopial_Facebook module. its working fine

Thanks disabling Shopial_Facebook module works great for me.

Can confirm this. This should be fixed...

Worked for me as well. Seems trouble at every turn lately with Magento. Not fun.

Same here, disabled Shopial_Facebook and we were able to run the setup:upgrade command. We are running Magento CE 2.2.5.

Same issue here but i solved this by inserting a new record to table 'authorization_role'.
So executed below query to insert record

INSERT INTO.authorization_role(role_id,parent_id,tree_level,sort_order,role_type,user_id,user_type,role_name) VALUES (NULL, '0', '1', '0', 'U', '7', '1', '17');

Here 7 is the ID of integration. Every-time you run setup:upgrade you will find different integration ID.

Was this page helpful?
0 / 5 - 0 ratings