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

Unable to Install Magento 2.1:: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface #5908

Closed
matrixbegins opened this Issue Jul 30, 2016 · 26 comments

Comments

@matrixbegins

matrixbegins commented Jul 30, 2016

Using composer created project. When tried to access the browser I got following error:

Fatal error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface 
in /var/www/2mage/mage-21/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

Here are system level details:

Mac OSX 10.10.5.
> php -v
PHP 5.6.22 (cli)
> bin/magento 
Magento CLI version 2.1.0

Steps to reproduce

Created project as:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.1.0 

After that cerated vhost and pointed browser and got this error:
Please see the screenshot attached.
screen shot 2016-07-30 at 7 14 50 pm

There is also a strange thing that I noticed the CLI option are also less.

Available commands:
 help                                      Displays help for a command
 list                                      Lists commands
admin
 admin:user:create                         Creates an administrator
i18n
 i18n:collect-phrases                      Discovers phrases in the codebase
 i18n:pack                                 Saves language package
info
 info:adminuri                             Displays the Magento Admin URI
 info:backups:list                         Prints list of available backup files
 info:currency:list                        Displays the list of available currencies
 info:dependencies:show-framework          Shows number of dependencies on Magento framework
 info:dependencies:show-modules            Shows number of dependencies between modules
 info:dependencies:show-modules-circular   Shows number of circular dependencies between modules
 info:language:list                        Displays the list of available language locales
 info:timezone:list                        Displays the list of available timezones
maintenance
 maintenance:allow-ips                     Sets maintenance mode exempt IPs
 maintenance:disable                       Disables maintenance mode
 maintenance:enable                        Enables maintenance mode
 maintenance:status                        Displays maintenance mode status
module
 module:disable                            Disables specified modules
 module:enable                             Enables specified modules
 module:status                             Displays status of modules
 module:uninstall                          Uninstalls modules installed by composer
sampledata
 sampledata:deploy                         Deploy sample data modules
 sampledata:remove                         Remove all sample data packages from composer.json
setup
 setup:backup                              Takes backup of Magento Application code base, media and database
 setup:config:set                          Creates or modifies the deployment configuration
 setup:cron:run                            Runs cron job scheduled for setup application
 setup:db-data:upgrade                     Installs and upgrades data in the DB
 setup:db-schema:upgrade                   Installs and upgrades the DB schema
 setup:db:status                           Checks if DB schema or data requires upgrade
 setup:di:compile                          Generates DI configuration and all missing classes that can be auto-generated
 setup:install                             Installs the Magento application
 setup:performance:generate-fixtures       Generates fixtures
 setup:rollback                            Rolls back Magento Application codebase, media and database
 setup:store-config:set                    Installs the store configuration
 setup:uninstall                           Uninstalls the Magento application
 setup:upgrade                             Upgrades the Magento application, DB data, and schema

When I checked the CLI options on my teammates machine(ubuntu 14.04) it has more options and
setup also worked again.
I tried with downloading zip also from https://www.magentocommerce.com/download
But I had same results
Any help whats wrong going on here ?

@andimov

This comment has been minimized.

Show comment
Hide comment
@andimov

andimov Aug 1, 2016

Contributor

@matrixbegins

Thank you for reporting!
Please follow this links to similar issues with solutions:
http://magento.stackexchange.com/questions/125415/magento-2-installation-fatal-error-cannot-instantiate-interface
#831

Contributor

andimov commented Aug 1, 2016

@matrixbegins

Thank you for reporting!
Please follow this links to similar issues with solutions:
http://magento.stackexchange.com/questions/125415/magento-2-installation-fatal-error-cannot-instantiate-interface
#831

@matrixbegins

This comment has been minimized.

Show comment
Hide comment
@matrixbegins

matrixbegins Aug 1, 2016

@andimov I am afraid I saw it and deleting the whole code and doing again lead to the same results.
Setting to developer mode deploy:mode:set is not an option, as I don't have that command. That's why I have also posted the output of bin/magento

