flipboxfactory / saml-sp

SAML Service Provider (SP) Plugin for Craft CMS
https://saml-sp.flipboxfactory.com/
Other
19 stars 5 forks source link

Error installing SAML SSO Service Provider version 2.3.1 with craft cms pro version 3.5.5 #77

Closed sidm1983 closed 4 years ago

sidm1983 commented 4 years ago

When I try to install SAML SSO Service Provider plugin version 2.3.1 in my local dev instance of Craft CMS Pro version 3.5.5 (using the built-in plugin store in the admin control panel), I get the following error almost immediately:

Composer was unable to install the updates due to a dependency conflict.

Composer output: Cannot create cache directory /var/www/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.composer/cache/repo/https---composer.craftcms.com/, or directory is not writable. Proceeding without cache
Cannot create cache directory /var/www/.composer/cache/files/, or directory is not writable. Proceeding without cache
Package "craftcms/vue-asset" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- simplesamlphp/saml2 v4.1.7 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.6 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.5 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.4 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.3 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.2 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.1 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.0 requires php >=7.2 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- simplesamlphp/saml2 v4.1.8 requires php >=7.1 -> your PHP version (7.4.9) overridden by "config.platform.php" version (7.0) does not satisfy that requirement.
- flipboxfactory/saml-sp 2.3.1 requires flipboxfactory/saml-core ^3.0.1 -> satisfiable by flipboxfactory/saml-core[3.0.1].
- flipboxfactory/saml-core 3.0.1 requires simplesamlphp/saml2 ^4.1 -> satisfiable by simplesamlphp/saml2[v4.1.8, v4.1.0, v4.1.1, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7].
- Installation request for flipboxfactory/saml-sp 2.3.1 -> satisfiable by flipboxfactory/saml-sp[2.3.1].

Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.

It looks like my version number is getting overridden by the config.platform.php file, but I don't see that file in my project directory. I am using Nitro/Multipass for local development. Is this an issue with Craft CMS or with the plugin not supporting the latest version of Craft CMS. I am happy to raise this with the Craft CMS team if this is an issue on their side. I just need to know how to troubleshoot and resolve this issue. I am very new to PHP and Craft CMS, so any help or guidance you can give me would be greatly appreciated.

SAML SSO SP Plugin Version: 2.3.1
Craft Version: 3.5.5
PHP Version: 7.4
Database: pgsql 11

Thank you! 🙏

sidm1983 commented 4 years ago

Actually, I just found the override. It is in my composer.json file.

Here is the contents of my composer.json file:

{
  "require": {
    "craftcms/cms": "3.5.5",
    "craftcms/redactor": "2.7.1",
    "shennyg/azure-blob-remote-volume": "1.0.2",
    "vlucas/phpdotenv": "^3.4.0"
  },
  "require-dev": {
    "yiisoft/yii2-shell": "^2.0.3"
  },
  "autoload": {
    "psr-4": {
      "modules\\": "modules/"
    }
  },
  "config": {
    "sort-packages": true,
    "optimize-autoloader": true,
    "platform": {
      "php": "7.0"
    }
  },
  "scripts": {
    "post-root-package-install": [
      "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ]
  }
}

Not sure why my config.platform.php setting is set to 7.0 there. Should I remove this or should I change it to 7.2? Are there any other issues I need to worry about from the composer error output in my original issue description above?

dsmrt commented 4 years ago

Totally up to you but you may just want to remove it. I think I added that in to limit the crazy amount of variables we plugin devs have to factor in, since we don't have any control over consumer's environments. Plus EOL for 7.1 was December 2019.

Anyways, looks good from your environment since you are on 7.4.

Hope this helps! Let me know if there's anything else I can help with. Closing the issue for now but I can reopen it if needed.

sidm1983 commented 4 years ago

No worries @dsmrt! Thank you for that. Will remove it and try again. Hopefully, it works with no PHP version override. Also, I don't think it was added in because of this SAML plugin. Doing a git blame on the file showed that it was overridden way before I installed this plugin. Perhaps, something Craft CMS or some other plugin added in. Anyway, will let you know if I encounter any more issues. Thanks for the quick response. 🙏🏽🙌🏽😊

sidm1983 commented 4 years ago

@dsmrt, just wanted to report back that I ended up changing the config.platform.php setting to 7.3 instead of removing it. I was able to install the plugin successfully. Thank you for your help with this. Closing this ticket now.

dsmrt commented 4 years ago

Great to hear! Let me know if you have any other questions.