Closed JohnnyMcWeed closed 4 years ago
what if you pin the deployer version again to 2.0.2 and test again? so we could find out whether is a problem with deployer or luya core.
cause i don't think we have changed something which should break that deployment in the core (https://github.com/luyadev/luya/compare/1.6.1...master)
Also the deployer changes are unlikely: https://github.com/luyadev/luya-deployer/compare/2.0.2...master
the luya bin is not in git folder?
The exception says config file '/prod/releases/18/vendor/luyadev/luya-core/bin/../../../../configs/env.php' found but no array returning
. So what does the env.php file looks on the server? the env file is created by the deployer.
Really strange... Thanks for the input about switching back. Just found out that when doing so it is no more working aswell... The env.php
file looks correct. The process is working until the migrate
command...
/prod/releases/18/luya
exists.
env.php
looks like this:
<?php
// generated at: Tue, 15 Sep 2020 18:54:22 +0000
// tag variable
$tag = '';
// check if new config.php file based config object exists.
$config = @include('config.php');
if ($config) {
$config->application([
'version' => ''
]);
return $config->toArray(['prod']);
}
// use old include structure
return require 'env-prod.php';
But I just checked and they updated Plesk, maybe somehow related to this... But strange that the other things work until then...
are you working with config.php or with env-prod.php? Maybe you have a white space in the config or something? Please post the config (remove sensitiv data of course).
I'm having the env-prod.php
<?php
use app\themes\zzztwenty\ZzzAssetBootstrap;
defined('YII_ENV') or define('YII_ENV', 'prod');
defined('YII_DEBUG') or define('YII_DEBUG', false);
$config = new \luya\Config('Glamourart', dirname(__dir__), [
'id' => 'zzz2020',
'siteTitle' => 'zzz',
'defaultRoute' => 'cms',
'basePath' => dirname(__DIR__),
'bootstrap' => [
ZzzAssetBootstrap::class,
],
'ensureSecureConnection' => true,
'modules' => [
'admin' => [
'class' => 'luya\admin\Module',
'secureLogin' => true,
'interfaceLanguage' => 'de',
'strongPasswordPolicy' => true,
'emailVerification' => true,
'jsonCruft' => true,
],
'cms' => [
'class' => 'luya\cms\frontend\Module',
'contentCompression' => true,
],
'cmsadmin' => [
'class' => 'luya\cms\admin\Module',
'hiddenBlocks' => [],
'blockVariations' => [],
],
'galleryfrontend' => [
'class' => 'luya\gallery\frontend\Module',
'useAppViewPath' => false,
],
'galleryadmin' => 'luya\gallery\admin\Module',
'contactform' => [
'class' => 'luya\contactform\Module',
// 'useAppViewPath' => true,
'mailTitle' => 'Kontaktanfrage',
'attributes' => [
'forename', 'name', 'email', 'tel', 'subject', 'message',
],
'rules' => [
[['forename', 'name', 'email', 'tel', 'subject', 'message'], 'required'],
['email', 'email'],
],
'attributeLabels' => [
'forename' => 'contact.forename',
'name' => 'contact.name',
'email' => 'contact.email',
'tel' => 'contact.tel',
'subject' => 'contact.subject',
'message' => 'contact.message'
],
'recipients' => [
'info@zzz.ch',
],
'spamDetectionDelay' => 5,
],
'basicauth' => [
'class' => 'luya\basicauth\Module',
'password' => '...',
],
'sitemap' => [
'class' => cebe\luya\sitemap\Module::class,
]
],
'components' => [
'mail' => [
'host' => 'xyz.yyy.ch',
'username' => 'mailer@zzz.ch',
'password' => '...',
'from' => 'info@zzz.ch',
'fromName' => 'Something',
],
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=127.0.0.1;dbname=...',
'username' => '...',
'password' => '...',
'charset' => 'utf8',
'enableSchemaCache' => true,
'schemaCacheDuration' => 43200,
],
'composition' => [
'hidden' => true,
'default' => ['langShortCode' => 'de'],
'allowedHosts' => [
'prod.zzz.ch', 'zzz.ch',
]
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'i18n' => [
'translations' => [
'app*' => [
'class' => 'yii\i18n\PhpMessageSource',
],
],
],
],
'params' => [
'pageSuffix' => ' | ...',
'mailInfo' => 'info@zzz.ch'
],
]);
$config->component('errorHandler', [
'class' => 'luya\web\ErrorHandler',
'api' => 'https://xxx.ch/errorapi',
'transferException' => true,
]);
return $config;
and when you go to
/prod/releases/18/vendor/luyadev/luya-core/base/Boot.php(219): luya\base\Boot->getConfigArray()
in the prod server release 18 and var_dump what the getConfigArray() returns, what is the result?
When adding var_dump($config);
in luya-core\base\Boot
on line 181 it's returning an object(luya\Config). The line after this checks for an array and throws the exception.
Then i would say this part does not work:
// check if new config.php file based config object exists.
$config = @include('config.php');
if ($config) {
$config->application([
'version' => ''
]);
return $config->toArray(['prod']);
}
otherwise the config would be parsed to an array.
sorry, i overread that you have Config in your env-prod, it must be config.php. see the current build https://github.com/luyadev/luya-kickstarter/tree/master/configs
So the docs must be adjusted to this 👍 https://luya.io/guide/install-structures
@JohnnyMcWeed would you please send a PR? Would be great. thansk!
What steps will reproduce the problem?
I did
composer update
, added to git and thenvendor\bin\dep luya prod -vvv
What is the expected result?
Normal deployment
What do you get instead? (A Screenshot can help us a lot!)
Additional infos