matrixbegins commented Aug 1, 2016

@andimov I am afraid I saw it and deleting the whole code and doing again lead to the same results.
Setting to developer mode deploy:mode:set is not an option, as I don't have that command. That's why I have also posted the output of bin/magento

@matrixbegins

This comment has been minimized.

Show comment
Hide comment
@matrixbegins

matrixbegins Aug 2, 2016

I think I have found my mistake. I was trying to run setup via www.vhost.com however when I tried with www.vhost.com/setup it worked. So my problem is solved. But probably bug remains.
If magento is not installed it should take user to /setup automatically

matrixbegins commented Aug 2, 2016

I think I have found my mistake. I was trying to run setup via www.vhost.com however when I tried with www.vhost.com/setup it worked. So my problem is solved. But probably bug remains.
If magento is not installed it should take user to /setup automatically

@andimov

This comment has been minimized.

Show comment
Hide comment
@andimov

andimov Aug 2, 2016

Contributor

@matrixbegins
What web server do you use?

Contributor

andimov commented Aug 2, 2016

@matrixbegins
What web server do you use?

@matrixbegins

This comment has been minimized.

Show comment
Hide comment
@matrixbegins

matrixbegins Aug 2, 2016

@andimov I am using NGINX v1.10.1

matrixbegins commented Aug 2, 2016

@andimov I am using NGINX v1.10.1

@andimov

This comment has been minimized.

Show comment
Hide comment
@andimov

andimov Aug 2, 2016

Contributor

@matrixbegins
Do you use Magento nginx.conf.sample?

Contributor

andimov commented Aug 2, 2016

@matrixbegins
Do you use Magento nginx.conf.sample?

@matrixbegins

This comment has been minimized.

Show comment
Hide comment
@matrixbegins

matrixbegins Aug 2, 2016

Here is my vhost.conf

upstream fastcgi_backend {
    server   unix:/var/run/php-fpm.sock;
 }

server {
    listen 80;
    server_name 24mage.local.com;
    set $MAGE_ROOT /var/www/2mage/mage-21/project-community-edition;
    set $MAGE_MODE developer;

        root $MAGE_ROOT/pub;

        index index.php;
        autoindex off;
        charset off;

        add_header 'X-Content-Type-Options' 'nosniff';
        add_header 'X-XSS-Protection' '1; mode=block';


        location /setup {
            root $MAGE_ROOT;
            location ~ ^/setup/index.php {
                fastcgi_pass   fastcgi_backend;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
            }

            location ~ ^/setup/(?!pub/). {
                deny all;
            }

            location ~ ^/setup/pub/ {
                add_header X-Frame-Options "SAMEORIGIN";
            }
        }

    location /update {
        root $MAGE_ROOT;

        location ~ ^/update/index.php {
            fastcgi_split_path_info ^(/update/index.php)(/.+)$;
            fastcgi_pass   fastcgi_backend;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO        $fastcgi_path_info;
            include        fastcgi_params;
        }

        # deny everything but index.php
        location ~ ^/update/(?!pub/). {
            deny all;
        }

        location ~ ^/update/pub/ {
            add_header X-Frame-Options "SAMEORIGIN";
        }
    }

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location /pub {
        location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
            deny all;
        }
        alias $MAGE_ROOT/pub;
        add_header X-Frame-Options "SAMEORIGIN";
    }

