akamai / PowerShell

Apache License 2.0
3 stars 2 forks source link

Get-EdnsZoneTransferStatus 417 issue #3

Open JG237 opened 6 days ago

JG237 commented 6 days ago

Hi, When I first connect to Akamai I can not run the Get-EdnsZoneTransferStatus for about 10 minutes every other command works

status 417 Expect 100-contiune header is not supported

image

michal-krobicki-akamai commented 2 days ago

Hi @JG237 ,

Please describe your use case in more detail. I am especially curious about the 10 minutes. It is 10 minutes after what event? If you are running this in a script then please share your code if possible.

The function seems to work as expected in general. image

JG237 commented 2 days ago

Hi @michal-krobicki-akamai

I can connect to Akamai and run any of the get-Edns* command and I get results fine It is only the Get-EdnsZoneTransferStatus that has this error. After "5-10" minutes it just starts working with no issues. I don't change anything. Then works until I close the PS session

What is the @testParams you are using

Here is a cutdown version of the script I am running. New-AkamaiSession -ClientSecret $clientsec -HostName $myhost -ClientAccessToken $myaccesstoken -ClientToken $myclienttoken $akamaiDNSSec = Get-EdnsZone | where {$.type -match "secondary"} Foreach ($DNSAkaSec in $akamaiDNS_Sec) { $transferinfo = Get-EdnsZoneTransferStatus -Zones $($DNSAkaSec.zone) $tranmstip = $transferinfo.masters.masterip $AkaSOASer = $transferinfo.metadata.lastSuccessSerial write-host "$($DNSAkaSec.zone) - $AkaSOASer" }

michal-krobicki-akamai commented 2 days ago

Hi @JG237,

    # Add additional headers if POSTing or PUTing
    If ($Body) {
        # turn off the "Expect: 100 Continue" header
        # as it's not supported on the Akamai side.
        [System.Net.ServicePointManager]::Expect100Continue = $false
    }

Can you think of any reason how such header may be added to your request? Is there a proxy that modifies your requests and adds it? What is the PowerShell version you are using to run your code? Can you test the script from a different machine / network?

JG237 commented 20 hours ago

For me it is very strange as it only occurs for the first 5-10 minutes of the session the rest of the day it is 100% fine. Access should not change Also PS command don't change. I tested on 3 machines and get the same result.

PSVersion 5.1.20348.2400