1

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

  • Did you remove the vendor folder? – brentwpeterson Jul 6 '17 at 16:03
  • I did not remove the vendor folder. Should I? Seems like there is a lot of files in there. – tjjen Jul 6 '17 at 16:55
  • You can rename the vendor folder so you can restore it when something broke. But I don't think that's the issue here. Could you post your composer.json? – ooxi Jul 6 '17 at 18:02
  • please post your composer.json file. for refer this link github.com/magento/magento2-samples/issues/26 – Rama Chandran M Jul 6 '17 at 18:45
  • @ooxi I have added the composer file. I did change "prefer-stable": true, to false just to see if that would work but it didn't. – tjjen Jul 6 '17 at 18:59
2

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.

  • So I did exactly what you said and tried to run composer update. When I did that I got the [Composer\Downloader\TransportException] Your configuration does not allow connections to packages.magento.com/packages.json. See getcomposer.org/doc/06-config.md#secure-http for details. Error again. – tjjen Jul 7 '17 at 16:15
  • 1
    I did a quick google and it seems that the packages.magento.com repo is likely cached in your composer config.json file - which can be in various locations depending on your OS. (Usually in your user folder.) They suggested this command to correct the setting: composer config -g -- repositories.magento composer https?://repo.magento.com – Jeremy Rimpo Jul 7 '17 at 17:09
  • 1
    I found this "packages.magento.com is the old repo.magento.com from Magento 2 beta days. This has been shut down so suggest removing this from your composer.json" -from magento.stackexchange.com/questions/123764/… So with your fixes and removing that it seems to be working. Any idea if I have to do this every time I do a minor Magento upgrade? – tjjen Jul 7 '17 at 17:11
  • Alternatively you'll have to locate your composer config.json file. On Windows this should be under <your_user_directory>\AppData\Roaming\Composer. On most *nix systems this is under /home/<user>/.composer or /home/<user>/.config/composer. On OSX it's /Users/<user>/.composer. Check the contents and either remove the entry or delete the file if there's nothing in it that you need. – Jeremy Rimpo Jul 7 '17 at 17:14
  • 1
    Once it's removed from that config.json file it shouldn't return. I personally have no settings in that file at all and I've never had Magento drop anything else into it. (The auth.json file, on the other hand, probably stores your HTTPS credentials to access repo.magento.com.) – Jeremy Rimpo Jul 7 '17 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.