perfsonar / psconfig-web

pSConfig Web Admin
Apache License 2.0
7 stars 9 forks source link

uncaughtException: isoOut.toISOString is not a function #219

Closed howardtopher closed 2 years ago

howardtopher commented 2 years ago

Running version 4.4.1 (brand new install). After adding latency tests and adding the remote pscheduler template to my test hosts, everything was fine. However, after adding throughput tests, the template no longer loads. In the node logs, there is the following error.

Sep 10 17:25:48 ps-dashboard node: Fri Sep 10 2021 17:25:48 GMT-0400 (EDT) - #033[31merror#033[39m: Fri, 10 Sep 2021 21:25:48 GMT uncaughtException: isoOut.toISOString is not a function
Sep 10 17:25:48 ps-dashboard node: Fri Sep 10 2021 17:25:48 GMT-0400 (EDT) - #033[31merror#033[39m: TypeError: isoOut.toISOString is not a function
Sep 10 17:25:48 ps-dashboard node: at exports.seconds_to_iso8601 (/usr/lib/perfsonar/psconfig-web-admin/pub/api/pub/pub_shared.js:130:21)

Looking at the pub_shared.js file on line 130, I can see that moment.js is to blame. It appears there are two copies of moment.js installed:

/usr/lib/perfsonar/psconfig-web-admin/auth/node_modules/moment/moment.js
/usr/lib/perfsonar/psconfig-web-admin/shared/node_modules/moment/moment.js

The auth one is version 2.29.1, but the shared one is only 2.0.0. The shared one does not have the toISOString function.

I've copied the 2.29.1 version over to the shared folder, restarted the services, and the problem is gone. Not sure if I broke anything else by doing that, but it seems to be fully functioning after.

grigutis commented 2 years ago

Thank you for letting us know about this. This will be fixed in the 4.4.2 release.