title: Ingress-nginx - socket hang up, connResetException?
body: <p>My system: Ubuntu using microk8s kubectl</p>
  <p>I'm taking an online course and have run into an issue I can't find a solution to. I can't  access the following URL internally in my application</p>
  <p><a href="http://ingress-nginx-controller.ingress-nginx.svc.cluster.local" rel="nofollow noreferrer">http://ingress-nginx-controller.ingress-nginx.svc.cluster.local</a></p>
  <p>I get the following error in my web browser</p>
  <pre><code>&quot;page&quot;: &quot;/&quot;,
  &quot;query&quot;: {},
  &quot;buildId&quot;: &quot;development&quot;,
  &quot;isFallback&quot;: false,
  &quot;err&quot;: {&quot;name&quot;: &quot;Error&quot;,&quot;message&quot;: &quot;socket hang up&quot;,&quot;stack&quot;: &quot;Error: socket hang up at connResetException (internal/errors.js:613:14) at Socket.socketOnEnd (_http_client.js:493:23) at Socket.emit (events.js:326:22) at endReadableNT (_stream_readable.js:1226:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)&quot;},
  &quot;gip&quot;: true
  </code></pre>
  <p>and I get the following dump on node.</p>
  <pre><code>[client] Error: socket hang up
  [client]     at connResetException (internal/errors.js:613:14)
  [client]     at Socket.socketOnEnd (_http_client.js:493:23)
  [client]     at Socket.emit (events.js:326:22)
  [client]     at endReadableNT (_stream_readable.js:1226:12)
  [client]     at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  [client]   code: 'ECONNRESET',
  [client]   config: {
  [client]     url: 'http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/api/users/currentuser',
  [client]     method: 'get',
  [client]     headers: {
  [client]       Accept: 'application/json, text/plain, */*',
  [client]       Host: 'tickets.dev',
  [client]       'User-Agent': 'axios/0.19.2'
  [client]     },
  [client]     transformRequest: [ [Function: transformRequest] ],
  [client]     transformResponse: [ [Function: transformResponse] ],
  [client]     timeout: 0,
  [client]     adapter: [Function: httpAdapter],
  [client]     xsrfCookieName: 'XSRF-TOKEN',
  [client]     xsrfHeaderName: 'X-XSRF-TOKEN',
  [client]     maxContentLength: -1,
  [client]     validateStatus: [Function: validateStatus],
  [client]     data: undefined
  [client]   },
  [client]   request: &lt;ref *1&gt; Writable {
  [client]     _writableState: WritableState {
  [client]       objectMode: false,
  [client]       highWaterMark: 16384,
  [client]       finalCalled: false,
  [client]       needDrain: false,
  [client]       ending: false,
  [client]       ended: false,
  [client]       finished: false,
  [client]       destroyed: false,
  [client]       decodeStrings: true,
  [client]       defaultEncoding: 'utf8',
  [client]       length: 0,
  [client]       writing: false,
  [client]       corked: 0,
  [client]       sync: true,
  [client]       bufferProcessing: false,
  [client]       onwrite: [Function: bound onwrite],
  [client]       writecb: null,
  [client]       writelen: 0,
  [client]       afterWriteTickInfo: null,
  [client]       buffered: [],
  [client]       bufferedIndex: 0,
  [client]       allBuffers: true,
  [client]       allNoop: true,
  [client]       pendingcb: 0,
  [client]       prefinished: false,
  [client]       errorEmitted: false,
  [client]       emitClose: true,
  [client]       autoDestroy: true,
  [client]       errored: false,
  [client]       closed: false
  [client]     },
  [client]     _events: [Object: null prototype] {
  [client]       response: [Function: handleResponse],
  [client]       error: [Function: handleRequestError]
  [client]     },
  [client]     _eventsCount: 2,
  [client]     _maxListeners: undefined,
  [client]     _options: {
  [client]       protocol: 'http:',
  [client]       maxRedirects: 21,
  [client]       maxBodyLength: 10485760,
  [client]       path: '/api/users/currentuser',
  [client]       method: 'GET',
  [client]       headers: [Object],
  [client]       agent: undefined,
  [client]       agents: [Object],
  [client]       auth: undefined,
  [client]       hostname: 'ingress-nginx-controller.ingress-nginx.svc.cluster.local',
  [client]       port: null,
  [client]       nativeProtocols: [Object],
  [client]       pathname: '/api/users/currentuser'
  [client]     },
  [client]     _redirectCount: 0,
  [client]     _redirects: [],
  [client]     _requestBodyLength: 0,
  [client]     _requestBodyBuffers: [],
  [client]     _onNativeResponse: [Function (anonymous)],
  [client]     _currentRequest: ClientRequest {
  [client]       _events: [Object: null prototype],
  [client]       _eventsCount: 6,
  [client]       _maxListeners: undefined,
  [client]       outputData: [],
  [client]       outputSize: 0,
  [client]       writable: true,
  [client]       destroyed: false,
  [client]       _last: true,
  [client]       chunkedEncoding: false,
  [client]       shouldKeepAlive: false,
  [client]       useChunkedEncodingByDefault: false,
  [client]       sendDate: false,
  [client]       _removedConnection: false,
  [client]       _removedContLen: false,
  [client]       _removedTE: false,
  [client]       _contentLength: 0,
  [client]       _hasBody: true,
  [client]       _trailer: '',
  [client]       finished: true,
  [client]       _headerSent: true,
  [client]       socket: [Socket],
  [client]       _header: 'GET /api/users/currentuser HTTP/1.1\r\n' +
  [client]         'Accept: application/json, text/plain, */*\r\n' +
  [client]         'Host: tickets.dev\r\n' +
  [client]         'User-Agent: axios/0.19.2\r\n' +
  [client]         'Connection: close\r\n' +
  [client]         '\r\n',
  [client]       _onPendingData: [Function: noopPendingOutput],
  [client]       agent: [Agent],
  [client]       socketPath: undefined,
  [client]       method: 'GET',
  [client]       maxHeaderSize: undefined,
  [client]       insecureHTTPParser: undefined,
  [client]       path: '/api/users/currentuser',
  [client]       _ended: false,
  [client]       res: null,
  [client]       aborted: false,
  [client]       timeoutCb: null,
  [client]       upgradeOrConnect: false,
  [client]       parser: null,
  [client]       maxHeadersCount: null,
  [client]       reusedSocket: false,
  [client]       host: 'ingress-nginx-controller.ingress-nginx.svc.cluster.local',
  [client]       protocol: 'http:',
  [client]       _redirectable: [Circular *1],
  [client]       [Symbol(kCapture)]: false,
  [client]       [Symbol(kNeedDrain)]: false,
  [client]       [Symbol(corked)]: 0,
  [client]       [Symbol(kOutHeaders)]: [Object: null prototype]
  [client]     },
  [client]     _currentUrl: 'http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/api/users/currentuser',
  [client]     [Symbol(kCapture)]: false
  [client]   },
  [client]   response: undefined,
  [client]   isAxiosError: true,
  [client]   toJSON: [Function (anonymous)]
  [client] }
  </code></pre>
  <p>my ingress-nginx service</p>
  <pre><code>NAME                                 TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
  ingress-nginx-controller             LoadBalancer   10.152.183.138   &lt;pending&gt;     80:32160/TCP,443:30735/TCP   32d
  ingress-nginx-controller-admission   ClusterIP      10.152.183.198   &lt;none&gt;        443/TCP                      32d
  </code></pre>
  <p>Project source code</p>
  <p><a href="https://gitlab.com/emendoza1986/ticketingapp_microservicecourse" rel="nofollow noreferrer">https://gitlab.com/emendoza1986/ticketingapp_microservicecourse</a></p>
  <p>Here is the source page <a href="https://gitlab.com/emendoza1986/ticketingapp_microservicecourse/-/blob/master/client/api/build-client.js" rel="nofollow noreferrer">https://gitlab.com/emendoza1986/ticketingapp_microservicecourse/-/blob/master/client/api/build-client.js</a> that called the link <a href="http://ingress-nginx-controller.ingress-nginx.svc.cluster.local" rel="nofollow noreferrer">http://ingress-nginx-controller.ingress-nginx.svc.cluster.local</a>, as a temporary* patch, I'm routing directly to the service I needed http://auth-srv:3000 to continue the course.</p>