Linux host adapter issues

Hello team,

I’m trying to setup an environment using the “linux_host” adapter but I’m getting the following error.
I’m currently using the Ansible role to deploy OOD with the configurations listed below.

Error

undefined method `to_h' for "linux_host":String
Did you mean?  to_d
               to_r
               to_f
               to_i
               to_s
               to_c

Trying to read the logs from the file system I get an error and no logs are stored.

Error occurred when attempting to access /pun/sys/dashboard/files/fs//cluster/home/bcasano/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/tenanta/output/80d68418-2c06-48c3-98b0-457e80d12261
No such file or directory @ rb_file_s_stat - /cluster/home/bcasano/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/tenanta/output/80d68418-2c06-48c3-98b0-457e80d12261

nginx logs /var/log/ondemand-nginx/bcasano/error.log

App 83261 output: [2023-08-08 16:20:57 +0200 ] ERROR "ERROR: NoMethodError - undefined method `to_h' for \"linux_host\":String\nDid you mean?  to_d\n               to_r\n               to_f\n               to_i\n               to_s\n               to_c"
App 83261 output: [2023-08-08 16:20:57 +0200 ]  INFO "execve = [\"git\", \"describe\", \"--always\", \"--tags\"]"
App 83261 output: [2023-08-08 16:20:57 +0200 ]  INFO "method=POST path=/pun/sys/dashboard/batch_connect/sys/bc_desktop/tenanta/session_contexts format=html controller=BatchConnect::SessionContextsController action=create status=200 duration=356.39 view=9.43"

My configuration is:

OOD Host

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal

Ansible OOD Role

roles/ood-ansible (v3.0.3)

Cluster /etc/ood/config/clusters.d# cat tenanta.yml


---
v2:
  metadata:
    title: "tenanta"
    url: "ood-tenanta.leomed.ethz.ch"
    hidden: false
  login:
    host: "login-tenanta-01.leomed.ethz.ch"
    default: true
  job:
    adapter: linux_host
    submit_host: "login-tenanta-01.leomed.ethz.ch"
    ssh_hosts:
      - login-tenanta-01.leomed.ethz.ch
    site_timeout: 7200
    debug: true
    singularity_bin: /usr/local/bin/singularity
    singularity_bindpath: /etc,/media,/mnt,/opt,/run,/srv,/usr,/var,/users
    singularity_image: /cluster/customapps/common/singularity/ubuntu_2004.sif
    strict_host_checking: false
    tmux_bin: /usr/bin/tmux
  batch_connect:
    basic:
      script_wrapper: |
        touch /tmp/basic_no_slurm
        # enable_modules
        # module purge
        %s
      set_host: "host=$(/usr/bin/hostname -A | awk '{print $1}')"
    vnc:
      script_wrapper: |
        # enable_modules
        # module purge
        touch /tmp/vnc_no_slurm
        export PATH="/opt/TurboVNC/bin:$PATH"
        export WEBSOCKIFY_CMD="/usr/bin/websockify"
        %s
      set_host: "host=$(/usr/bin/hostname -A | awk '{print $1}')"

Desktop App **apps/bc_desktop/tenanta.yml


attributes:
    bc_account: null
    bc_num_slots: 1
    bc_queue: null
    desktop: xfce
    num_cores: none
cluster: tenanta
description: 'Test'
submit: submit/submit.yml.erb
title: LeoDesk

Submit apps/bc_desktop/submit/submit.yml.erb

linux_host

The variables used with the Ansible role:

clusters:
  "{{ tenant_name }}": |
    ---
    v2:
      metadata:
        title: "{{ tenant_name }}"
        url: "ood-{{ tenant_name }}.leomed.ethz.ch"
        hidden: false
      login:
        host: "login-{{ tenant_name }}-01.leomed.ethz.ch"
        default: true
      job:
        adapter: linux_host
        submit_host: "login-{{ tenant_name }}-01.leomed.ethz.ch"
        ssh_hosts:
          - login-{{ tenant_name }}-01.leomed.ethz.ch
        site_timeout: 7200
        debug: true
        singularity_bin: /usr/local/bin/singularity
        singularity_bindpath: /etc,/media,/mnt,/opt,/run,/srv,/usr,/var,/users
        singularity_image: /cluster/customapps/common/singularity/ubuntu_2004.sif
        strict_host_checking: false
        tmux_bin: /usr/bin/tmux
      batch_connect:
        basic:
          script_wrapper: |
            touch /tmp/basic_no_slurm
            # enable_modules
            # module purge
            %s
          set_host: "host=$(/usr/bin/hostname -A | awk '{print $1}')"
        vnc:
          script_wrapper: |
            # enable_modules
            # module purge
            touch /tmp/vnc_no_slurm
            export PATH="/opt/TurboVNC/bin:$PATH"
            export WEBSOCKIFY_CMD="/usr/bin/websockify"
            %s
          set_host: "host=$(/usr/bin/hostname -A | awk '{print $1}')"

