No Datum store found for DSC Resource error

Welcome Forums DSC (Desired State Configuration) No Datum store found for DSC Resource error

This topic contains 5 replies, has 2 voices, and was last updated by

 
Participant
1 month ago.

  • Author
    Posts
  • #177289

    Participant
    Topics: 9
    Replies: 59
    Points: 417
    Helping Hand
    Rank: Contributor

    I watched Gael Colas' presentations which can be found on Youtube,
    and I am very convinced that it is a very usefull module when working with DSC.
    However, I am not able to use Datum correctly.

    I've created a little structure with 2 nodes and 2 roles just to play arround and be able to manage the basics.

    PS> (Get-ChildItem -Recurse).FullName
    E:\dsc\ConfigurationData\AllNodes
    E:\dsc\ConfigurationData\Roles
    E:\dsc\ConfigurationData\Datum.yml
    E:\dsc\ConfigurationData\AllNodes\v-Computer1.yml
    E:\dsc\ConfigurationData\AllNodes\v-Computer2.yml
    E:\dsc\ConfigurationData\Roles\FileServer.yml
    E:\dsc\ConfigurationData\Roles\WebServer.yml

    Based on what I found on the Datum's Github page, I've filled the files and here is the content

    PS> Get-ChildItem *.yml -Recurse | ForEach-Object {"`n`r$($_.FullName)"; Get-Content -Path $_.FullName}
    
    E:\dsc\ConfigurationData\AllNodes\v-Computer1.yml
    Name: v-Computer1
    IP: '10.0.0.11'
    Role: FileServer
    
    E:\dsc\ConfigurationData\AllNodes\v-Computer2.yml
    Name: v-Computer2
    IP: '10.0.0.12'
    Role: WebServer
    
    E:\dsc\ConfigurationData\Roles\FileServer.yml
    WindowsFeatureList:
      - FS-FileServer
      - FS-Data-Deduplication
    
    E:\dsc\ConfigurationData\Roles\WebServer.yml
    WindowsFeatureList:
      - Web-WebServer
    
    E:\dsc\ConfigurationData\Datum.yml
    ResolutionPrecedence:
      - AllNodes\$($Node.Name)
      - Roles\$($Node.Role)

    Now creating the Datum variable

    $datum = New-DatumStructure -DefinitionFile .\Datum.yml

    Looking inside the variable

    PS> $datum
    
    Name                           Value                                                                                                                                                                                                   
    ----                           -----                                                                                                                                                                                                   
    __Definition                   {ResolutionPrecedence, DatumStructure}                                                                                                                                                                  
    Roles                          FileProvider                                                                                                                                                                                            
    AllNodes                       FileProvider
    
    PS> $datum.Roles
    
    FileServer           WebServer           
    ----------           ---------           
    {WindowsFeatureList} {WindowsFeatureList}
    
    PS> $datum.AllNodes
    
    v-Computer1      v-Computer2     
    -----------      -----------     
    {Name, IP, Role} {Name, IP, Role}
    
    PS> $datum.AllNodes.'v-Computer1'
    
    Name                           Value                                                                                                                                                                                                   
    ----                           -----                                                                                                                                                                                                   
    Name                           v-Computer1                                                                                                                                                                                             
    IP                             10.0.0.11                                                                                                                                                                                               
    Role                           FileServer

    So far so good!

    However, I am not able to make the lookup working...

    PS> Lookup WindowsFeatureList
    WARNING: 	No Datum store found for DSC Resource
    The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
    At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
    +         throw "The lookup of path '$PropertyPath' for node '$($node.N ...
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
        + FullyQualifiedErrorId : The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
    	
    
    PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath WindowsFeatureList
    WARNING: 	No Datum store found for DSC Resource
    The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
    At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
    +         throw "The lookup of path '$PropertyPath' for node '$($node.N ...
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
        + FullyQualifiedErrorId : The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
    
    PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath Name
    WARNING: 	No Datum store found for DSC Resource
    The lookup of path 'Name' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
    At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
    +         throw "The lookup of path '$PropertyPath' for node '$($node.N ...
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
        + FullyQualifiedErrorId : The lookup of path 'Name' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
    
    PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath IP
    WARNING: 	No Datum store found for DSC Resource
    The lookup of path 'IP' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
    At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
    +         throw "The lookup of path '$PropertyPath' for node '$($node.N ...
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
        + FullyQualifiedErrorId : The lookup of path 'IP' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.

    If someone could save me from tearing my hair out of my head... 🙂

  • #177295

    Participant
    Topics: 1
    Replies: 46
    Points: 150
    Helping Hand
    Rank: Participant

    If you change your debug preference to continue you should get much more info for troubleshooting.

     

    Sorry, only on my phone rn.

    Feel free to paste result here and I can try to help interpret.

    • #177304

      Participant
      Topics: 9
      Replies: 59
      Points: 417
      Helping Hand
      Rank: Contributor

      Hi Gael!

      Here is the output:

      PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath WindowsFeatureList -Debug
      DEBUG: Resolve-Datum -PropertyPath  -Node 
      DEBUG: Get-MergeStrategyFromString -MergeStrategy <>
      DEBUG: Couldn't Match the strategy 
      DEBUG: 	Get-MergeStrategyFromPath -PropertyPath  -Strategies [^.*], count 1
      DEBUG: 	  Strategy matching regex ^.*
      DEBUG: 	  StrategyKey: ^.*
      DEBUG: 	  Returning Strategy ^.* of type ''
      DEBUG: 			
      DEBUG: 			Current Path: $Datum.AllNodes
      DEBUG: 				branch of path Left to walk: .WindowsFeatureList
      DEBUG: 			Current Path: $Datum.AllNodes.WindowsFeatureList
      DEBUG: 				branch of path Left to walk: .
      DEBUG:   Depth: 0; Merge options = 1
      DEBUG: 			
      DEBUG: 			Current Path: $Datum.Roles
      DEBUG: 				branch of path Left to walk: .WindowsFeatureList
      DEBUG: 			Current Path: $Datum.Roles.WindowsFeatureList
      DEBUG: 				branch of path Left to walk: .
      DEBUG:   Depth: 0; Merge options = 1
      DEBUG: 		Attempting to load datum from E:\dsc\ConfigurationData.
      WARNING: 	No Datum store found for DSC Resource
      The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
      At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
      +         throw "The lookup of path '$PropertyPath' for node '$($node.N ...
      +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
          + FullyQualifiedErrorId : The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
  • #177307

    Participant
    Topics: 1
    Replies: 46
    Points: 150
    Helping Hand
    Rank: Participant

    Ha yeah, you don't have anything set for Node to lookup.

    You should first set it:

    $node = $datum.AllNodes.'v-computer1'

    Then do the lookup.

    The lookup command has a parameter $node that resolves automatically what exist in current session, or you can explicitly pass the node Hashtable as param.

    • #177523

      Participant
      Topics: 9
      Replies: 59
      Points: 417
      Helping Hand
      Rank: Contributor

      Unfortunately I get the same error.
      It would have suprised me because I already used the -Node parameter with the cmdlet.

      PS> $node = $datum.AllNodes.'v-computer1'
      
      PS> Lookup -DatumTree $datum -Node v-Computer1 -PropertyPath WindowsFeatureList
      WARNING: 	No Datum store found for DSC Resource
      The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.
      At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
      +         throw "The lookup of path '$PropertyPath' for node '$($node.N ...
      +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
          + FullyQualifiedErrorId : The lookup of path 'WindowsFeatureList' for node '' returned a Null value, but Null is not specified as Default. This is not allowed.

      I also tried without using the -Node parameter, but same error.

      PS> Lookup -DatumTree $datum -PropertyPath WindowsFeatureList
      WARNING: 	No Datum store found for DSC Resource
      The lookup of path 'WindowsFeatureList' for node 'v-Computer1' returned a Null value, but Null is not specified as Default. This is not allowed.
      At C:\Program Files\WindowsPowerShell\Modules\datum\0.0.38\ScriptsToProcess\Resolve-NodeProperty.ps1:106 char:9
      +         throw "The lookup of path '$PropertyPath' for node '$($node.N ...
      +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : OperationStopped: (The lookup of p...is not allowed.:String) [], RuntimeException
          + FullyQualifiedErrorId : The lookup of path 'WindowsFeatureList' for node 'v-Computer1' returned a Null value, but Null is not specified as Default. This is not allowed.
    • #178344

      Participant
      Topics: 9
      Replies: 59
      Points: 417
      Helping Hand
      Rank: Contributor

      My apologies Gael,

      Despite your clear explanation, I've completely misread your answer...
      By using the $Node object instead of the node name it's working better 🙂

      I had a look at your code and have a suggestion to avoid this mistake with other people using your module:

      You can create the $root object in the New-DatumStructure function with a PSTypeName.
      And accordingly, you can check this PSTypeName on the -Node parameter from the Resolve-Datum (lookup) function
      instead of validating the parameter as a beeing a string.

      I am quite sure you know the PSTypeName, but just in case, here is very good explanation from Adam Bertram:

      https://adamtheautomator.com/building-custom-object-types-powershell-pstypename/

      Anyway, thanks for your help Gael! 🙂

You must be logged in to reply to this topic.