# Cluster specific modules don't populate in form.yml.erb

**URL:** <https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287>\
**Category:** Get Help\
**Tags:** question\
**Created:** [February 23, 2024, 10:11pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287 "2024-02-23T22:11:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 23, 2024, 10:11pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/1 "2024-02-23T22:11:11Z")

</div>

Hello,

I’m creating a form for users to submit job to the cluster. One of the field is version and I want to auto populate it with the every single version available of that software installed on cluster. I’m using auto\_modules attributes. and using these docs:

[https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/form.html#automatic-predefined-attributes](https://osc.github.io/ood-documentation/latest/how-tos/app-development/interactive/form.html#automatic-predefined-attributes)

and

[https://osc.github.io/ood-documentation/latest/reference/files/ondemand-d-ymls.html#module-file-dir](https://osc.github.io/ood-documentation/latest/reference/files/ondemand-d-ymls.html#module-file-dir)

I created json file:

/usr/share/lmod/lmod/libexec/spider -o spider-json $MODULEPATH \> /etc/reporting/modules/viking.json

And referenced it in cluster config file:  
grep module\_file /etc/ood/config/clusters.d/viking.yml

> module\_file\_dir: “/etc/reporting/modules”

My form.yml.erb looks like this:

> Version:  
> widget: ‘select’  
> attributes:  
> auto\_modules\_ansys:  
> default: true

However it doesn’t populate in the browser. I see empty drop down menu.

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 26, 2024, 2:27pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/2 "2024-02-26T14:27:16Z")

</div>

I don’t see

```auto
form:
  - auto_modules_ansys

```

In your `form.yml` file - when I copy your `form.yml` file, not even a select box shows up (I’m not sure if I’m getting the indentation right). But if I add the above bit of code, the version list shows up and populates.

I see that the docs aren’t clear that this is a required line - I’ll get this updated this morning.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 26, 2024, 5:27pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/3 "2024-02-26T17:27:15Z")

</div>

This is my full form.html.erb code:

* * *

> cluster: “viking”

> form:
> 
> - Solver
> - Version
> - License
> - Nodes
> - bc\_queue
> - bc\_num\_slots
> - bc\_num\_hours
> - bc\_email\_on\_started
> - Select File
> 
> Solver:  
> widget: ‘select’  
> options:  
> - [“Ansys”]  
> - [“CFX”]  
> - [“Fluent”]  
> - [“Star-CCM+”]  
> Version:  
> widget: ‘select’  
> attributes:  
> auto\_modules\_ansys:  
> default: true  
> Select File:  
> widget: “path\_selector”  
> directory: “/fs/cluster/data”  
> show\_hidden: true

And It’s what I see when I look at the web page. The select box is there but it’s empty:

 ![Screenshot from 2024-02-26 09-26-55](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/e/eb168d6c2eda992d58d1747bb105c46014e8406d.png)

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 26, 2024, 5:43pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/4 "2024-02-26T17:43:11Z")

</div>

So I’ll show this as an example of how the main components `form` and `attributes` work. `form` is a list of form choices for the application. `attributes` is then specifying what those items in form are, whether they’re number fields or choices and so on. `auto_modules_*` is a form choice that replaces the old `Version’ widget.

Replace

```auto
form:
  ...
  - Version
  ...

```

with

```auto
form:
 ...
  - auto_modules_ansys
 ...

```

You should also remove:

```auto
Version:
  widget: 'select'
  attributes:
    auto_modules_ansys:
      default: true

```

If you were going to change `default` to false, you would add the `auto_modules_ansys` attribute to the attributes list like this:

```auto
attributes:
  auto_modules_ansys:
    default: false

