solidfire / PowerShell

Collection of scripts, functions, and examples using the SolidFire Tools for PowerShell
MIT License
27 stars 20 forks source link

SDK error with PS 6.2.0 preview 3 and SF plugin 1.5.1 #68

Closed scaleoutsean closed 2 years ago

scaleoutsean commented 5 years ago

On Ubuntu 18.04, when powershell-preview_6.2.0-preview.3-1.ubuntu.18.04_amd64.deb and SF module are installed, on module import I get the following SDK error.

PS /home/sean> install-module solidfire.core -Scope currentuser

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the 
Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y

PS /home/sean> Import-Module solidfire.core                                                                                                       PS /home/sean> Connect-SFCluster                                                                                                                                                                                                                                                                    cmdlet Connect-SFCluster at command pipeline position 1                                                                                           Supply values for the following parameters:                                                                                                       
(Type !? for Help.)
Target: 1.1.1.1 
Credential
User: admin
Password for user admin: *****

Connect-SFCluster : Could not load file or assembly 'SolidFire.SDK, Version=1.5.1.2, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
At line:1 char:1
+ Connect-SFCluster
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Connect-SFCluster], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,SolidFire.Connection.ConnectSFCluster

PS /home/sean> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.0-preview.3
PSEdition                      Core
GitCommitId                    6.2.0-preview.3
OS                             Linux 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS /home/sean> cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
root@docker:~# uname -a
Linux docker 4.15.0-42-generic #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

After the error occured, copied the two DLL files to /opt/microsoft/powershell/6-preview/SolidFire.SDK.dll (got an error about missing JSON on powershell start), then I deleted them, re-installed PowerShell package (same version), started pwsh-preview again, then Import-Module, and the second time it worked fine.

Regarding SF SDK that's mentioned in the error, it currently misses the instructions on how to install it on Linux (don't know if that's even possible, maybe not).

Salmanius commented 5 years ago

I'm not surprised about the incompatibility with the newer PowerShell versions. We had a lot of issues with versioning between PS6 and netCore2.1. Thanks for bringing this up Sean.

scaleoutsean commented 5 years ago

About SDK installation on Linux - would that fix it?

Or should we just stick to version(s) tested prior to each release? Because auto-upgrades might break some installations, so if there's no DIY procedure (e.g. to rebuild SF SDK), then the user either has to roll back or wait until the next release of the SF PS Tool. If conservative approach is recommended, then we may want to add this to readme file and suggest a way to hold (lock) PS package to prevent it from auto-updating.

arjun960 commented 2 years ago

@scaleoutsean Was able to replicate the issue, The same issue was with different versions(1.7.0.55 & 12.3.0.81) of solidfire.core module on powershell 6.2.0 preview 3. After some investigation and trying to install solidfire.core 1.5.1.1 version (the same version which you have faced the issue, that is the only solidfire.core module available at that time) with different versions of powershell stable and preview versions. Found that the issue is having something to do with Scope parameter passed with value currentuser in powershell 6.2 preview 3 and not an issue from SDK side. The issue is not found in any other powershell versions. So, Please use stable versions of the powershell to avoid these kind of issues.

Tried powershell 6.1 on ubuntu 18.04 in the similar way and found that there is no issue: image

Closing the issue, as there is no problem at SDK side.