# Reverse Proxy test failure w/o IPv6

**URL:** <https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502>\
**Category:** Get Help\
**Tags:** ondemand2\
**Created:** [May 25, 2021, 10:55pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502 "2021-05-25T22:55:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blixuga](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/blixuga/32/716_2.png) [@blixuga](https://discourse.openondemand.org/u/blixuga)\
**Post date:** [May 25, 2021, 10:55pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502/1 "2021-05-25T22:55:35Z")

</div>

FYI: Testing the reverse proxy configuration with netcat fails if you have IPv6 disabled.

On our cluster all our nodes explicitly have IPv6 disabled. When trying to test the reverse proxy setup for OOD, we get this type of failure:

```
[user@node ~]$ nc -l 5432
close: Bad file descriptor

```

This is due to netcat attempting to close a non-existent IPv6 listening socket. The work around is to issue the command with the “-4” parameter to force nc to only open an IPv4 listening socket.

Here’s the RHN reference info: [netcat returning "Bad file descriptor error" after a connection is made - Red Hat Customer Portal](https://access.redhat.com/solutions/4851211)

---

<div class="post-metadata">

**Author:** ![blixuga](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/blixuga/32/716_2.png) [@blixuga](https://discourse.openondemand.org/u/blixuga)\
**Post date:** [May 26, 2021, 6:17pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502/2 "2021-05-26T18:17:58Z")

</div>

I guess I forgot to actually ask my question on my original post…

Is netcat only used for this test in OOD, or is it used somewhere this will cause me a problem with down the road?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 26, 2021, 6:40pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502/3 "2021-05-26T18:40:27Z")

</div>

Hi and welcome. And sorry for the delay.

So in the batch connect jobs, we launch the app, and use netcat to verify the port is open through the `wait_until_port_used` function.

Here’s the nc command we’re trying to run for reference.

> <https://github.com/OSC/ood_core/blob/c20cbeb4fbada12ca31e6bd9347de95312a2dda8/lib/ood_core/batch_connect/template.rb#L128-L130>

`$1` is the host we passed in. Maybe if it was an ip (a version 4 ip) it would work. Where are you using `wait_until_port_used` function?

Instead of passing in `${host}` you can try `$(hostname -i | awk '{print $2}')` or even just `127.0.0.1` if you’re sure it’ll be local to the node. Here’s where we use it in our jupyter app for reference.

> <https://github.com/OSC/bc_osc_jupyter/blob/111437f7f1bce4c64487ceccc183114b9a4575d5/template/after.sh.erb#L3>

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [May 26, 2021, 6:42pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502/4 "2021-05-26T18:42:27Z")

</div>

Oh sorry, I’m sorry, are you saying your having an issue with an actual app or with some trival test to make sure things are setup right?

It _could_ cause issues as I’ve indicated above. But as you can see the nc command there, you may try running it on a compute node and see if it errors with the same complaint as listen does.

---

<div class="post-metadata">

**Author:** ![blixuga](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/blixuga/32/716_2.png) [@blixuga](https://discourse.openondemand.org/u/blixuga)\
**Post date:** [May 26, 2021, 7:05pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502/5 "2021-05-26T19:05:47Z")

</div>

Jeff,

Thanks for the update, we are still in the process of setting up the interactive app portion, so nothing breaking yet, just the test.

If I am understanding correctly, OOD will be using ‘nc’ to call the node for connectivity verification vs. ‘nc -l’ being launched as a listener on the node. (Like the example for **testing** reverse proxy shows.)

If that’s correct, then I doubt there will be an issue. From what I can find, this is only an error that happens with netcat is started as a listener and tries to clean up a socket that was never started. (e.g. the IPv6 socket)

---

<div class="post-metadata">

**Author:** ![blixuga](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/blixuga/32/716_2.png) [@blixuga](https://discourse.openondemand.org/u/blixuga)\
**Post date:** [May 26, 2021, 7:09pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502/6 "2021-05-26T19:09:05Z")

</div>

Side note, yes if I run the reverse proxy test as `nc -l <ip> <port>` instead of leaving the ip/host off it correctly returns as the document shows.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [May 17, 2022, 6:43pm UTC](https://discourse.openondemand.org/t/reverse-proxy-test-failure-w-o-ipv6/1502/7 "2022-05-17T18:43:20Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