```

However, the default version is included in the version list by default, so there’s no need to explicitly specify `default: true`.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 26, 2024, 7:07pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/5 "2024-02-26T19:07:27Z")

</div>

Thank you for the answer. It does look a little better now. I see the default in drop down menu but no other versions.

An another question I will need different modules there depending on Solver field choice. Is it possible on this level to make it dynamically populated?

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 26, 2024, 8:13pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/6 "2024-02-26T20:13:31Z")

</div>

Another thing to note about the `auto_modules_*` attribute is that it’s case-sensitive. On my system, when I use `auto_modules_ansys`, I get a list of versions, but if I use `auto_modules_Ansys`, I only have a select box with the ‘default’ selectable. So it’s possible that by changing your form to `auto_modules_Ansys` with a capital A, it’ll pick up all of the versions. It depends on what the module is named in your system.

For the other question, it’s not possible to make this field dynamic at this level. The cluster-awareness is built into the dashboard code base, and adding the ability to generate the list dynamically based off of a regex is on the roadmap, but currently even that functionality does not exist.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 26, 2024, 8:19pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/7 "2024-02-26T20:19:40Z")

</div>

Yeah, I have read in the docs that it’s case sensitive but in my case everything is low case:

> module avail ansys  
> ---------------------------- /cluster/apps/modules/fea ----------------------------  
> ansys/11.0 ansys/14.5 ansys/16.1 ansys/18.0 ansys/19.3 ansys/22.2  
> ansys/12.0 ansys/14.5.7 ansys/16.2 ansys/18.1 ansys/20.1 ansys/default  
> ansys/12.1 ansys/15.0 ansys/17.0 ansys/18.2 ansys/21.1  
> ansys/13.0 ansys/15.0.7 ansys/17.1 ansys/19.0 ansys/21.2  
> ansys/14.0 ansys/16.0 ansys/17.2 ansys/19.2 ansys/22.1

and it’s still not working.

For the dynamic populated question:

So if I try to to hide ansys module filed based on my chose it’s expected not to work?

> attributes:  
> Solver:  
> widget: ‘select’  
> options:  
> - [“Ansys”]  
> - [  
> “CFX”,  
> data-hide-auto-modules-ansys: true

I added

> module\_file\_dir: “/etc/reporting/modules”  
> bc\_dynamic\_js: true

at the end of my /etc/ood/config/clusters.d/viking.yml

Is it where it suppose to go? Do you have an example by any chance. My dynamic choice by cluster is not working as well (all queus are showing regardless of cluster chosen) and I think this might be a reason, that I put these 2 directives in a wrong place.

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 26, 2024, 8:40pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/8 "2024-02-26T20:40:02Z")

</div>

Asking as a sanity check - have you restarted your web-server since changing these configs? Beyond that, could you share the viking.json file so I can attempt to replicate your issue?

`data-hide-auto-modules-ansys: true` will hide the entire field generated by `auto_modules_ansys` when ‘CFX’ is selected, not change the list of versions it shows, which is how I interpreted your ask.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 26, 2024, 9:19pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/9 "2024-02-26T21:19:09Z")

</div>

Yes, I restarted web server.

> data-hide-auto-modules-ansys: true will hide the entire field generated by auto\_modules\_ansys when ‘CFX’ is selected, not change the list of versions it shows, which is how I interpreted your ask.

And yes it’s what exactly I want. But it’s not working together with modules populating and queues populating depending on cluster choice ( all of them are there, but they are not dynamically populated).

I attached my json and cluster yml files

And my form.yml.erb just in case

[viking.json](https://discourse.openondemand.org/uploads/short-url/ysbB81r5xdpGs4wBK3V0uoLrbi2.json) (618.9 KB)  
[viking.yml](https://discourse.openondemand.org/uploads/short-url/4fZWZQ99X4rTWtZTQx6lE3h3W3G.yml) (1.3 KB)  
[form.yml](https://discourse.openondemand.org/uploads/short-url/uIQXPUmuJCWj5AwP6sKWqaeTcn.yml) (1.0 KB)

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 26, 2024, 11:28pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/10 "2024-02-26T23:28:03Z")

</div>

After adding these 2 lines:

OOD\_BC\_DYNAMIC\_JS=TRUE  
OOD\_MODULE\_FILE\_DIR: /etc/reporting/modules

in /etc/ood/config/apps/dashboard/env

everything started working.

Thank you for helping out.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 27, 2024, 12:00am UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/11 "2024-02-27T00:00:32Z")

</div>

Only 1 hiccup I see if modules have some nested path is not working.

For example for CFX not working

> module avail cfx  
> ---------------------------- /cluster/apps/modules/cfd ----------------------------  
> cfx/double/11.0 cfx/single/11.0 cfx/zzz\_default  
> cfx/double/12.0 cfx/single/12.0  
> cfx/double/12.1 cfx/single/12.1  
> cfx/double/13.0 cfx/single/13.0  
> cfx/double/14.0 cfx/single/14.0

VS ansys which is working.

> module avail ansys  
> ---------------------------- /cluster/apps/modules/fea ----------------------------  
> ansys/11.0 ansys/14.5 ansys/16.1 ansys/18.0 ansys/19.3 ansys/22.2  
> ansys/12.0 ansys/14.5.7 ansys/16.2 ansys/18.1 ansys/20.1 ansys/default  
> ansys/12.1 ansys/15.0 ansys/17.0 ansys/18.2 ansys/21.1  
> ansys/13.0 ansys/15.0.7 ansys/17.1 ansys/19.0 ansys/21.2  
> ansys/14.0 ansys/16.0 ansys/17.2 ansys/19.2 ansys/22.1

Is it expected?

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 27, 2024, 2:40pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/12 "2024-02-27T14:40:38Z")

</div>

Yes, we don’t currently support nested modules. @jeff.ohrstrom has created an issue for this on GitHub: [support nested modules in auto\_modules · Issue #3378 · OSC/ondemand · GitHub](https://github.com/OSC/ondemand/issues/3378)

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 27, 2024, 6:24pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/13 "2024-02-27T18:24:33Z")

</div>

Copy. Thank you for opening issue. Last one thing to clarify. When we add new modules we need to rerun spider json command, correct?

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 27, 2024, 7:01pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/14 "2024-02-27T19:01:56Z")

</div>

> [@ssofya](#):
>
> When we add new modules we need to rerun spider json command, correct?

Correct, and beyond that, you could create a crontab entry to populate the file at regular intervals.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 27, 2024, 7:09pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/15 "2024-02-27T19:09:09Z")

</div>

Thanks, it’s what I though to do.

In my attempt to work around nested modules I created CFX directory and copied my modules there. I updated my json with modules and I my form and I can see modules now. But I can hide this field for some reason:

form:

- Solver
- auto\_modules\_ansys
- auto\_modules\_CFX

attributes:  
Solver:  
widget: ‘select’  
options:  
- [“Ansys”,  
data-hide-auto-modules-CFX: true,  
data-hide-auto-modules-fluent: true,  
data-hide-auto-modules-starccm: true  
]

It doesn’t hide CFX, but hides fluent and starccm.

Is anything wrong with my code?

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 27, 2024, 8:09pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/16 "2024-02-27T20:09:26Z")

</div>

I’ve tested your code, and found that I can reproduce your issue whenever I use any attribute name with a capital letter in a `data-hide` directive, so I’ve opened an issue for it on GitHub ([data-hide not picking up on names with capital letters · Issue #3381 · OSC/ondemand · GitHub](https://github.com/OSC/ondemand/issues/3381)) and am currently investigating.

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 27, 2024, 8:32pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/17 "2024-02-27T20:32:35Z")

</div>

Thank you for letting me know. I actually want to report that there is a workaround nested modules.

If I copy one module to the root directory cfx/22.1 and then run spder command to update my json my from can see all nested modules.

 ![Screenshot from 2024-02-27 12-31-56](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/7/730746c67b37fe29d97d5827ee586c8068fba123.png)

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 27, 2024, 11:53pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/18 "2024-02-27T23:53:20Z")

</div>

Suddenly my path\_selector stopped working.

It was working fine and I’m not even sure when it stopped. It looks like it cannot open my home directory.

path:  
widget: “path\_selector”  
directory: “/fs/home”  
show\_hidden: true

When I click Select path I don’t see any files and I cannot choose anything:

![Screenshot from 2024-02-27 15-40-55](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/4/47ff221dee7a78b79f9b954a8c94a0830ffa4beb.png)

But I can open all right my home directory under files in Ondemand dashboard application:

![Screenshot from 2024-02-27 15-47-10](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/4/4285da29c604912eb27c41dc2cd581f4c10129ba.png)

Is there any logs I can check why it stopped working?

---

<div class="post-metadata">

**Author:** ![hrandquist](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/hrandquist/32/2536_2.png) [@hrandquist](https://discourse.openondemand.org/u/hrandquist)\
**Post date:** [February 28, 2024, 2:09pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/19 "2024-02-28T14:09:21Z")

</div>

This looks like an issue we’ve seen before and have been unable to reproduce consistently ([path\_selector - buggy behavior when selecting for the second time. · Issue #3060 · OSC/ondemand · GitHub](https://github.com/OSC/ondemand/issues/3060) and [selecting a path a second time seems broken · Issue #2711 · OSC/ondemand · GitHub](https://github.com/OSC/ondemand/issues/2711)). Because I know that I don’t know how to reproduce it, I can’t test myself if clearing the browser cache is a temporary way around this, but based on what I know of the code, it _should_ work. If it doesn’t, definitely let me know and I’ll investigate further for a work-around.

Here is a new ticket for it: [path\_selector inconsistently broken · Issue #3385 · OSC/ondemand · GitHub](https://github.com/OSC/ondemand/issues/3385)

---

<div class="post-metadata">

**Author:** ![ssofya](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ssofya/32/1145_2.png) [@ssofya](https://discourse.openondemand.org/u/ssofya)\
**Post date:** [February 28, 2024, 6:30pm UTC](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287/20 "2024-02-28T18:30:56Z")

</div>

I cleaned my browse cache and I tried incognito mode and it didn’t help.

My OnDemand version: 3.0.3. Is it better in a new version or do you see it in all versions?

And I can replicate this issue as well.

> <https://github.com/OSC/ondemand/issues/3367>
>
> We had a discourse come in after the \`3.1\` release about the path selector:
> htt…ps://discourse.openondemand.org/t/label-is-not-displayed-when-using-path-selector/3281
> 
> Upon trying to answer or recreate it was discovered the current docs for this feature don't see to work if you follow them.
> 
> Using \`3.1\` and creating a \`form.yml\` with the following:
> \`\`\`yml
> working\_dir:
> label: "Select Directory"
> widget: "path\_selector"
> directory: "/path/to/my/home" # obfuscating, not actual text used
> show\_hidden: true
> show\_files: false
> \`\`\`
> This results in a pop up that cannot be interacted with.
> 
> If you leave out the \`directory\` as the user does in the discourse sometimes the pop-up shows up, sometimes nothing happens. But again, even if the pop-up shows up I cannot interact with it.

I have an older version of Ondemand 2.0.32 and I see path selector error there:

> #\<ActionView::Template::Error: undefined method `path\_selector’ for #BootstrapForm::FormBuilder:0x00007f2d18de7c58\>

Was path selector only intorduced recently?

[Next page](https://discourse.openondemand.org/t/cluster-specific-modules-dont-populate-in-form-yml-erb/3287.md?page=2)
