none
REST API issue

    Question

  • The following logic fails. Restarting the HPCWebService service on HN works the first time. I am on 2016 Update 1 with latest

    fixes. First call to the REST API works okay, but subsequent ones just hang/time out.

    This is very similar to another issue posted on this forum few months ago here :


    ServicePointManager.ServerCertificateValidationCallback =
                delegate (object s, X509Certificate certificate, X509Chain chain,
                SslPolicyErrors sslPolicyErrors) { return true; };
                //ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(DisableTrustChainEnforecment);
                HttpClient httpClient = new HttpClient(new HttpClientHandler()
                { UseDefaultCredentials = true });
                httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                httpClient.DefaultRequestHeaders.Add("api-version", "2016-11-01.5.0");
                string BaseUrl = "https://HNODE";
                var response = await httpClient.GetAsync(BaseUrl + "/hpc/nodes/groups/AzureIaasNodes");
                //DataContractSerializer serializer = new DataContractSerializer(typeof(RestStoreProp[]));
                if (response.IsSuccessStatusCode)
                {
                    var stream = response.Content.ReadAsStringAsync();
                    //var stream = response.Content.ReadAsStreamAsync().Result;
                    //var objects = serializer.ReadObject(stream);
                }

    Friday, 28 September 2018 6:16 PM

All replies

  • Hi Sriram,

    I'm looking into your problem, and find it very hard to reproduce.  Could you try to restart the head node and see if the problem is still there?

    And, could you provide more information about your environment, like:

    1) Where is the head installed? On premise or in Azure. 

    2) If it's in Azure:

        2.1) Is it installed by an official HPC Pack 2016 Update1 template(https://github.com/MsHpcPack/HPCPack2016/tree/update1)?

        2.2) Did you change the head node's network's security group settings after the installation?

    3) Did you enable the HPC Pack Web Component, as said by https://docs.microsoft.com/en-us/powershell/high-performance-computing/install-the-microsoft-hpc-pack-web-components?view=hpc16-ps ? (You don't have to enable it to use the HPC REST service)


    • Edited by RobertZhang Sunday, 30 September 2018 10:29 AM revision
    Sunday, 30 September 2018 10:28 AM
  • 1) HN is on-premise

    2) yes, HPC pack web component is enabled.

    Here is what I now see as response:

    {StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:{  Connection: close  Date: Tue, 02 Oct 2018 20:38:13 GMT  Server: Microsoft-HTTPAPI/2.0  Content-Length: 346  Content-Type: text/html; charset=us-ascii}}

    {Connection: close
    Date: Tue, 02 Oct 2018 20:38:13 GMT
    Server: Microsoft-HTTPAPI/2.0
    }

    {Method: GET, RequestUri: 'https://HeadNode/hpc/jobs', Version: 1.1, Content: <null>, Headers:{  Accept: application/json  api-version: 2016-11-01.5.0}}

    Tuesday, 2 October 2018 8:41 PM
  • Hi SRIRAM,

    If restarting head node host doesn't resolve your problem, I suggest you disable the web component and then restart host and then see if the REST service is still in problem.

    The HPC Pack web component is just  a simple web portal, and the REST service doesn't rely on it. If you don't need the web portal, you can disable it.

    BTW, I'm on a vacation so I may not reply to you timely. And I need to do more investigation on your case when I'm back to office.

    Thanks,

    Robert

    Saturday, 6 October 2018 1:34 PM