ood_apps:
  # Remote Desktop
  bc_desktop: |
    # cacheable: false
    attributes:
      desktop: "xfce"
      bc_queue: null
      bc_account: null
      bc_num_slots: 1
      num_cores: none

I tried debugging and reading the docs/Discourse before opening the Topic but I’m unable to find the issue.

Thanks!
B

Hello and thanks for posting!

For the submit.yml.erb is that the entirety of the contents of that file? It looks to be formatted incorrectly to start, but I wanted to check that was in fact what is in the file first.

It is the entire file; it was generated using the Ansible vars that I included. I will attach the files tomorrow, for better context.

Update: Attaching the file and some more information.

ood.yml (3.6 KB)

After manually modifying the file as seen here I do not see the “undefined method” issue, however I see that it is trying to connect using Slurm.

Logs /var/log/ondemand-nginx/bcasano/error.log

App 126174 output: [2023-08-09 09:50:19 +0200 ]  INFO "method=POST path=/pun/sys/dashboard/batch_connect/sys/bc_desktop/tenanta/session_contexts format=html controller=BatchConnect::SessionContextsController action=create status=302 duration=19996.50 view=0.00 location=https://ood-tenanta.leomed.ethz.ch/pun/sys/dashboard/batch_connect/sessions"
App 126174 output: [2023-08-09 09:50:20 +0200 ]  INFO "execve = [{}, \"ssh\", \"-t\", \"-p\", \"22\", \"-o\", \"BatchMode=yes\", \"-o\", \"UserKnownHostsFile=/dev/null\", \"-o\", \"StrictHostKeyChecking=no\", \"bcasano@login-tenanta-01\", \"tmux\", \"list-panes\", \"-aF\", \"\\\\#\\\\{session_name\\\\},\\\\#\\\\{session_created\\\\},\\\\#\\\\{pane_pid\\\\}\"]"
App 126174 output: [2023-08-09 09:50:21 +0200 ] ERROR "157 is not a valid LinuxHost adapter id because it is missing the '@'."
App 126174 output: [2023-08-09 09:50:21 +0200 ]  INFO "method=GET path=/pun/sys/dashboard/batch_connect/sessions format=html controller=BatchConnect::SessionsController action=index status=200 duration=1733.13 view=28.24"

Reviewing the session output logs /cluster/home/bcasano/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/tenanta/output/79d6b124-9a6c-43d6-b81f-4f52ccb1b740 I see the job is trying to connect to a different host.

connection.yml

host: compute-tenanta-01
port: 5902
password: SOMEPASSWORD
display: 2
websocket: 21984
spassword: SOMEOTHERPASSWORD

output.log

Setting VNC password...
Starting VNC server...

Desktop 'TurboVNC: compute-tenanta-01:2 (bcasano)' started on display compute-tenanta-01:2

Log file is vnc.log
Successfully started VNC server on compute-tenanta-01:5902...
Script starting...
Starting websocket server...
/cluster/home/bcasano/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/tenanta/output/79d6b124-9a6c-43d6-b81f-4f52ccb1b740/script.sh: line 7: module: command not found
Launching desktop 'xfce'...
WebSocket server settings:
  - Listen on :21984
  - No SSL/TLS support (no cert file)
  - Backgrounding (daemon)
Scanning VNC log file for user authentications...
Generating connection YAML file...
/usr/bin/iceauth:  creating new authority file /run/user/528867/ICEauthority

(xfce4-session:1546229): xfce4-session-WARNING **: 12:47:36.326: xfsm_manager_load_session: Something wrong with /cluster/home/bcasano/.cache/sessions/xfce4-session-compute-tenanta-01:2, Does it exist? Permissions issue?

The line 7: module: command not found error seems to be because it’s running the default script from /var/www/ood/apps/sys/bc_desktop/template/script.sh.erb.

Just in case, I removed slurm-client package from the host but I’m still seeing the same behavior.

Please, let me know if you need any other logs or something. I get the impression this might be a problem with my Ansible YAML configurations but I’m unable to see it.

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