aaronparker / evergreen

Create evergreen Windows image build pipelines with the latest version numbers and download URLs for common applications
http://stealthpuppy.com/evergreen/
MIT License
383 stars 66 forks source link

[Bug]: Get-EvergreenApp cannot get Microsoft 365 Apps #649

Closed in03 closed 7 months ago

in03 commented 7 months ago

What happened?


Get-EvergreenApp -Name "Microsoft365Apps"
WARNING: Invoke-EvergreenRestMethod: The remote server returned an error: (500) Internal Server Error., with: https://clients.config.office.net/releases/v1.0/OfficeReleases.
WARNING: Invoke-EvergreenRestMethod: For troubleshooting steps see: https://stealthpuppy.com/evergreen/troubleshoot/.
WARNING: Run 'Get-EvergreenApp -Name "Microsoft365Apps" -Verbose' to review additional details for troubleshooting.
Invoke-RestMethod : The remote server returned an error: (500) Internal Server Error.
At C:\Program Files\WindowsPowerShell\Modules\Evergreen\2403.889\Private\Invoke-EvergreenRestMethod.ps1:124 char:21
+         $Response = Invoke-RestMethod @params
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Looks like maybe there's something wrong with the API endpoint? Hitting clients.config.office.net/releases/v1.0/OfficeReleases in a web browser yields:

{
    "Error": {
        "Code": "Unknown",
        "Message": "Error converting value \"LTSB2024\" to type 'Microsoft.Office.Manageability.Providers.MRORelease.Data.Channel'. Path 'value[9].ServicingChannel', line 1, position 3356.",
        "Target": null,
        "InnerError": {
            "Code": "Newtonsoft.Json.JsonSerializationException",
            "Message": "Error converting value \"LTSB2024\" to type 'Microsoft.Office.Manageability.Providers.MRORelease.Data.Channel'. Path 'value[9].ServicingChannel', line 1, position 3356.",
            "Target": "ReadJson",
            "InnerError": {
                "Code": "System.ArgumentException",
                "Message": "Requested value 'LTSB2024' was not found.",
                "Target": "ParseEnum",
                "InnerError": null
            }
        }
    }
}

Version

2403.889

What PowerShell edition/s are you running Evergreen on?

Windows PowerShell

Which operating system/s are you running Evergreen on?

Windows 10+

Have you reviewed the documentation?

Verbose output

VERBOSE: Function path: C:\Program Files\WindowsPowerShell\Modules\Evergreen\2403.889\Apps\Get-Microsoft365Apps.ps1
VERBOSE: Function exists: C:\Program Files\WindowsPowerShell\Modules\Evergreen\2403.889\Apps\Get-Microsoft365Apps.ps1.
VERBOSE: Dot sourcing: C:\Program Files\WindowsPowerShell\Modules\Evergreen\2403.889\Apps\Get-Microsoft365Apps.ps1.
VERBOSE: Get-FunctionResource: read application resource strings from [C:\Program Files\WindowsPowerShell\Modules\Evergreen\2403.889\Manifests\Microsoft365Apps.json]
VERBOSE: Calling: Get-Microsoft365Apps.
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; Windows NT 10.0; en-AU) AppleWebKit/534.6 (KHTML, like Gecko) Chrome/7.0.500.0
Safari/534.6.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: Method: Default.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: Uri: https://clients.config.office.net/releases/v1.0/OfficeReleases.
VERBOSE: Invoke-EvergreenRestMethod: Invoke-RestMethod parameter: ContentType: application/json; charset=utf-8.
VERBOSE: GET https://clients.config.office.net/releases/v1.0/OfficeReleases with 0-byte payload
WARNING: Invoke-EvergreenRestMethod: The remote server returned an error: (500) Internal Server Error., with: https://clients.config.office.net/releases/v1.0/OfficeReleases.
WARNING: Invoke-EvergreenRestMethod: For troubleshooting steps see: https://stealthpuppy.com/evergreen/troubleshoot/.
WARNING: Run 'Get-EvergreenApp -Name "Microsoft365Apps" -Verbose' to review additional details for troubleshooting.
Invoke-RestMethod : The remote server returned an error: (500) Internal Server Error.
At C:\Program Files\WindowsPowerShell\Modules\Evergreen\2403.889\Private\Invoke-EvergreenRestMethod.ps1:124 char:21
+         $Response = Invoke-RestMethod @params
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
steveturnbull commented 7 months ago

Same issue here today, was OK yesterday.

aaronparker commented 7 months ago

Likely an issue at Microsoft's end.

There is another URL that might be able to be used if this one is not fixed: https://config.office.com/api/filelist/channels

steveturnbull commented 7 months ago

is it possible to add a change to the module to check for both urls so if one fails the other might work? I always install the latest evergreen module as part of a packer build so I only grab the version in psgallery.

But yeah looks like MS changed or broke something

aaronparker commented 7 months ago

That URL now has the same issue. Perhaps MS is in the process of creating an LTSB2024 release and updating the backends.

aaronparker commented 7 months ago

Using the Microsoft 365 Apps file list API

aaronparker commented 7 months ago

Microsoft has fixed the source API, so this is working now

aaronparker commented 7 months ago

Both API URLs ended up with the same issue, so there's not much value in writing the function to fall back to a different URL. I have updated Microsoft365Apps to dynamically determine channel names and removed from hard coded channel details from the manifest - this will ensure that when the LTSB2024 is release, Evergreen will return details for that channel without requiring an update. See #650

in03 commented 7 months ago

Very cool. Thanks Aaron!

On Sun, 7 Apr 2024, 2:17 pm Aaron Parker, @.***> wrote:

Both API URLs ended up with the same issue, so there's not much value in writing the function to fall back to a different URL. I have updated Microsoft365Apps to dynamically determine channel names and removed from hard coded channel details from the manifest - this will ensure that when the LTSB2024 is release, Evergreen will return details for that channel without requiring an update. See #650 https://github.com/aaronparker/evergreen/issues/650

— Reply to this email directly, view it on GitHub https://github.com/aaronparker/evergreen/issues/649#issuecomment-2041304250, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADFZAM2D53GYTNWA2DCBUKTY4DCGTAVCNFSM6AAAAABFYHGO2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGMYDIMRVGA . You are receiving this because you authored the thread.Message ID: @.***>

steveturnbull commented 7 months ago

thanks Aaron, we built it successfully yesterday with Office working again :) MS gremlins