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

dsc-sqlserverdsc v 16.4.0-0-0 error #262

Open
Hvid opened this issue Sep 19, 2023 · 11 comments · Fixed by #261
Open

dsc-sqlserverdsc v 16.4.0-0-0 error #262

Hvid opened this issue Sep 19, 2023 · 11 comments · Fixed by #261
Labels
bug Something isn't working community

Comments

@Hvid
Copy link
Contributor

Hvid commented Sep 19, 2023

I updated to v16.4.0-0-0 from v16.0.0-0-0 and now i get these errors:
Error: dsc_sqlmemory: The term 'Import-SqlDscPreferredModule' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Error: dsc_sqlmemory: The term 'Import-SqlDscPreferredModule' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Error: /Stage[main]/Sqlhosting::Server/Dsc_sqlmemory[max_memory]: Could not evaluate: undefined method `[]' for nil:NilClass

Seems that function is not included in the module.

@Hvid
Copy link
Contributor Author

Hvid commented Sep 20, 2023

Correction, it's in SqlServerDsc.psm1. Maybe that file is just not imported?

@Hvid
Copy link
Contributor Author

Hvid commented Sep 20, 2023

Seems this thing broke it: dsccommunity/SqlServerDsc#1826

@pmcmaw
Copy link
Contributor

pmcmaw commented Sep 21, 2023

Hey @Hvid, in this case the only own the wrapper. We currently use Puppet.Dsc to wrap the code on the PowerShell Gallery therefore we have no control over the actual code that we wrap. My suggestion would be to downgrade the module to v16.0.0-0-0 until this is fixed in the Powershell Gallery. When it is fixed in the Powershell Gallery if you request us to republish the module containing the fix from the Powershell Gallery we will have no issues doing this.

@Hvid
Copy link
Contributor Author

Hvid commented Sep 21, 2023

Okay, but this works in powershell, without puppet. Is there any info i can pass on to the owners of the module to make it compatible?

@ic248
Copy link

ic248 commented Nov 14, 2023

I'm having exactly the same issue, with dsc-sqlserverdsc v 16.4.0-0-4 and Puppet 8

@jordanbreen28 jordanbreen28 added the bug Something isn't working label Dec 6, 2023
@rismoney
Copy link

rismoney commented Dec 7, 2023

So the break-fix for this was to put C:\ProgramData\PuppetLabs\puppet\cache\lib\puppet_x\sqlserverdsc\dsc_resources into the PsmodulesPath environment variable.

I am not sure if this project is setup to include that particular path or not.

@jordanbreen28 jordanbreen28 transferred this issue from puppetlabs/Puppet.Dsc Dec 12, 2023
@jordanbreen28
Copy link
Contributor

transferring as fix will go into ruby-pwsh.

@jordanbreen28
Copy link
Contributor

Released in v1.0.1 of puppetlabs-pwshlib.
Running puppet module upgrade puppetlabs-pwshlib will allow you to consume the change.
Thanks everyone!

@rismoney
Copy link

I don't think the fix is working. I believe I am still getting the error:

dsc_sqllogin: PowerShell DSC resource DSC_SqlLogin failed to execute Get-TargetResource functionality with error message: Failed to find a dependent module.  

The above breakfix seems to still be required for it to function

@ic248
Copy link

ic248 commented Jan 3, 2024

I agree @rismoney I get the same error

@jordanbreen28
Copy link
Contributor

Thanks for the update @rismoney and @ic248 - I'll re-open the issue!
This is open-source so happy to accept and collaborate on PRs in the meantime if anyone thinks of a nice way to manipulate the load PSModulePath in ruby-pwsh!
Hope to get a proper look at this again shortly.

@jordanbreen28 jordanbreen28 reopened this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants