joel74 / POSH-LTM-Rest

PowerShell module and scripts for working with F5's LTM REST API
MIT License
78 stars 49 forks source link

New-F5Session Breaks on version 15.1.4 #213

Closed purduerich closed 3 years ago

purduerich commented 3 years ago

Hey team. I've been using this Powershell module for years and it's been working great. Recently I applied the v15.1.4 patch to one of our non-prod load balancers. The following morning our automated tests which utilize this module started getting the error below.

Invoke-F5RestMethod : "401 F5 Authorization Required: Authorization failed: no user authentication header or token detected. Uri:http://localhost:8100/mgmt/tm/sys/version/ Referrer:xxx.xxx.xxx.xxx Sender:xxx.xxx.xxx.xxx
At C:\Program Files\WindowsPowerShell\Modules\F5-LTM\1.4.308\Public\New-F5Session.ps1:98 char:13
+     $JSON = Invoke-F5RestMethod -Method Get -Uri $VersionURL -F5Sessi ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-F5RestMethod

I double checked my service account and access and all of that was working fine in the admin UI. However it seems like this call started failing. If you look at my screenshot below you'll see 2 calls being made. The top one is connecting to a load balancer on v15.1.3.1, which is successful. The second one is connecting to a load balancer on v15.1.4 which is unsuccessful.

image

I wonder if F5 introduced changes in iControl that changed its behavior. I'm reporting this as a possible bug.

joel74 commented 3 years ago

Thanks. It might be good to also open a topic on this issue in Devcentral.f5.com and see if anyone else has run into this there. Cheers.

purduerich commented 3 years ago

Not sure if it helps but it seems like this loginProviderName=tmos' in New-F5Session.ps1 is the culprit. When I remove it I'm able to make a successful connection to both the new and old version of BIG-IP. I wonder if this module should be updated to remove this.

image

purduerich commented 3 years ago

This ended up not being a problem. If anyone reading this in the future has the same issue, simply run the command bigstart restart restjavad to restart the service. That ended up fixing it for me.

joel74 commented 3 years ago

Thanks for providing the details, purduerich.