1

Powershell scrips for the creation of Tenant accidentally stopped to work

  1. I click the right mouse button on the content item and select "Insert>Tenant"
  2. I fill the name of a tenant and unselect all modules
  3. I click OK button

Execution fails near to the end with the message: enter image description here

SPE log contains next error:

2488 11:50:30 INFO  Executing PsSitecoreItemProvider5.Start(providerInfo='Sitecore')
2488 11:50:30 INFO  Script item set to master:\system\Modules\PowerShell\Script Library\SXA\SXA - Scaffolding\Content Editor\Insert Item\Tenant in ScriptSession $scriptSession$|tbw531otm3f1x2g5j541xbhp|a8877403-33fc-44b7-8034-a98672829163.
ManagedPoolThread #7 11:50:30 INFO  Executing a script in ScriptSession '$scriptSession$|tbw531otm3f1x2g5j541xbhp|a8877403-33fc-44b7-8034-a98672829163'.
2372 11:50:47 INFO  Executing PsSitecoreItemProvider5.Start(providerInfo='Sitecore')
2372 11:50:47 INFO  Executing a script in ScriptSession '$scriptSession$|tbw531otm3f1x2g5j541xbhp|c4d6c3db-40bf-49b2-9c36-9b40fc9de366'.
ManagedPoolThread #7 11:51:02 ERROR The property 'Modules' cannot be found on this object. Verify that the property exists and can be set.

What could be the reason for this error? How to troubleshoot this problem?

Update: I have enabled verbose logging. I get next info in the logs:

...
VERBOSE: Cmdlet Get-ProjectTemplateBasedOnBaseTemplate - Begin
VERBOSE: Cmdlet Get-ProjectTemplateBasedOnBaseTemplate - Process
VERBOSE: Found home item (/sitecore/templates/Project/a3/Home). Changing base template
VERBOSE: Cmdlet Get-ProjectTemplateBasedOnBaseTemplate - Begin
VERBOSE: Cmdlet Get-ProjectTemplateBasedOnBaseTemplate - Process
VERBOSE: Cmdlet Get-ProjectTemplateBasedOnBaseTemplate - End
VERBOSE: Found tenant page item (/sitecore/templates/Project/a3/Page)
VERBOSE: oldValue: {E9272B0E-3BBA-445F-8634-224D68966BB9}
VERBOSE: newValue: {F7F5538B-C54A-4F88-ACA8-DCBE143087E7}|{E9272B0E-3BBA-445F-8634-224D68966BB9}
VERBOSE: Cmdlet Get-ProjectTemplateBasedOnBaseTemplate - End
VERBOSE: Cmdlet Invoke-ModuleScriptBody - End
VERBOSE: Cmdlet Invoke-ExecuteScript - End
VERBOSE: Cmdlet Invoke-TenantAction - End
Add-Tenant : The property 'Modules' cannot be found on this object. Verify that the property exists and can be set.
At line:133 char:17
+ ...             Add-Tenant $Model.TenantLocation ($Model.TenantName) ($Mo ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Add-Tenant], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException,Add-Tenant
6
  • You can try downloading the SXA package and install. Then check. Nov 22 '21 at 10:12
  • You can reinstall SXA (it looks to me that one field is missing) or you can try debugging using this alan-null.github.io/2019/12/sxa-scaffolding-debugging Nov 22 '21 at 10:13
  • @AlanPłócieniak See additional logs after enabling verbose logging
    – Anton
    Nov 22 '21 at 10:14
  • @Anton please validate if your Tenant template (from tenant templates) has this base template {3BC304DB-FE8F-4AA8-B95C-8C331E823F4C} (/sitecore/templates/Foundation/Experience Accelerator/Scaffolding/_Modules) or if you have it at all in your db. You just pasted some part of logs the next thing to check is to validate if this action was executed /sitecore/system/Settings/Foundation/Experience Accelerator/Scaffolding/Scaffolding Tenant Setup/Tenant Modules Nov 22 '21 at 10:19
  • @AlanPłócieniak Yes, _Modules is present in the database. And Tenant template is inherited from _Modules template
    – Anton
    Nov 22 '21 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.