location /static/ {
        if ($MAGE_MODE = "production") {
            expires max;
        }
        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;

            if (!-f $request_filename) {
                rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
            }
        }
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;

            if (!-f $request_filename) {
               rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
            }
        }
        if (!-f $request_filename) {
            rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
        }
        add_header X-Frame-Options "SAMEORIGIN";
    }

    location /media/ {
        try_files $uri $uri/ /get.php?$args;

        location ~ ^/media/theme_customization/.*\.xml {
            deny all;
        }

        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;
            try_files $uri $uri/ /get.php?$args;
        }
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;
            try_files $uri $uri/ /get.php?$args;
        }
        add_header X-Frame-Options "SAMEORIGIN";
    }

    location /media/customer/ {
        deny all;
    }

    location /media/downloadable/ {
        deny all;
    }

    location /media/import/ {
        deny all;
    }

    location ~ cron\.php {
        deny all;
    }

    location ~ (index|get|static|report|404|503)\.php$ {
        try_files $uri =404;
        fastcgi_pass   fastcgi_backend;

        fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
        fastcgi_param  PHP_VALUE "memory_limit=512M \n max_execution_time=600";
        fastcgi_read_timeout 600s;
        fastcgi_connect_timeout 600s;
        fastcgi_param  MAGE_MODE $MAGE_MODE;

        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }



 }

matrixbegins commented Aug 2, 2016

Here is my vhost.conf

upstream fastcgi_backend {
    server   unix:/var/run/php-fpm.sock;
 }

server {
    listen 80;
    server_name 24mage.local.com;
    set $MAGE_ROOT /var/www/2mage/mage-21/project-community-edition;
    set $MAGE_MODE developer;

        root $MAGE_ROOT/pub;

        index index.php;
        autoindex off;
        charset off;

        add_header 'X-Content-Type-Options' 'nosniff';
        add_header 'X-XSS-Protection' '1; mode=block';


        location /setup {
            root $MAGE_ROOT;
            location ~ ^/setup/index.php {
                fastcgi_pass   fastcgi_backend;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
            }

            location ~ ^/setup/(?!pub/). {
                deny all;
            }

            location ~ ^/setup/pub/ {
                add_header X-Frame-Options "SAMEORIGIN";
            }
        }

    location /update {
        root $MAGE_ROOT;

        location ~ ^/update/index.php {
            fastcgi_split_path_info ^(/update/index.php)(/.+)$;
            fastcgi_pass   fastcgi_backend;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO        $fastcgi_path_info;
            include        fastcgi_params;
        }

        # deny everything but index.php
        location ~ ^/update/(?!pub/). {
            deny all;
        }

        location ~ ^/update/pub/ {
            add_header X-Frame-Options "SAMEORIGIN";
        }
    }

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location /pub {
        location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
            deny all;
        }
        alias $MAGE_ROOT/pub;
        add_header X-Frame-Options "SAMEORIGIN";
    }

location /static/ {
        if ($MAGE_MODE = "production") {
            expires max;
        }
        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;

            if (!-f $request_filename) {
                rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
            }
        }
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;

            if (!-f $request_filename) {
               rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
            }
        }
        if (!-f $request_filename) {
            rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
        }
        add_header X-Frame-Options "SAMEORIGIN";
    }

    location /media/ {
        try_files $uri $uri/ /get.php?$args;

        location ~ ^/media/theme_customization/.*\.xml {
            deny all;
        }

        location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
            add_header Cache-Control "public";
            add_header X-Frame-Options "SAMEORIGIN";
            expires +1y;
            try_files $uri $uri/ /get.php?$args;
        }
        location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
            add_header Cache-Control "no-store";
            add_header X-Frame-Options "SAMEORIGIN";
            expires    off;
            try_files $uri $uri/ /get.php?$args;
        }
        add_header X-Frame-Options "SAMEORIGIN";
    }

    location /media/customer/ {
        deny all;
    }

    location /media/downloadable/ {
        deny all;
    }

    location /media/import/ {
        deny all;
    }

    location ~ cron\.php {
        deny all;
    }

    location ~ (index|get|static|report|404|503)\.php$ {
        try_files $uri =404;
        fastcgi_pass   fastcgi_backend;

        fastcgi_param  PHP_FLAG  "session.auto_start=off \n suhosin.session.cryptua=off";
        fastcgi_param  PHP_VALUE "memory_limit=512M \n max_execution_time=600";
        fastcgi_read_timeout 600s;
        fastcgi_connect_timeout 600s;
        fastcgi_param  MAGE_MODE $MAGE_MODE;

        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }



 }

@deepanshu27193

This comment has been minimized.

