Giter Site home page Giter Site logo

[Bug]: Recent change to Resolve-SystemNetWebRequest appears to have broken URL's returned for Sourceforge based Apps about evergreen HOT 9 CLOSED

chezzer64 avatar chezzer64 commented on June 24, 2024 1
[Bug]: Recent change to Resolve-SystemNetWebRequest appears to have broken URL's returned for Sourceforge based Apps

from evergreen.

Comments (9)

aaronparker avatar aaronparker commented on June 24, 2024 1

I've updated Resolve-SystemNetWebRequest and Get-SourceForgeRepoRelease to not send a user agent, so it should now resolve the right URL

Version Architecture Type Size    Md5                              URI
------- ------------ ---- ----    ---                              ---
23.01   x86          exe  584704  58fc6de6c4e5d2fda63565d54feb9e75 https://ixpeering.dl.sourceforge.net/project/sevenzip/7-Zip/23.01/7zr.exe
23.01   x64          msi  1933312 7025502de20d7b39fb06870ab06d015b https://ixpeering.dl.sourceforge.net/project/sevenzip/7-Zip/23.01/7z2301-x64.msi
23.01   x64          exe  1589510 e5788b13546156281bf0a4b38bdd0901 https://ixpeering.dl.sourceforge.net/project/sevenzip/7-Zip/23.01/7z2301-x64.exe
23.01   ARM64        exe  1527518 3c5917f4da614ef892f055c697744b77 https://ixpeering.dl.sourceforge.net/project/sevenzip/7-Zip/23.01/7z2301-arm64.exe
23.01   ARM32        exe  1596691 d98f54ca52882376fd8b39b29628a90a https://ixpeering.dl.sourceforge.net/project/sevenzip/7-Zip/23.01/7z2301-arm.exe
23.01   x86          msi  1501184 49780e0517aa248e7fd90f50674a2645 https://ixpeering.dl.sourceforge.net/project/sevenzip/7-Zip/23.01/7z2301.msi
23.01   x86          exe  1301195 1cfb215a6fb373ac33a38b1db320c178 https://ixpeering.dl.sourceforge.net/project/sevenzip/7-Zip/23.01/7z2301.exe

from evergreen.

chezzer64 avatar chezzer64 commented on June 24, 2024

Here is a sample of the correct URI's being returned when running Evergreen 2404.928

