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

(Vortex 1.10.7) "... Cannot convert value to type System.String ..." upgrade bug #212

Closed
2 tasks done
myrmeleontidae opened this issue Apr 4, 2024 · 7 comments
Closed
2 tasks done
Labels
stale No response so unable to proceed.

Comments

@myrmeleontidae
Copy link

myrmeleontidae commented Apr 4, 2024

Checklist

  • I have checked for similar opened and closed issues.
  • The issue title is in the format (<PACKAGENAME>) <ISSUE SUMMARY>.

Chocolatey Version

2.2.2

Chocolatey License

None

Package Version

1.9.13 ->1.10.7

Current Behaviour

The part of the log where the error occurs:

2024-03-22 19:05:08,797 6536 [DEBUG] - ---------------------------Script Execution---------------------------
2024-03-22 19:05:08,798 6536 [DEBUG] - Running 'ChocolateyScriptRunner' for vortex v1.10.7 with packageScript 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyInstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\vortex', installArguments: '', packageParameters: '', preRunHookScripts: '', postRunHookScripts: '',

2024-03-22 19:05:08,800 6536 [DEBUG] - Running package script 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyInstall.ps1'

2024-03-22 19:05:09,051 6536 [ERROR] - ERROR: Cannot process argument transformation on parameter 'file'. Cannot convert value to type System.String.

2024-03-22 19:05:09,054 6536 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = '';[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::SystemDefault; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '' -preRunHookScripts $null -postRunHookScripts $null'] exited with '-1'.

2024-03-22 19:05:09,054 6536 [DEBUG] - Calling command ['"C:\WINDOWS\System32\shutdown.exe" /a']

2024-03-22 19:05:09,085 6536 [DEBUG] - Command ['"C:\WINDOWS\System32\shutdown.exe" /a'] exited with '1116'

2024-03-22 19:05:09,180 6536 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\vortex'

2024-03-22 19:05:09,508 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\vortex.nupkg'
with checksum '8610B0A977095D547CC8AACEC2F52008'

2024-03-22 19:05:09,509 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\vortex.nuspec'
with checksum 'D63D1D7318A7C3D1F350BEFA91B0F7FA'

2024-03-22 19:05:09,510 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\legal\LICENSE.txt'
with checksum 'BAC64046F32808A1B086A90BB399E5F0'

2024-03-22 19:05:09,510 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\legal\VERIFICATION.txt'
with checksum '5713B277912CCE2A898F32CC8659EEE2'

2024-03-22 19:05:09,511 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\tools\.skipAutoUninstall'
with checksum 'D41D8CD98F00B204E9800998ECF8427E'

2024-03-22 19:05:09,512 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyInstall.ps1'
with checksum '8B8EEBB01EEBF9DB5CB586B9067FE43B'

2024-03-22 19:05:09,512 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyUninstall.ps1'
with checksum '6C5DC5DA33925FF169122B50EFFACB0B'

2024-03-22 19:05:09,993 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\tools\vortex-setup-1.10.6.exe'
with checksum '01CAE4AB374B24E7FF2C5247D51A83D5'

2024-03-22 19:05:10,454 6536 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\vortex\tools\vortex-setup-1.10.7.exe'
with checksum '702389BB4E1BFF8F0219798391CA4C12'

2024-03-22 19:05:10,455 6536 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\vortex.1.10.7\.arguments".

2024-03-22 19:05:10,455 6536 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\vortex.1.10.7\.extra".

2024-03-22 19:05:10,456 6536 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\vortex.1.10.7\.version".

2024-03-22 19:05:10,456 6536 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\vortex.1.10.7\.sxs".
2024-03-22 19:05:10,457 6536 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\vortex.1.10.7\.pin".
2024-03-22 19:05:10,457 6536 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\vortex".
2024-03-22 19:05:13,552 6536 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...

2024-03-22 19:05:13,554 6536 [ERROR] - The upgrade of vortex was NOT successful.
2024-03-22 19:05:13,559 6536 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyInstall.ps1'.
See log for details.

2024-03-22 19:05:13,564 6536 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bad\vortex".
2024-03-22 19:05:13,566 6536 [DEBUG] - Moving C:\ProgramData\chocolatey\lib\vortex to C:\ProgramData\chocolatey\lib-bad\vortex\1.10.7

2024-03-22 19:05:13,567 6536 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\vortex'
to 'C:\ProgramData\chocolatey\lib-bad\vortex\1.10.7'

2024-03-22 19:05:15,590 6536 [DEBUG] - Attempting rollback
2024-03-22 19:05:15,592 6536 [DEBUG] - Moving C:\ProgramData\chocolatey\lib-bkp\vortex\1.9.13 to C:\ProgramData\chocolatey\lib\vortex

2024-03-22 19:05:15,595 6536 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib-bkp\vortex\1.9.13'
to 'C:\ProgramData\chocolatey\lib\vortex'

2024-03-22 19:05:17,945 6536 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bkp\vortex".

Contents of '...\chocolateyInstall.ps1':

$ErrorActionPreference = 'Stop'

$packageName = 'vortex'

$toolsDir = Split-Path $MyInvocation.MyCommand.Definition
$fileLocation = Get-Item "$toolsDir\*.exe"

$packageArgs = @{
  packageName    = $packageName
  fileType       = 'exe'
  file           = $fileLocation
  silentArgs     = "/S"
  validExitCodes = @(0)
}

Install-ChocolateyInstallPackage @packageArgs

# Remove the installers as there is no more need for it
Remove-Item $toolsDir\*.exe -ea 0 -Force

All the files in the '...\vortex\tools' subdirectory:

.skipAutoUninstall
chocolateyInstall.ps1
chocolateyUninstall.ps1
vortex-setup-1.9.13.exe.ignore

There is no '...\vortex.install' directory in '...\chocolatey\lib', just '...\vortex'.

Expected Behaviour

Successful upgrade after 'choco upgrade vortex' or 'choco upgrade all' commands to the CLI.

Steps To Reproduce

  1. Unsure, but attempt upgrading from Vortex version 1.9.13 to 1.10.7.
  2. Uninstall and reinstall Vortex.
  3. (Possibly) incorrect clean-up of older version files will occur.

Environment

- Operating System: Microsoft Windows NT 10.0.19045.0
- PowerShell Version:
Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
- Shell: Windows Terminal (PowerShell)

Chocolatey Log

https://gist.github.com/myrmeleontidae/915e42fde4e479323de898898d03949a

Anything else?

There were two different error messages, one argument transformation failure, and a slightly different error after uninstalling and then reinstalling 1.9.13. The latter error yielded a pop-up toast from Vortex, stating "older files were not cleaned up" (paraphrasing).

A long shot, but the issues may have something to do with adverse behaviour while using my VPN, although why, I have no idea.

Copy link

github-actions bot commented Apr 4, 2024

Thanks for raising this issue!

The packages within this repository are maintained in my spare time. My spare time, like yours is important. Please help me not to waste it.

To help me, and to have the issue resolved more quickly, please see CONTRIBUTING for how to raise a pull request to resolve the issue yourself.

Thank you.

@Rikj000
Copy link

Rikj000 commented May 7, 2024

I'm experiencing the same issue when attempting to upgrade from Vortex v1.8.1 to v1.10.7.

Linking to related issue in previous maintainer repo: JourneyOver/chocolatey-packages#70

WingetUI Log:

 Chocolatey v2.2.2
 Upgrading the following packages:
 vortex
 By upgrading, you accept licenses for the packages.
 You have vortex v1.8.1 installed. Version 1.10.7 is available based on your source(s).
 vortex v1.10.7 [Approved]
 vortex package files upgrade completed. Performing other installation steps.
 ERROR: Cannot process argument transformation on parameter 'file'. Cannot convert value to type System.String.
 The upgrade of vortex was NOT successful.
 Error while running 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyInstall.ps1'.
  See log for details.
 Chocolatey upgraded 0/1 packages. 1 packages failed.
  See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
 Failures
  - vortex (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\vortex\tools\chocolateyInstall.ps1'.
  See log for details.

@pauby
Copy link
Owner

pauby commented May 8, 2024

Apologies. I missed the original issue being raised.

I cannot reproduce this. Note that this is an upgrade from 1.8.1 to 1.10.7:

image

@pauby
Copy link
Owner

pauby commented May 8, 2024

Note that the line that has file in it is here. It has a hard-coded string ($fileLocation) and a command to get the current directory ($toolsdir).

Can you try to upgrade using the -vd parameter (for verbose and debug), capture the output and create a gist, and add the link to it in a comment? Please don't paste the code into a comment, as there is a LOT of text generated by those options.

@Rikj000
Copy link

Rikj000 commented May 9, 2024

I noticed my chocolateyInstall.ps1 file was slightly different:

Toggle to expand/collapse "chocolateyInstall.ps1"
$ErrorActionPreference = 'Stop'

$packageName = 'vortex'

$toolsDir = Split-Path $MyInvocation.MyCommand.Definition
$fileLocation = Get-Item "$toolsDir\*.exe"

$packageArgs = @{
  packageName    = $packageName
  fileType       = 'exe'
  file           = $fileLocation
  silentArgs     = "/S"
  validExitCodes = @(0)
}

Install-ChocolateyInstallPackage @packageArgs

# Remove the installers as there is no more need for it
Remove-Item $toolsDir\*.exe -ea 0 -Force

I tried manually altering it to the latest version you linked,
but that did not help.

In the end I successfully installed v1.10.7 by first uninstalling v1.8.1 as following:

choco uninstall vortex -y
choco install vortex -y

@pauby
Copy link
Owner

pauby commented May 9, 2024

The chocolateyInstall.ps1 file you added is the one from the version you had (1.8.1). However, the script that is run when you upgrade to 1.10.7 is the one in that package (which is linked in my previous comment).

I genuinely don't know what is causing this as I can't reproduce it, but more than one other person is so I acknowledge it's a problem. Without the logs I mentioned, I don't have anything to go on (and maybe even if I do have them, it won't be obvious what is the issue). Maybe @myrmeleontidae can provide them.

@pauby
Copy link
Owner

pauby commented Jul 27, 2024

No updates on this one so I'm going to close it.

@pauby pauby closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
@pauby pauby added the stale No response so unable to proceed. label Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No response so unable to proceed.
Projects
None yet
Development

No branches or pull requests

3 participants