Show comment
Hide comment
@deepanshu27193

deepanshu27193 Aug 8, 2016

Experienced Same problem with default root.
But if i try /setup, it ran successfully.

and also i need to comment the line cgi.fix_pathinfo=0,
in my php-fpm php.ini file.

deepanshu27193 commented Aug 8, 2016

Experienced Same problem with default root.
But if i try /setup, it ran successfully.

and also i need to comment the line cgi.fix_pathinfo=0,
in my php-fpm php.ini file.

@andimov andimov self-assigned this Aug 8, 2016

@ihor-sviziev

This comment has been minimized.

Show comment
Hide comment
@ihor-sviziev

ihor-sviziev Aug 13, 2016

Contributor

I had the same issue when I tried to install magento through https protocol. When i switched to http and document root from /magneto2/pub/ to /magento2/ - setup started works!
Env: Apache 2.4 + mod php 5.6
Magento 2.1 installed via composer

Contributor

ihor-sviziev commented Aug 13, 2016

I had the same issue when I tried to install magento through https protocol. When i switched to http and document root from /magneto2/pub/ to /magento2/ - setup started works!
Env: Apache 2.4 + mod php 5.6
Magento 2.1 installed via composer

@ReactionCode

This comment has been minimized.

Show comment
Hide comment
@ReactionCode

ReactionCode Aug 22, 2016

Here with the same issue on VM Homestead 5.0.

Php 7.0.8
Nginx 1.11.1

I only sucessfully installed magento with php bin/magento setup:install

What is the reason for?

Fatal error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface 
in /home/vagrant/www/magento-ce/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

ReactionCode commented Aug 22, 2016

Here with the same issue on VM Homestead 5.0.

Php 7.0.8
Nginx 1.11.1

I only sucessfully installed magento with php bin/magento setup:install

What is the reason for?

Fatal error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface 
in /home/vagrant/www/magento-ce/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73
@d-pelikhov

This comment has been minimized.

Show comment
Hide comment
@d-pelikhov

d-pelikhov Aug 22, 2016

What is the reason for?

Fatal error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface
in /home/vagrant/www/magento-ce/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

+1

d-pelikhov commented Aug 22, 2016

What is the reason for?

Fatal error: Cannot instantiate interface Magento\Framework\App\Config\Scope\ReaderPoolInterface
in /home/vagrant/www/magento-ce/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

+1

@d-pelikhov

This comment has been minimized.

Show comment
Hide comment
@d-pelikhov

d-pelikhov Aug 26, 2016

You have invalid di configuration for Magento\Framework\App\Config\ScopePool
2016-08-26 18 35 39

d-pelikhov commented Aug 26, 2016

You have invalid di configuration for Magento\Framework\App\Config\ScopePool
2016-08-26 18 35 39

@ReactionCode

This comment has been minimized.

Show comment
Hide comment
@ReactionCode

ReactionCode Aug 26, 2016

You have invalid di configuration for Magento\Framework\App\Config\ScopePool

I don't understand, "di configuration" Could you explain more clearly?

ReactionCode commented Aug 26, 2016

You have invalid di configuration for Magento\Framework\App\Config\ScopePool

I don't understand, "di configuration" Could you explain more clearly?

@andimov andimov removed their assignment Sep 2, 2016

@BaDos

This comment has been minimized.

Show comment
Hide comment
@BaDos

BaDos Nov 8, 2016

Contributor

Hi, guys!
Thank you for your feedbacks.

We have the internal ticket MAGETWO-46636 with the same issue.

Contributor

BaDos commented Nov 8, 2016

Hi, guys!
Thank you for your feedbacks.

We have the internal ticket MAGETWO-46636 with the same issue.

@BaDos BaDos added the acknowledged label Nov 8, 2016

@goivvy

This comment has been minimized.

Show comment
Hide comment
@goivvy

goivvy Jan 26, 2017

I changed root $MAGE_ROOT/pub to root $MAGE_ROOT in nginx configuration file and setup works fine now.

once it is installed I changed it back.

goivvy commented Jan 26, 2017

I changed root $MAGE_ROOT/pub to root $MAGE_ROOT in nginx configuration file and setup works fine now.

once it is installed I changed it back.

@philippsander

This comment has been minimized.

Show comment
Hide comment
@philippsander

philippsander Feb 20, 2017

Contributor

I'm still facing this problem.

Contributor

philippsander commented Feb 20, 2017

I'm still facing this problem.

@ihor-sviziev

This comment has been minimized.

Show comment
Hide comment
@ihor-sviziev

ihor-sviziev Apr 13, 2017

Contributor

+1 Magento 2.1.6

Contributor

ihor-sviziev commented Apr 13, 2017

+1 Magento 2.1.6

@philippsander

This comment has been minimized.

Show comment
Hide comment
@philippsander

philippsander Apr 13, 2017

Contributor

I had a problem in my DI. so it was my fault.

Contributor

philippsander commented Apr 13, 2017

I had a problem in my DI. so it was my fault.

@toweringmedia

This comment has been minimized.

Show comment
Hide comment
@toweringmedia

toweringmedia May 9, 2017

in my case I had the same problem, I was using the /~username for the account as a dev site. After pointing a dummy domain to the account and used that instead it worked.

toweringmedia commented May 9, 2017

in my case I had the same problem, I was using the /~username for the account as a dev site. After pointing a dummy domain to the account and used that instead it worked.

@magicaner

This comment has been minimized.

Show comment
Hide comment
@magicaner

magicaner May 15, 2017

i have same problem. can any one explain why i do not have commad like "deploy:mode:set" at my setup?

magicaner commented May 15, 2017

i have same problem. can any one explain why i do not have commad like "deploy:mode:set" at my setup?

@mariopacio

This comment has been minimized.

Show comment
Hide comment
@mariopacio

mariopacio May 18, 2017

same problem here

mariopacio commented May 18, 2017

same problem here

@kaurg2516

This comment has been minimized.

Show comment
Hide comment
@kaurg2516

kaurg2516 May 20, 2017

i am having the same issue with checkjout page. Kindly visit the url to know what exactly my issue is
#9710

kaurg2516 commented May 20, 2017

i am having the same issue with checkjout page. Kindly visit the url to know what exactly my issue is
#9710

@mengbo123456

This comment has been minimized.

Show comment
Hide comment
@mengbo123456

mengbo123456 commented Jul 3, 2017

image

@kaurg2516

This comment has been minimized.

Show comment
Hide comment
@kaurg2516

kaurg2516 Jul 3, 2017

if you are getting error related to payment token interface try this.

  1. Go to /vendor/magento/module-vault/etc/di.xml from your magento root directory.
  2. Paste This code: <preference for="Magento\Vault\Api\Data\PaymentTokenInterfaceFactory" type="Magento\Vault\Model\AccountPaymentTokenFactory"/> in line between 10-17.

kaurg2516 commented Jul 3, 2017

if you are getting error related to payment token interface try this.

  1. Go to /vendor/magento/module-vault/etc/di.xml from your magento root directory.
  2. Paste This code: <preference for="Magento\Vault\Api\Data\PaymentTokenInterfaceFactory" type="Magento\Vault\Model\AccountPaymentTokenFactory"/> in line between 10-17.
@philippsander

This comment has been minimized.

Show comment
Hide comment
@philippsander

philippsander Jul 3, 2017

Contributor

@kaurg2516 Don't modify the files in your vendor directory.

Contributor

philippsander commented Jul 3, 2017

@kaurg2516 Don't modify the files in your vendor directory.

@magento-engcom-team

This comment has been minimized.

Show comment
Hide comment
@magento-engcom-team

magento-engcom-team Sep 20, 2017

Contributor

@matrixbegins, thank you for your report.
The issue is already fixed in 2.2.0

Contributor

magento-engcom-team commented Sep 20, 2017

@matrixbegins, thank you for your report.
The issue is already fixed in 2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment