Magento 2 Upgrade – Fix Composer Error from 2.1.6 to 2.1.7

composermagento2upgrade

I am trying to upgrade from Magento 2.1.6 to 2.1.7 using this https://stackoverflow.com/documentation/magento2/9022/upgrading-magento#t=201704130958117574309 as my guide.

I type in- composer require magento/product-community-edition 2.1.7 --no-update

Then the next step when I run composer update I get this error-

Your requirements could not be resolved to an installable set of packages.

Problem 1
– The requested package magento/project-community-edition 2.1.6 is satisfiable by magento/project-community-edition[2.1.6] but these conflict with your requirements or minimum-stability.

What is causing this error?

Edit:

{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.1.6",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"require": {
    "magento/product-community-edition": "2.1.7",
    "composer/composer": "@alpha",
    "magento/data-migration-tool": "2.1.6",
    "magento/project-community-edition": "2.1.7"
},
"require-dev": {
    "phpunit/phpunit": "4.1.0",
    "squizlabs/php_codesniffer": "1.5.3",
    "phpmd/phpmd": "@stable",
    "pdepend/pdepend": "2.2.2",
    "fabpot/php-cs-fixer": "~1.2",
    "lusitanian/oauth": "~0.3 <=0.7.0",
    "sebastian/phpcpd": "2.0.0"
},
"config": {
    "use-include-path": true
},
"autoload": {
    "psr-4": {
        "Magento\\Framework\\": "lib/internal/Magento/Framework/",
        "Magento\\Setup\\": "setup/src/Magento/Setup/",
        "Magento\\": "app/code/Magento/"
    },
    "psr-0": {
        "": "app/code/"
    },
    "files": [
        "app/etc/NonComposerComponentRegistration.php"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
        "Magento\\Tools\\": "dev/tools/Magento/Tools/",
        "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
        "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
        "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
    }
},
"minimum-stability": "alpha",
"prefer-stable": true,
"repositories": {
    "0": {
        "type": "composer",
        "url": "https://repo.magento.com/"
    },
    "magento": {
        "type": "composer",
        "url": "https://repo.magento.com"
    }

},
"extra": {
    "magento-force": "override"
}
}

@RamaChandran I followed the link you mentioned and tried this

"repositories": [
    {
        "type": "composer",
        "url": "http://packages.magento.com/"
    }
]  

When I do that I get this error

[Composer\Downloader\TransportException]
Your configuration does not allow connections to http://packages.magento.com/packages.json. See https://getcomposer.org/doc/06-config.md#secure-http for details.

I switched the url to https and now get this error-

[Composer\Downloader\TransportException]
The "https://packages.magento.com/packages.json" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Name or service not known
failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

Best Answer

Your require section is conflicting with your current package name (and is being a bit recursive).

First, let's peg your composer project version to the next version number:

"version": "2.1.7",

Then update your require section:

"require": {
    "magento/product-community-edition": "2.1.7",
    "composer/composer": "<=1.0.0-beta1",
    "magento/data-migration-tool": "2.1.7",
},

You don't need to require magento/project-community-edition - that's the name of the project you're attempting to update. See: "name": "magento/project-community-edition". You're also loading an out-of-date magento/data-migration-tool but I'd guess you've already done the migration. You may be able to remove this entry as well. Finally, the core Magento repos suggest the <=1.0.0-beta1 version for composer/composer so we should probably stick to that.

Under your "repositories" the second

"magento": {
    "type": "composer",
    "url": "https://repo.magento.com"
}

is extraneous and can be removed.

Related Topic