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

Unable to load DLL 'libmi.so' on MacOS #5970

Closed
PleaseStopAsking opened this issue Jan 21, 2018 · 17 comments
Closed

Unable to load DLL 'libmi.so' on MacOS #5970

PleaseStopAsking opened this issue Jan 21, 2018 · 17 comments
Labels
Area-DSC Desired State Configuration issues Resolution-External The issue is caused by external component(s).

Comments

@PleaseStopAsking
Copy link

PleaseStopAsking commented Jan 21, 2018

Steps to reproduce

1. Install latest release of Powershell Core on Mac OS High Sierra
2. Build generic DSC config script
3. Error is immediately produced that DLL is unable to be loaded.

Expected behavior

DSC config is not marked as broken

Actual behavior

image



[PowerShell]
System.DllNotFoundException: Unable to load DLL 'libmi.so': The specified module or one of its dependencies could not be found.
 (Exception from HRESULT: 0x8007007E)
   at Microsoft.Management.Infrastructure.Native.NativeMethods.MI_Application_InitializeV1(UInt32 flags, String applicationID, IndirectPtr extendedError, DirectPtr application)
   at Microsoft.Management.Infrastructure.Native.MI_Application.Initialize(String applicationId, MI_Instance& extendedError, MI_Application& application)
   at Microsoft.Management.Infrastructure.Internal.CimApplication.GetApplicationHandle()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.Management.Infrastructure.Internal.CimApplication.get_Handle()
   at Microsoft.Management.Infrastructure.Serialization.CimMofDeserializer..ctor()
   at Microsoft.Management.Infrastructure.Serialization.CimMofDeserializer.Create()
   at Microsoft.PowerShell.DesiredStateConfiguration.CimDSCParser..ctor(OnClassNeeded onClassNeeded)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.ImportClasses(String path, Tuple`2 moduleInfo, Collection`1 errors)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.Initialize(Collection`1 errors, List`1 modulePathList)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Dictionary`2 functionsToDefine, Collection`1 errors, List`1 modulePathList, Boolean cacheResourcesFromMultipleModuleVersions)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Collection`1 errors)
   at System.Management.Automation.Language.Parser.ConfigurationStatementRule(IEnumerable`1 customAttributes, Token configurationToken)

Environment data

Name                           Value
----                           -----
PSVersion                      6.0.0
PSEdition                      Core
GitCommitId                    v6.0.0
OS                             Darwin 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov  9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@iSazonov
Copy link
Collaborator

iSazonov commented Jan 21, 2018

Related #5707

@iSazonov iSazonov added the Area-DSC Desired State Configuration issues label Jan 21, 2018
@PleaseStopAsking
Copy link
Author

PleaseStopAsking commented Jul 16, 2018

Any update on this issue?

@iSazonov
Copy link
Collaborator

iSazonov commented Jul 17, 2018

@PleaseStopAsking Please test with latest PowerShell Core version (Preview3 or better night build)

@PleaseStopAsking
Copy link
Author

PleaseStopAsking commented Jul 18, 2018

@iSazonov Checking with Preview3, the same error is getting thrown on any DSC configuration file.

screen shot 2018-07-18 at 10 28 28 am

The entire error message is...

System.DllNotFoundException: Unable to load shared library 'libmi.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibmi.so, 1): image not found at Microsoft.Management.Infrastructure.Native.NativeMethods.MI_Application_InitializeV1(UInt32 flags, String applicationID, IndirectPtr extendedError, DirectPtr application) at Microsoft.Management.Infrastructure.Native.MI_Application.Initialize(String applicationId, MI_Instance& extendedError, MI_Application& application) at Microsoft.Management.Infrastructure.Internal.CimApplication.GetApplicationHandle() at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) --- End of stack trace from previous location where exception was thrown --- at System.Lazy`1.CreateValue() at Microsoft.Management.Infrastructure.Internal.CimApplication.get_Handle() at Microsoft.Management.Infrastructure.Serialization.CimMofDeserializer..ctor() at Microsoft.Management.Infrastructure.Serialization.CimMofDeserializer.Create() at Microsoft.PowerShell.DesiredStateConfiguration.CimDSCParser..ctor(OnClassNeeded onClassNeeded) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.ImportClasses(String path, Tuple`2 moduleInfo, Collection`1 errors) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.Initialize(Collection`1 errors, List`1 modulePathList) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Dictionary`2 functionsToDefine, Collection`1 errors, List`1 modulePathList, Boolean cacheResourcesFromMultipleModuleVersions) at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Collection`1 errors) at System.Management.Automation.Language.Parser.ConfigurationStatementRule(IEnumerable`1 customAttributes, Token configurationToken)

@iSazonov
Copy link
Collaborator

iSazonov commented Jul 19, 2018

/cc @TravisEz13 Could you please look the DSC-related issue?

@TravisEz13
Copy link
Member

TravisEz13 commented Jul 19, 2018

I've repro'd the issue on

Name                           Value                                                                                                                                                          
----                           -----                                                                                                                                                          
PSVersion                      6.0.3                                                                                                                                                          
PSEdition                      Core                                                                                                                                                           
GitCommitId                    v6.0.3                                                                                                                                                         
OS                             Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64                                                  
Platform                       Unix                                                                                                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                        
PSRemotingProtocolVersion      2.3                                                                                                                                                            
SerializationVersion           1.1.0.1                                                                                                                                                        
WSManStackVersion              3.0                                                                                                                                                            

@TravisEz13
Copy link
Member

TravisEz13 commented Jul 19, 2018

and on

Name                           Value
----                           -----
PSVersion                      6.1.0-preview.4
PSEdition                      Core
GitCommitId                    6.1.0-preview.4
OS                             Darwin 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@TravisEz13 TravisEz13 added the Issue-Bug Issue has been identified as a bug in the product label Jul 19, 2018
@TravisEz13
Copy link
Member

TravisEz13 commented Jul 19, 2018

Although the error is slightly different in preview

System.DllNotFoundException: Unable to load shared library 'libmi.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibmi.so, 1): image not found
   at Microsoft.Management.Infrastructure.Native.NativeMethods.MI_Application_InitializeV1(UInt32 flags, String applicationID, IndirectPtr extendedError, DirectPtr application)
   at Microsoft.Management.Infrastructure.Native.MI_Application.Initialize(String applicationId, MI_Instance& extendedError, MI_Application& application)
   at Microsoft.Management.Infrastructure.Internal.CimApplication.GetApplicationHandle()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
--- End of stack trace from previous location where exception was thrown ---
   at System.Lazy`1.CreateValue()
   at Microsoft.Management.Infrastructure.Internal.CimApplication.get_Handle()
   at Microsoft.Management.Infrastructure.Serialization.CimMofDeserializer..ctor()
   at Microsoft.Management.Infrastructure.Serialization.CimMofDeserializer.Create()
   at Microsoft.PowerShell.DesiredStateConfiguration.CimDSCParser..ctor(OnClassNeeded onClassNeeded)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.ImportClasses(String path, Tuple`2 moduleInfo, Collection`1 errors)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.Initialize(Collection`1 errors, List`1 modulePathList)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Dictionary`2 functionsToDefine, Collection`1 errors, List`1 modulePathList, Boolean cacheResourcesFromMultipleModuleVersions)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscClassCache.LoadDefaultCimKeywords(Collection`1 errors)
   at System.Management.Automation.Language.Parser.ConfigurationStatementRule(IEnumerable`1 customAttributes, Token configurationToken)

@TravisEz13
Copy link
Member

TravisEz13 commented Jul 19, 2018

first of all, it's trying to open a Linux library on mac, this won't work Unable to load shared library 'libmi.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibmi.so, 1): image not found

@TravisEz13 TravisEz13 added Resolution-External The issue is caused by external component(s). and removed Issue-Bug Issue has been identified as a bug in the product labels Jul 19, 2018
@PleaseStopAsking
Copy link
Author

PleaseStopAsking commented Jul 19, 2018

@TravisEz13 what does the Resolution-External label signify?

@TravisEz13
Copy link
Member

TravisEz13 commented Jul 19, 2018

@dantraMSFT I think this should be moved to MMI. Do you agree?

@TravisEz13
Copy link
Member

TravisEz13 commented Jul 19, 2018

I verified with @dantraMSFT

@TravisEz13
Copy link
Member

TravisEz13 commented Jul 19, 2018

I filed an issue with the MMI project and I'll close this issue as external.

@cr-bglover
Copy link

cr-bglover commented Aug 24, 2018

@TravisEz13, do you have a ref for the issue you filed? Still affecting MacOS

@TravisEz13
Copy link
Member

TravisEz13 commented Aug 24, 2018

It's on the line above where I said I filed the issue.

@cr-bglover
Copy link

cr-bglover commented Aug 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-DSC Desired State Configuration issues Resolution-External The issue is caused by external component(s).
Projects
None yet
Development

No branches or pull requests

4 participants