Get-EvergreenApp -name winscp -verbose
VERBOSE: Function path: C:\Program Files\WindowsPowerShell\Modules\Evergreen\2404.928\Apps\Get-winscp.ps1
VERBOSE: Function exists: C:\Program Files\WindowsPowerShell\Modules\Evergreen\2404.928\Apps\Get-winscp.ps1.
VERBOSE: Dot sourcing: C:\Program Files\WindowsPowerShell\Modules\Evergreen\2404.928\Apps\Get-winscp.ps1.
VERBOSE: Get-FunctionResource: read application resource strings from [C:\Program Files\WindowsPowerShell\Modules\Evergreen\2404.928\Manifests\winscp.json]
VERBOSE: Calling: Get-winscp.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: UseBasicParsing: True.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: MaximumRedirection: 2.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: DisableKeepAlive: True.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0..
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: Method: Default.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: Uri: https://sourceforge.net/projects/winscp/best_release.json.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: ContentType: application/json; charset=utf-8.
VERBOSE: GET https://sourceforge.net/projects/winscp/best_release.json with 0-byte payload
VERBOSE: received 3296-byte response of content type application/json; charset=utf-8
VERBOSE: Get-SourceForgeRepoRelease: Validating SourceForge release object.
VERBOSE: Get-SourceForgeRepoRelease: Property validation succeeded.
VERBOSE: Get-SourceForgeRepoRelease: Capture version number from: /WinSCP/6.3.3/WinSCP-6.3.3-Setup.exe.
VERBOSE: Get-SourceForgeRepoRelease: Found filename: [WinSCP-6.3.3-Setup.exe].
VERBOSE: Get-SourceForgeRepoRelease: Found folder:   [/WinSCP/6.3.3/].
VERBOSE: Get-SourceForgeRepoRelease: Found version:  [6.3.3].
VERBOSE: Resolve-SystemNetWebRequest: Attempting to resolve:
http://downloads.sourceforge.net/project/winscp/WinSCP/6.3.3/WinSCP-6.3.3-Setup.exe?ts=gAAAAABmMgl9a1Zt1kVMVnF_CIMgT-ibMKhz3cOXDbV7AWpXZ4HkCBN8q_KTi3Wgx53aLrwoSeUp7xdQIjPMWOIyiSczc9dc9g%3D%3D.
VERBOSE: Resolve-SystemNetWebRequest: Resolved to: [http://kumisystems.dl.sourceforge.net/project/winscp/WinSCP/6.3.3/WinSCP-6.3.3-Setup.exe?viasf=1].
VERBOSE: Get-SourceForgeRepoRelease: Resolve mirror to: kumisystems.dl.sourceforge.net.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: UseBasicParsing: True.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: MaximumRedirection: 2.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: DisableKeepAlive: True.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0..
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: Method: Default.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: Uri: https://sourceforge.net/projects/winscp/rss?path=/WinSCP/6.3.3/.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: ContentType: application/rss+xml; charset=utf-8.
VERBOSE: GET https://sourceforge.net/projects/winscp/rss?path=/WinSCP/6.3.3/ with 0-byte payload
VERBOSE: received 7236-byte response of content type application/rss+xml; charset=utf-8
VERBOSE: Get-SourceForgeRepoRelease: found 2 items.
VERBOSE: Get-SourceForgeRepoRelease: matched: https://sourceforge.net/projects/winscp/files/WinSCP/6.3.3/WinSCP-6.3.3.msi/download.
VERBOSE: Get-SourceForgeRepoRelease: file: /WinSCP/6.3.3/WinSCP-6.3.3.msi
VERBOSE: Get-Architecture: Architecture not found in https://kumisystems.dl.sourceforge.net/project/winscp/WinSCP/6.3.3/WinSCP-6.3.3.msi, defaulting to x86.
VERBOSE: Get-SourceForgeRepoRelease: matched: https://sourceforge.net/projects/winscp/files/WinSCP/6.3.3/WinSCP-6.3.3-Setup.exe/download.
VERBOSE: Get-SourceForgeRepoRelease: file: /WinSCP/6.3.3/WinSCP-6.3.3-Setup.exe
VERBOSE: Get-Architecture: Architecture not found in https://kumisystems.dl.sourceforge.net/project/winscp/WinSCP/6.3.3/WinSCP-6.3.3-Setup.exe, defaulting to x86.


Version      : 6.3.3
Architecture : x86
Type         : exe
Size         : 11588560
Md5          : 91dbb70daebfd07c13cc7bf5bb8898a0
URI          : https://kumisystems.dl.sourceforge.net/project/winscp/WinSCP/6.3.3/WinSCP-6.3.3-Setup.exe

Version      : 6.3.3
Architecture : x86
Type         : msi
Size         : 27959296
Md5          : 1289dddf9fceb42565a4d3bf70862427
URI          : https://kumisystems.dl.sourceforge.net/project/winscp/WinSCP/6.3.3/WinSCP-6.3.3.msi

from evergreen.

DanGough avatar DanGough commented on June 24, 2024

Hmm, I may have to modify my PsDownload code to try a blank user agent first:

image

from evergreen.

xenadmin avatar xenadmin commented on June 24, 2024

Thank you very much for the very fast fix! I wasn't able to install 7-Zip and WinSCP Friday.
Do you have an ETA for when the fix will be GA? No pressure! Just curious.

from evergreen.

aaronparker avatar aaronparker commented on June 24, 2024

Pushed to the PowerShell gallery just now

from evergreen.

xenadmin avatar xenadmin commented on June 24, 2024

Evergreen Version 2405.994

Something is still off for me. On Azure VMs a command like this, for 7-zip and WinSCP, always results in a 100KB exe file, that is malformed and/or broken.

$Evergreen = Get-EvergreenApp -Name 7zip | Where-Object { $_.Architecture -eq 'x64' -and $_.Type -eq 'exe' }
Save-EvergreenApp -InputObject $Evergreen -CustomPath "D:\Temp\"
$Evergreen = Get-Evergreenapp -Name WinSCP | Where-Object { $_.Type -eq "exe" } | Select-Object -First 1
Save-EvergreenApp -InputObject $Evergreen -CustomPath "D:\Temp\"

Any ideas?
I have the feeling, it's not an Evergreen, but an Sourceforge issue. Because it works sometimes, but more ofter it fails. Maybe depending on the Sourceforge Hoster?

from evergreen.

aaronparker avatar aaronparker commented on June 24, 2024

The issue could be with Save-EvergreenApp which sends a user agent. I'll test with it not sending a user agent for SourceForge.

Have I mentioned how much I dislike SourceForge?

from evergreen.

aaronparker avatar aaronparker commented on June 24, 2024

I have also been wondering whether Evergreen should normalise the SourceForge URLs with a single host name, instead of returning one of the mirrors each time.

from evergreen.

aaronparker avatar aaronparker commented on June 24, 2024

See #677 re:SourceForge

from evergreen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.