fortrabbit / craft-object-storage

A Craft 3 plugin that integrates with fortrabbit's S3 compatible Object Storage
MIT License
3 stars 8 forks source link

Cannot install plugin on version 3.0.3.1 #1

Closed pablo-tapia closed 6 years ago

pablo-tapia commented 6 years ago

I'm trying to install the plugin on a fresh copy of Craft v3.0.3.1, I've followed the steps listed on the README file but it throws this error:

Return value of fortrabbit\ObjectStorage\Plugin::registerRoutes() must be an instance of fortrabbit\ObjectStorage\void, none returned

I thought maybe the issue was the lack of object storage configuration on the env file but no luck, I remember having issues with the Craft 2 version of this plugin when trying to configure an Object Storage for the US region.

Here's the complete stack:

TypeError: Return value of fortrabbit\ObjectStorage\Plugin::registerRoutes() must be an instance of fortrabbit\ObjectStorage\void, none returned in /var/www/vendor/fortrabbit/craft-object-storage/src/Plugin.php:122
Stack trace:
#0 /var/www/vendor/fortrabbit/craft-object-storage/src/Plugin.php(50): fortrabbit\ObjectStorage\Plugin->registerRoutes()
#1 /var/www/vendor/yiisoft/yii2/base/BaseObject.php(109): fortrabbit\ObjectStorage\Plugin->init()
#2 /var/www/vendor/yiisoft/yii2/base/Module.php(158): yii\base\BaseObject->__construct(Array)
#3 /var/www/vendor/craftcms/cms/src/base/Plugin.php(87): yii\base\Module->__construct('fortrabbit-obje...', Object(craft\web\Application), Array)
#4 [internal function]: craft\base\Plugin->__construct('fortrabbit-obje...', Object(craft\web\Application), Array)
#5 /var/www/vendor/yiisoft/yii2/di/Container.php(383): ReflectionClass->newInstanceArgs(Array)
#6 /var/www/vendor/yiisoft/yii2/di/Container.php(156): yii\di\Container->build('fortrabbit\\Obje...', Array, Array)
#7 /var/www/vendor/yiisoft/yii2/BaseYii.php(349): yii\di\Container->get('fortrabbit\\Obje...', Array, Array)
#8 /var/www/vendor/craftcms/cms/src/services/Plugins.php(777): yii\BaseYii::createObject(Array, Array)
#9 /var/www/vendor/craftcms/cms/src/services/Plugins.php(443): craft\services\Plugins->createPlugin('fortrabbit-obje...')
#10 /var/www/vendor/craftcms/cms/src/controllers/PluginsController.php(48): craft\services\Plugins->installPlugin('fortrabbit-obje...')
#11 [internal function]: craft\controllers\PluginsController->actionInstallPlugin()
#12 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#13 /var/www/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#14 /var/www/vendor/craftcms/cms/src/web/Controller.php(76): yii\base\Controller->runAction('install-plugin', Array)
#15 /var/www/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('install-plugin', Array)
#16 /var/www/vendor/craftcms/cms/src/web/Application.php(267): yii\base\Module->runAction('plugins/install...', Array)
#17 /var/www/vendor/craftcms/cms/src/web/Application.php(515): craft\web\Application->runAction('plugins/install...', Array)
#18 /var/www/vendor/craftcms/cms/src/web/Application.php(251): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#19 /var/www/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#20 /var/www/web/index.php(21): yii\base\Application->run()
#21 {main}
pablo-tapia commented 6 years ago

Ok nevermind that, I just realized the issue only happens on my docker app, when I enable the module on Fortabbit it works. Could it be something related to file permissions?

ostark commented 6 years ago

@pablo-tapia I guess you are using PHP 7.0 and php complains about the void return type.

pablo-tapia commented 6 years ago

I see what you mean, I didn't notice it requires 7.1. Sorry and thanks for the help.