getsentry / sentry-laravel

The official Laravel SDK for Sentry (sentry.io)
https://sentry.io
MIT License
1.25k stars 189 forks source link

Problem installing sentry-laravel (composer conflict) #422

Closed muriloelias closed 3 years ago

muriloelias commented 3 years ago

Hello people,

I did some research before opening this problem and asking for help.

I'm having the following problem in my environment:

user@linux$ composer update --optimize-autoloader --no-dev
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - sentry/sentry-laravel 2.2.0 requires sentry/sdk ^3.0 -> satisfiable by sentry/sdk[3.0.0, 3.0.0-beta1].
    - sentry/sentry-laravel 2.x-dev requires sentry/sdk ^3.0 -> satisfiable by sentry/sdk[3.0.0, 3.0.0-beta1].
    - sentry/sdk 3.0.0 requires sentry/sentry ^3.0 -> satisfiable by sentry/sentry[3.0.0, 3.0.0-beta1, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.x-dev].
    - sentry/sdk 3.0.0-beta1 requires sentry/sentry 3.0.0-beta1 -> satisfiable by sentry/sentry[3.0.0-beta1].
    - sentry/sentry 3.0.0 requires ocramius/package-versions ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.10.99.1, 1.11.99, 1.11.99.1, 1.8.0, 1.8.1, 1.8.2, dev-master, 1.x-dev], ocramius/package-versions[1.10.0, 1.10.1, 1.10.2, 1.10.x-dev,
 1.11.0, 1.11.x-dev, 1.8.0, 1.9.0, 1.9.x-dev].
    - sentry/sentry 3.0.0-beta1 requires ocramius/package-versions ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.10.99.1, 1.11.99, 1.11.99.1, 1.8.0, 1.8.1, 1.8.2, dev-master, 1.x-dev], ocramius/package-versions[1.10.0, 1.10.1, 1.10.2, 1.10.
x-dev, 1.11.0, 1.11.x-dev, 1.8.0, 1.9.0, 1.9.x-dev].
    - sentry/sentry 3.0.1 requires ocramius/package-versions ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.10.99.1, 1.11.99, 1.11.99.1, 1.8.0, 1.8.1, 1.8.2, dev-master, 1.x-dev], ocramius/package-versions[1.10.0, 1.10.1, 1.10.2, 1.10.x-dev,
 1.11.0, 1.11.x-dev, 1.8.0, 1.9.0, 1.9.x-dev].
    - sentry/sentry 3.0.2 requires ocramius/package-versions ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.10.99.1, 1.11.99, 1.11.99.1, 1.8.0, 1.8.1, 1.8.2, dev-master, 1.x-dev], ocramius/package-versions[1.10.0, 1.10.1, 1.10.2, 1.10.x-dev,
 1.11.0, 1.11.x-dev, 1.8.0, 1.9.0, 1.9.x-dev].
    - sentry/sentry 3.0.3 requires ocramius/package-versions ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.10.99.1, 1.11.99, 1.11.99.1, 1.8.0, 1.8.1, 1.8.2, dev-master, 1.x-dev], ocramius/package-versions[1.10.0, 1.10.1, 1.10.2, 1.10.x-dev,
 1.11.0, 1.11.x-dev, 1.8.0, 1.9.0, 1.9.x-dev].
    - sentry/sentry 3.0.4 requires ocramius/package-versions ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.10.99.1, 1.11.99, 1.11.99.1, 1.8.0, 1.8.1, 1.8.2, dev-master, 1.x-dev], ocramius/package-versions[1.10.0, 1.10.1, 1.10.2, 1.10.x-dev,
 1.11.0, 1.11.x-dev, 1.8.0, 1.9.0, 1.9.x-dev].
    - sentry/sentry 3.0.x-dev requires ocramius/package-versions ^1.8 -> satisfiable by composer/package-versions-deprecated[1.10.99, 1.10.99.1, 1.11.99, 1.11.99.1, 1.8.0, 1.8.1, 1.8.2, dev-master, 1.x-dev], ocramius/package-versions[1.10.0, 1.10.1, 1.10.2, 1.10.x-
dev, 1.11.0, 1.11.x-dev, 1.8.0, 1.9.0, 1.9.x-dev].
    - ocramius/package-versions 1.9.x-dev requires php ^7.4.0 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.9.0 requires php ^7.4.0 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.8.0 requires php ^7.4.0 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.11.x-dev requires php ^7.4.7 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.11.0 requires php ^7.4.7 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.10.x-dev requires php ^7.4.7 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.10.2 requires php ^7.4.7 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.10.1 requires php ^7.4.7 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - ocramius/package-versions 1.10.0 requires php ^7.4.7 -> your PHP version (7.2.34-4+ubuntu16.04.1+deb.sury.org+1) overriden by "config.platform.php" version (7.2.30) does not satisfy that requirement.
    - composer/package-versions-deprecated 1.x-dev requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated dev-master requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated 1.8.2 requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated 1.8.1 requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated 1.8.0 requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated 1.11.99.1 requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated 1.11.99 requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated 1.10.99.1 requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - composer/package-versions-deprecated 1.10.99 requires composer-plugin-api ^1.1.0 || ^2.0 -> no matching package found.
    - Installation request for sentry/sentry-laravel ^2.2 -> satisfiable by sentry/sentry-laravel[2.2.0, 2.x-dev].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

My composer file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "doctrine/dbal": "^2.9",
        "fideloper/proxy": "^4.0",
        "htmlmin/htmlmin": "^5.7",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "laravelium/sitemap": "^3.0",
        "sentry/sentry-laravel": "^2.2",
        "sunra/php-simple-html-dom-parser": "^1.5"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.2",
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "platform": {"php": "7.2.30"}
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

My php version:

user@linux$ php -v
PHP 7.2.34-4+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 18 2020 21:18:57) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.34-4+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Has anyone been through this and managed to solve it? Thanks.

stayallive commented 3 years ago

Hi, the issue is not really aptly named because it describes another issue but there is an similar open issue for it with 2 possible solutions that might work for you:

Try those out and see if it that works for you! Unfortunately we're still not sure why this is happening but with a future update this should be solved.

muriloelias commented 3 years ago

Hi, the issue is not really aptly named because it describes another issue but there is an similar open issue for it with 2 possible solutions that might work for you:

Try those out and see if it that works for you! Unfortunately we're still not sure why this is happening but with a future update this should be solved.

Thank you stayallive, but the solution did not work here.

stayallive commented 3 years ago

This does not work for you (I added the sentry/sentry dependency)?

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "doctrine/dbal": "^2.9",
        "fideloper/proxy": "^4.0",
        "htmlmin/htmlmin": "^5.7",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "laravelium/sitemap": "^3.0",
        "sentry/sentry": "^3.0.4",
        "sentry/sentry-laravel": "^2.2",
        "sunra/php-simple-html-dom-parser": "^1.5"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.2",
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true,
        "platform": {"php": "7.2.30"}
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Make sure to run composer update and possibly remove your vendor folder and/or composer.lock file to see if that helps.


Edit: Ah, you should also change "php": "^7.1.3", to "php": "^7.2", since you are running in 7.2 anyway, and the new SDK is only compatible with 7.2 and up and you 7.1 constraint prevents installing the correct version of the SDK!

stayallive commented 3 years ago

This is should have been solved at least starting on version 2.3.0 maybe earlier.

I hope this also is solved for you, if not please re-open so we can investigate further!