Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Python] Web App throws exceptions in status...

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
Sniper_X
Posts: 4
Joined: 2023-10-13 00:40

[Python] Web App throws exceptions in status...

#1 Post by Sniper_X »

I have a web-based service that uses Python & a command line tool that gets called by a wrapper (of some sort).

This is what the service SHOULD look like when status is checked:

Code: Select all

# systemctl status usmd
usmd.service - Western Digital Resource Manager Web Application HTTP server
  Loaded: loaded (/etc/systemd/system/usmd.service; static; vendor preset:
 enabled)
  Active: active (running) since Thu 2020-12-31 11:28:26 IST; 1h 18min ago
Main PID: 35459 (python3)
   Tasks: 7 (limit: 7372)
  CGroup: /system.slice/usmd.service
          |-- 2650 /bin/sh -c wdds /dev/sg2 show handles
          |-- 2651 wddcs /dev/sg2 show handles
          |--19819 /usr/bin/python3 /opt/usm/inbandmgmt/middleware/main.py
This is what the service looks like when I install it:

Code: Select all

# systemctl status usmd
● usmd.service - Western Digital Resource Manager Web Application HTTP server.
     Loaded: loaded (/etc/systemd/system/usmd.service; enabled; preset: enabled)
     Active: active (running) since Wed 2023-10-11 13:03:10 EDT; 7h ago
   Main PID: 1002 (python3)
      Tasks: 25 (limit: 38356)
     Memory: 172.5M
        CPU: 2h 37min 23.653s
     CGroup: /system.slice/usmd.service
             └─1002 /usr/bin/python3 /opt/usm/inbandmgmt/middleware/main.py

Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:     drive_handles = WDDCS.get_handles(serial, hba_index,True)
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:   File "/opt/usm/inbandmgmt/app/services/hal/wddcs_wrapper.py", line 557, in get_handles
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:     slot_map = (list(map(get_slot_map,output)))
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:   File "/opt/usm/inbandmgmt/app/services/hal/wddcs_wrapper.py", line 447, in get_slot_map
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:     if items[dev_index].startswith("/dev/") or items[dev_index].startswith("PD"):
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]:        ~~~~~^^^^^^^^^^^
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]: IndexError: list index out of range
Oct 11 18:46:05 GA01WDRM-TST-SRV01 python3[1002]: 10.168.101.99 - - [11/Oct/2023:18:46:04 -0400] "POST /storage/driveinfo?hba_index=1&serial=USWSJ01219EZ0023 HTTP/1.1" 500 265 "https://10.168.101.129/" "Mozilla/5.0 (Windows NT 10.0; W>
I'm mainly concerned with the tree at the bottom showing what processes should be running, but mine error out.
How do I diagnose this?

I can run these commands manually, but the service seems to not be able to

All files being called are owned by ROOT as far as I can see.
I installed the application and the dependencies as ROOT

I'm about to go blind trying to slog my through this, but watch this be a simple problem I just don't know how to recognize yet.

This is what I'm trying to install:
Western Digital Resource Manager - This https://documents.westerndigital.com/co ... %2Cnull%5D will take you to the LINUX install section

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: [Python] Web App throws exceptions in status...

#2 Post by reinob »

you should contact Western Digital for support, as this is definitely not a debian issue.

Please note that the document you linked says that Debian 10.9 is required. You are probably running something which is more up-to-date.

Note also that apparently that "wddcs" program is not running at all, which may (or may not) be the cause of the issue.

You could try to run it manually "wddcs /dev/sg2 show handles" (as root, presumably) and see if it works. Maybe the "wddcs" (whatever /that/ is) is not installed at all?

Did you (succesfully) run all of the steps in section 2.2? Maybe you want to start again from scratch and check in detail whether each of the steps runs OK.

Other than that, I can only wish you luck..

Sniper_X
Posts: 4
Joined: 2023-10-13 00:40

Re: [Python] Web App throws exceptions in status...

#3 Post by Sniper_X »

WD Support takes a week to respond, so I have a ticket but I don't expect anything from them.
Yes Debian 12 and 10.9 were both tried and same issue.

I definitely have all the prerequisite software installed and the WDDCS and WDKIT executables are tools, not things that run all the time like a service.
The service that runs under apache2 to make the Web app, is the only service and it uses python and wrapper scripts to execute WDDCS and WDCKIT commands.
It parses the output into the web app and that makes the GUI work.

Yes, I can run these commands manually when I use the WDDCS and WDKIT tools.

I just don't know how to run the python wrapper commands manually.

I believe this is a permissions issue, but I don't know how to test for that.

Post Reply