# Proxy Error when starting linux\_host interactive applications

**URL:** <https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371>\
**Category:** Get Help\
**Created:** [March 21, 2024, 1:42pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371 "2024-03-21T13:42:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dredwilliams](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/dredwilliams/32/964_2.png) [@dredwilliams](https://discourse.openondemand.org/u/dredwilliams)\
**Post date:** [March 21, 2024, 1:42pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/1 "2024-03-21T13:42:58Z")

</div>

We are trying to set up an interactive desktop on the OOD host node using the linux\_host adaptor. After some fits and restarts, we have the desktop up and running, but have one annoyance that we cannot figure out how to resolve.

We created a new (hidden) cluster using the linux\_host adaptor type, specifying the hostnames as needed and provided the singularity parameters to launch a known good container. The ‘batch\_connect’ section of the cluster definition matches what we have in other clusters to run the same container as a job on a compute node.

We created a new type of bc\_desktop (called Login Node Desktop) that references the linux\_host cluster definition and specifies the “vnc” template for batch\_connect – and that’s it.

When selected, the appropriate page is shown to allow parameter changes (not that we have any yet, but …). When we hit the ‘Launch’ button, the session is started properly, but we are redirected to a bad URL that gives us a proxy error:

[https://xx.xx.xx/pun/sys/dashboard/batch\_connect/sys/bc\_desktop/Login\_Node\_Desktop/session\_contexts](https://xx.xx.xx/pun/sys/dashboard/batch_connect/sys/bc_desktop/Login_Node_Desktop/session_contexts)

When I launch other (compute node) desktops, it sends me to the interactive sessions page:

[https://xx.xx.xx/pun/sys/dashboard/batch\_connect/sessions](https://xx.xx.xx/pun/sys/dashboard/batch_connect/sessions)

If I go to that page manually, the linux\_host desktop session is shown and I can launch the vnc session by hitting the button there. The desktop session itself is fully functional.

**My question is why the linux\_host session does not directly send me to the interactive sessions page?**

I’ve tried to follow the code, and ended up in the `session_contexts_controller.rb` file; but I’m not fluent enough with ruby to understand what is happening there and (if it is where the problem exists) what is causing the incorrect behavior. I’m suspicious that the session structure is missing some element that is present in the normal desktop sessions, but I don’t know what that might be.

Thanks!

Ed

---

<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:** [March 22, 2024, 3:41pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/2 "2024-03-22T15:41:52Z")

</div>

> [@dredwilliams](#):
>
> When selected, the appropriate page is shown to allow parameter changes (not that we have any yet, but …). When we hit the ‘Launch’ button, the session is started properly, but we are redirected to a bad URL that gives us a proxy error:
> 
> [https://xx.xx.xx/pun/sys/dashboard/batch\_connect/sys/bc\_desktop/Login\_Node\_Desktop/session\_contexts](https://xx.xx.xx/pun/sys/dashboard/batch_connect/sys/bc_desktop/Login_Node_Desktop/session_contexts)

Can you screen shot this error page and show us what’s being displayed? Also any errors `/var/log/ondemand-nginx/$USER/error.log` would be helpful.

I suspect there’s some sort of bug here where you’re able to launch and view the session, but something wonky is happening after you launch - because obviously the session launched.

I suspect it’s because it’s a hidden cluster. I’m guessing somehow that’s throwing all of this off. Like at one point the system accepts that it’s hidden and launches the job but at another it doesn’t like the fact that it’s hidden and fails for some for some reason.

---

<div class="post-metadata">

**Author:** ![dredwilliams](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/dredwilliams/32/964_2.png) [@dredwilliams](https://discourse.openondemand.org/u/dredwilliams)\
**Post date:** [March 26, 2024, 7:44pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/3 "2024-03-26T19:44:22Z")

</div>

It is the standard ‘Proxy Error’ screen that comes up periodically when the system is loaded and the NGINX server doesn’t respond fast enough …

```auto
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: Error reading from remote server

```

There is only the message in the error\_log that references the incorrect destination:

```auto
 INFO "method=POST path=/pun/sys/dashboard/batch_connect/sys/bc_desktop/Login_Node_Desktop/session_contexts format=html controller=BatchConnect::SessionContextsController action=create status=302 duration=10848.46 view=0.00 location=https://xx.xx.xx/pun/sys/dashboard/batch_connect/sessions"

```

Yes, the session launches and everything works as expected … hopefully this is a simple fix 🙂

---

<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:** [March 27, 2024, 1:51pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/4 "2024-03-27T13:51:16Z")

</div>

> [@dredwilliams](#):
>
> There is only the message in the error\_log that references the incorrect destination:

That log line is a 302 to the sessions index which seems to be correct.

> [@dredwilliams](#):
>
> [https://xx.xx.xx/pun/sys/dashboard/batch\_connect/sys/bc\_desktop/Login\_Node\_Desktop/session\_contexts](https://xx.xx.xx/pun/sys/dashboard/batch_connect/sys/bc_desktop/Login_Node_Desktop/session_contexts)

You’ll get redirected to a URL like this if the job fails to launch. Let’s say Slurm doesn’t like the account that you use to submit the job - just for example - you’d be redirected back to this page so that you can resbumit the form.

Now I know you say the job submitted successfully - but i still feel like the system doesn’t recognize that. Is there really nothing else in `/var/log/ondemand-nginx/$USER/error.log`? I find that very odd because an error like `invalid response from an upstream server.` isn’t a timing thing like nginx/the dashboard took too long (the error would be about timeouts) - this error is related more to corrupt data. Like nginx/the dashboard disconnected in the middle of the sending the response or only send part of the response and apache expected more to be sent.

---

<div class="post-metadata">

**Author:** ![dredwilliams](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/dredwilliams/32/964_2.png) [@dredwilliams](https://discourse.openondemand.org/u/dredwilliams)\
**Post date:** [April 12, 2024, 3:41pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/5 "2024-04-12T15:41:13Z")

</div>

> Now I know you say the job submitted successfully - but i still feel like the system doesn’t recognize that.

Agreed – that is what is supposed to be happening in `session_contexts_controller.rb`, but something isn’t detecting the active session. I can’t tell what it is looking for to make that determination … but I think that if it didn’t find it, it would put me back in the page where I started the session – like what happens when a job doesn’t launch (for compute node interactive sessions).

> Is there really nothing else in `/var/log/ondemand-nginx/$USER/error.log` ?

There is the line that launches the desktop with the ssh command and the ‘POST’ message like I quoted above. Nothing else. Is there some debug setting I can use to increase the verbosity?

---

<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:** [April 12, 2024, 4:05pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/6 "2024-04-12T16:05:09Z")

</div>

My guess is that there’s some bug in the linux\_host adapter while trying to read the ssh output. I’ve found that adapter to be very hard to debug - especially on a system where I can’t replicate the behavior.

Invalid responses seem to indicate that the app crashed entirely while writing the response. So it seems to me that there should be more in the logs there. Yes you get the 302 redirect, but what happens after that? I mean what’s the log line after that indicate?

---

<div class="post-metadata">

**Author:** ![dredwilliams](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/dredwilliams/32/964_2.png) [@dredwilliams](https://discourse.openondemand.org/u/dredwilliams)\
**Post date:** [April 12, 2024, 4:10pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/7 "2024-04-12T16:10:20Z")

</div>

There is nothing after that … not related to that action anyway … subsequent actions on the UI generate their entries, and I get the ‘Checking whether to disconnect long-running connections …’ message that came (in the most recent case) 5 minutes after the POST message.

---

<div class="post-metadata">

**Author:** ![dredwilliams](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/dredwilliams/32/964_2.png) [@dredwilliams](https://discourse.openondemand.org/u/dredwilliams)\
**Post date:** [April 12, 2024, 4:12pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/8 "2024-04-12T16:12:45Z")

</div>

I will say that once I’m back on the “my interactive sessions” page, the session is correctly identified as active, and when I shut down the desktop, it correctly identifies when that has happened and marks the session as completed. It’s just that it doesn’t recognize the session during the launch process.

---

<div class="post-metadata">

**Author:** ![dredwilliams](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/dredwilliams/32/964_2.png) [@dredwilliams](https://discourse.openondemand.org/u/dredwilliams)\
**Post date:** [September 5, 2024, 5:49pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/9 "2024-09-05T17:49:08Z")

</div>

Just to put a bow on this … now that we have upgraded to v3.1, the problem has disappeared, this can be closed.

---

<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:** [March 4, 2025, 5:49pm UTC](https://discourse.openondemand.org/t/proxy-error-when-starting-linux-host-interactive-applications/3371/10 "2025-03-04T17:49:27Z")

</div>

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