# CAS integration: (was 401 Unauthorized) now is: Index of /

**URL:** <https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789>\
**Category:** Get Help\
**Tags:** question\
**Created:** [October 4, 2024, 8:59pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789 "2024-10-04T20:59:47Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 7, 2024, 7:11pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/21 "2024-10-07T19:11:56Z")

</div>

> [@jeff.ohrstrom](#):
>
> Surprised that Slurm can’t just make that directory, but is `~/test_jobs` an actual directory?

On the server where OOD is installed yes this exists:

```auto
ls -l /home/mysuser/test_jobs/
total 0
[myuser@openondemand ~]$ ls -ld /home/myuser/test_jobs/
drwxr-xr-x 2 rk3199 domain users 6 Oct 7 11:18 /home/myuser/test_jobs/

```

Now that I switched to the production server I had to create that directory.

So there must be some confusion between where OOD is installed and the actual cluster login/submit node.

I get this error:

```auto
Job has status of completed

Output file from job does not exist: 

/home/myuser/test_jobs/output_ourcluster_2024_10_07t15_06_54_04_00_log
Test for 'ourcluster' FAILED!
Finished testing cluster 'ourcluster'

```

However the log file on production exists:  
`/home/myuser/test_jobs/output_ourcluster_2024_10_07t15_06_54_04_00_log`

And its contents:  
`TEST A B C`

Is there a misconfiguration?

---

<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:** [October 7, 2024, 7:32pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/22 "2024-10-07T19:32:32Z")

</div>

> [@SomePersonSomeWhereI](#):
>
> Is there a misconfiguration?

The web node needs the same $HOME mount point that the cluster has. OnDemand uses the files in your $HOME to prep the job (on the web node side) and to react from the job.

For example the job has to write what host it’s on when the job is running. It writes this to a file in your $HOME that OnDemand (on the web node) reads so it knows where to proxy request to.

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 7, 2024, 8:09pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/23 "2024-10-07T20:09:04Z")

</div>

> [@jeff.ohrstrom](#):
>
> The web node needs the same $HOME mount point that the cluster has. OnDemand uses the files in your $HOME to prep the job (on the web node side) and to react from the job.

Got it ok I mounted /`home`. What would cause this error?

`The cluster config for ourcluster has a problem: (<unknown>): did not find expected key while parsing a block mapping at line 2 column 1`

Edit: now it’s:  
`The cluster config for **ourcluster** has a problem: (<unknown>): did not find expected key while parsing a block mapping at line 8 column 6`

```auto
 1 ---
 2 v2:
 3 metadata:
 4	title: "Ourcluster"
 5 login:
 6	host: "ourcluster.ouruni.edu"
 7 job:
 8	adapter: "slurm"
 9	submit_host: "ourcluster.ouruni.edu"
10	ssh_hosts:
11 - ourcluster.ouruni.edu
12	cluster: Ourcluster

```

Is there an indentation problem?

---

<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:** [October 7, 2024, 8:27pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/24 "2024-10-07T20:27:40Z")

</div>

> [@SomePersonSomeWhereI](#):
>
> Is there an indentation problem?

Yes, it should have this format. I pull this directly from the documentation.

```yaml
---
v2:
   metadata:
     title: "My Cluster"
   login:
     host: "my_cluster.my_center.edu"
   job:
     adapter: "slurm"
     cluster: "Ourcluster"
     conf: "/path/to/slurm.conf"
     submit_hosts:
       - ourcluster.ouruni.edu

```

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 8, 2024, 1:51pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/25 "2024-10-08T13:51:24Z")

</div>

I used a [JSON tester](https://www.yamllint.com/) and it validated what could be causing the error?

`The cluster config for **ourcluster** has a problem: (<unknown>): did not find expected key while parsing a block mapping at line 8 column 6`

```auto
---
v2:
   metadata:
     title: "Axon"
   login:
     host: "ourcluster.ouruni.edu"
   job:
     cluster: "Ourcluster"
     adapter: "slurm"
     conf: "/etc/slurm/slurm.conf"
     submit_hosts:
       - ourcluster.ouruni.edu
     bin: "/sbin" 
     bin_overrides:
       sbatch: "/usr/bin/sbatch"
       squeue: "/usr/bin/squeue"
       scontrol: "/usr/bin/scontrol"
       scancel: "/usr/bin/scancel"
     strict_host_checking: false
     copy_environment: false

```

Line 8 is the `cluster: "Ourcluster"` line

---

<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:** [October 8, 2024, 1:55pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/26 "2024-10-08T13:55:25Z")

</div>

Maybe you need to restart your webserver (in the help menu) to pick up the new/valid configs?

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 8, 2024, 1:59pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/27 "2024-10-08T13:59:55Z")

</div>

Indeed that got me past the error. I thought `systemctl restart httpd` would take care of that.

How can I troubleshoot why Jobs are not displaying, `No data available in table`?

```auto
sudo su myuser -c 'scl enable ondemand -- bin/rake test:jobs:ourcluster RAILS_ENV=production'
Testing cluster 'ourcluster'...
Submitting job...
rake aborted!
Errno::ENOENT: No such file or directory - /usr/bin/sbatch

```

It’s not seeing `sbatch` on the login/submit node?

---

<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:** [October 8, 2024, 2:05pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/28 "2024-10-08T14:05:10Z")

</div>

You can see in the `/var/log/ondemand-nginx/$USER/error.log` exact commands we issue (grep for `execve` or `squeue` or similar).

You can issue these same commands to replicate. Also note that in activejobs you may have some filter turned on like only show my jobs or only show my jobs on cluster X in which case you don’t actually have any jobs running.

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 8, 2024, 2:08pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/29 "2024-10-08T14:08:01Z")

</div>

OK why is it not finding these commands on the actual submit node?

`App 829031 output: [2024-10-08 10:05:58 -0400] WARN "Error opening MOTD at \nException: bad URI(is not URI?): nil"`

`App 829031 output: [2024-10-08 10:06:10 -0400] ERROR "Errno::ENOENT: No such file or directory - /usr/bin/squeue\n/usr/share/ruby/open3.rb:222:in spawn'\n/usr/share/ruby/open3.rb:222:in popen_run'\n/usr/share/ruby/open3.rb:103:in popen3'\n/usr/share/ruby/open3.rb:290:in`

edit: now seeing this error

```auto
Testing cluster 'ourcluster'...
Submitting job...
rake aborted!
OodCore::JobAdapterError: hostname contains invalid characters

```

What characters are invalid?

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 8, 2024, 2:14pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/30 "2024-10-08T14:14:47Z")

</div>

> [@jeff.ohrstrom](#):
>
> Yes, it should have this format. I pull this directly from the documentation.
> 
> ```auto
> ---
> v2:
> metadata:
> title: "My Cluster"
> login:
> host: "my_cluster.my_center.edu"
> job:
> adapter: "slurm"
> cluster: "Ourcluster"
> conf: "/path/to/slurm.conf"
> submit_hosts:
> - ourcluster.ouruni.edu
> 
> ```

According to the [docs here](https://osc.github.io/ood-documentation/latest/installation/resource-manager/slurm.html), the option is `submit_host`, but your example has `submit_hosts` which is correct?

---

<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:** [October 8, 2024, 2:27pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/31 "2024-10-08T14:27:40Z")

</div>

Sorry, docs are always right. I copied it and started to restructure it to look more like yours.

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 8, 2024, 2:35pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/32 "2024-10-08T14:35:16Z")

</div>

Progress!

```auto
Got job id '3764893'
Job has status of queued
Job has status of completed
Test for 'ourcluster' PASSED!
Finished testing cluster 'ourcluster'

```

For this to work however I had to create a SSH key, i.e.,g `ssh-keygen` then `ssh-copy-id -i ~/.ssh...`  
Otherwise I get this error:

```auto
OodCore::JobAdapterError: Warning: Permanently added 'ourcluster.ouruni.edu' (ED25519) to the list of known hosts.
myuser@ourcluster.ouruni.edu: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

```

Is there a better way to handle so we don’t have to tell all users to do the same?

---

<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:** [October 8, 2024, 2:38pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/33 "2024-10-08T14:38:13Z")

</div>

> [@SomePersonSomeWhereI](#):
>
> Is there a better way to handle so we don’t have to tell all users to do the same?

Yes, sshd supports HostBasedAuthentication in which the servers themselves have key pairs not any given user.

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 8, 2024, 7:05pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/34 "2024-10-08T19:05:12Z")

</div>

> [@jeff.ohrstrom](#):
>
> Yes, sshd supports HostBasedAuthentication in which the servers themselves have key pairs not any given user

So something like [this](https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Host-based_Authentication). I’d be curious to see how others have done this so I’ll search around. We do use sssd but I’m not sure there’s a way to use that for this?

Edit I see a [thread about using munge](https://discourse.openondemand.org/t/slurm-cluster-configuration-test/2734/7) is this still an option? Or [this wrapper](https://discourse.openondemand.org/t/ondemand-with-slurm-based-sytems-sbatch/581/10) for version 1.5?

---

<div class="post-metadata">

**Author:** ![SomePersonSomeWhereI](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/somepersonsomewherei/32/2147_2.png) [@SomePersonSomeWhereI](https://discourse.openondemand.org/u/SomePersonSomeWhereI)\
**Post date:** [October 9, 2024, 1:06pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/35 "2024-10-09T13:06:57Z")

</div>

[jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom) do you know if [this wrapper](https://discourse.openondemand.org/t/ondemand-with-slurm-based-sytems-sbatch/581/10) will still work in OOD 3.1?

---

<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:** [October 9, 2024, 1:13pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/36 "2024-10-09T13:13:12Z")

</div>

Yes that `copy_environment` and `job_envorionment` work. At OSC we have slurm binaries on the webnode itself. But we also use HostBasedAuthentication so folks can ssh here and there easily.

---

<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:** [April 7, 2025, 1:13pm UTC](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789/37 "2025-04-07T13:13:28Z")

</div>

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

[Previous page](https://discourse.openondemand.org/t/cas-integration-was-401-unauthorized-now-is-index-of/3789.md?page=1)
