Empty job list due to non-utf8 job names

And sadly, I can’t replicate over ssh either.

I have submitted the job on the login04 and ran squeue on the login04 (both through ssh).

[xxxxxxx@login04 ~]$ squeue --me
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
           4071958 compute-p � non-utf8  xxxxxxx  R       2:38      1 cmp194

However OoD on the login04 (now on 3.1.7) does not display any jobs.

:man_facepalming: OK this is starting to make sense. squeue itself isn’t showing the correct character.

Does it ever show up correctly in the CLI? Her’es what my container’s showing - the correct character. If squeue doesn’t return the correct character - than OnDemand doesn’t really have a chance parse it correctly.

[hpcadmin@frontend ~]$ squeue 
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
                 2   compute â non-u hpcadmin  R    1:56:05      1 cpn01

This is how squeue displays the char. Of course we will have a look on why it’s not producing the char you see. However, I think that the parser in OoD shouldn’t fail (and stop) when encountering a strange char. Can it be ignored and then continue, thus still producing output?

I agree - I’m going to patch ood_core today for the same.

This is the patch you need.

You can find the file through this command. If you patch it manually, you should backup the original file just to be sure you can back out of the change.

find /opt/ood/ondemand/root/usr/share/gems/3.1 -name 'slurm.rb'

Thanks, but it doesn’t seem to work. We get the same error (just shifted one line…)

Based on your patch, I tried
line = line.encode('UTF-8', :invalid => :replace, :undef => :replace)
This fixes the issue (not sure if it might introduce new ones)

What was the error when you had line = line.force_encoding('UTF-8'). This seems to work in my test case, so I’m curious as to why it doesn’t work for you.

I’m patching ood_core right now. force_encoding displays â where your patch encode returns and I would prefer the former if possible.

The error with force_encoding was the same as before.

App 235746 output: [2024-07-09 12:39:34 +0200 ] ERROR "ArgumentError: invalid byte sequence in UTF-8\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapters/slurm.rb:174:in `split'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapters/slurm.rb:174:in `block (2 levels) in get_jobs'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapters/slurm.rb:157:in `each_line'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapters/slurm.rb:157:in `block in get_jobs'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapters/slurm.rb:153:in `open'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapters/slurm.rb:153:in `get_jobs'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapters/slurm.rb:592:in `info_where_owner'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/job/adapter.rb:112:in `info_where_owner_each'\n/var/www/ood/apps/sys/dashboard/app/models/active_jobs/jobs_json_request_handler.rb:49:in `each'\n/var/www/ood/apps/sys/dashboard/app/models/active_jobs/jobs_json_request_handler.rb:49:in `each_slice'\n/var/www/ood/apps/sys/dashboard/app/models/active_jobs/jobs_json_request_handler.rb:49:in `block in render'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/clusters.rb:123:in `each'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/ood_core-0.25.0/lib/ood_core/clusters.rb:123:in `each'\n/var/www/ood/apps/sys/dashboard/app/models/active_jobs/jobs_json_request_handler.rb:47:in `each_with_index'\n/var/www/ood/apps/sys/dashboard/app/models/active_jobs/jobs_json_request_handler.rb:47:in `render'\n/var/www/ood/apps/sys/dashboard/app/controllers/active_jobs_controller.rb:19:in `block (2 levels) in index'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/mime_responds.rb:214:in `respond_to'\n/var/www/ood/apps/sys/dashboard/app/controllers/active_jobs_controller.rb:10:in `index'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:228:in `process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/rendering.rb:30:in `process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:42:in `block in process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:106:in `run_callbacks'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:41:in `process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/rescue.rb:22:in `process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `block in instrument'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/activesupport-6.1.7.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `instrument'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:33:in `process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:165:in `process'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionview-6.1.7.6/lib/action_view/rendering.rb:39:in `process'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/live.rb:261:in `block (2 levels) in process'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/activesupport-6.1.7.6/lib/active_support/dependencies/interlock.rb:42:in `block in running'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/activesupport-6.1.7.6/lib/active_support/concurrency/share_lock.rb:162:in `sharing'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/activesupport-6.1.7.6/lib/active_support/dependencies/interlock.rb:41:in `running'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/live.rb:253:in `block in process'\n/opt/ood/ondemand/root/usr/share/gems/3.1/ondemand/3.1.7-1/gems/actionpack-6.1.7.6/lib/action_controller/metal/live.rb:303:in `block in new_controller_thread'"

With encode I also get the , but that’s better than nothing.

Just finishing up the test case for this now. Just to be sure I get it right, I’m getting 3 funny characters in the output. Is this what you see in the UI when you patch ood_core? That is slurm returns 1 �, but the UI shows 3 �.

��� non-utf8

I see only 1 � (same as slurm’s output of squeue)
nonUTF8