Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Missing Session component' thrown when importing element indexes #121

Closed
lenvanessen opened this issue Apr 18, 2018 · 3 comments
Closed
Labels
bug craft3 Schematic 4+ for craft3

Comments

@lenvanessen
Copy link

Exception 'craft\errors\MissingComponentException' with message 'Session does not exist in a console request.'

in xxx/vendor/craftcms/cms/src/console/Application.php:112

Stack trace:
#0 xxx/vendor/craftcms/cms/src/services/Assets.php(949): craft\console\Application->getSession()
#1 xxx/vendor/craftcms/cms/src/services/Assets.php(921): craft\services\Assets->getUserTemporaryUploadFolder(NULL)
#2 xxx/vendor/craftcms/cms/src/elements/Asset.php(188): craft\services\Assets->getCurrentUserTemporaryUploadFolder()
#3 xxx/vendor/craftcms/cms/src/base/Element.php(295): craft\elements\Asset::defineSources('index')
#4 xxx/vendor/craftcms/cms/src/services/ElementIndexes.php(73): craft\base\Element::sources('index')
#5 xxx/vendor/nerds-and-company/schematic/src/Mappers/ElementIndexMapper.php(66): craft\services\ElementIndexes->saveSettings('craft\\elements\\...', Array)
#6 xxx/vendor/nerds-and-company/schematic/src/Controllers/ImportController.php(88): NerdsAndCompany\Schematic\Mappers\ElementIndexMapper->import(Array, Array)
#7 xxx/vendor/nerds-and-company/schematic/src/Controllers/ImportController.php(49): NerdsAndCompany\Schematic\Controllers\ImportController->importFromYaml(Array)
#8 [internal function]: NerdsAndCompany\Schematic\Controllers\ImportController->actionIndex()
#9 xxx/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 xxx/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 xxx/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('index', Array)
#12 xxx/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('index', Array)
#13 xxx/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('schematic/impor...', Array)
#14 xxx/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('schematic/impor...', Array)
#15 xxx/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(craft\console\Request))
#16 xxx/craft(22): yii\base\Application->run()
#17 {main}
@bvangennep bvangennep added bug craft3 Schematic 4+ for craft3 labels Apr 18, 2018
@bvangennep bvangennep changed the title Throws exception when importing 'Missing Session component' thrown when importing element indexes Apr 18, 2018
@lenvanessen
Copy link
Author

After giving it some more thought, I don't think that this is a bug in your schematic extension. Schematic uses the Asset service, which uses the session ID to obfusticate the foldername.

In a console request, this session ID is not set, thus resulting in the exception being thrown.

craftcms/cms#2798

@bvangennep
Copy link
Contributor

Ok, let's see what craft has to say about it

@lenvanessen
Copy link
Author

Closed

craftcms/cms@8bddea2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug craft3 Schematic 4+ for craft3
Projects
None yet
Development

No branches or pull requests

2 participants