edurange / edurange-flask

Refactored version of the EDURange platform built on Flask
MIT License
18 stars 14 forks source link

Unable to view logs in webpage #76

Open crowllx opened 1 year ago

crowllx commented 1 year ago

When logged in as an admin/instructor no command history shows up for any of the users when trying to view them on the scenario dashboard. Specifically when viewing as an admin and not an instructor, i see the log data show up in npm output. Sometimes only after stopping the web server.

[CELERY] worker: Warm shutdown (MainProcess)
[FLASK] [['#INPUT', 'uniqueID', 'class', 'time', 'uid', 'cwd', 'node:input', 'output (trunc)'], ['INPUT', 'devuser1-ulab-0', 'A7 ', '1696106957', 'devuser1', '/home/devuser1', 'NAT:l', '\neditme/  final-mission/  followMe/  i/  stuff/  textfiles/  toLearn/\ndevuser1@NAT'], ['INPUT', 'devuser1-ulab-1', 'M0 ', '1696106959', 'devuser1', '/home/devuser1', 'NAT:cd followMe/', '\ndevuser1@NAT'], ['INPUT', 'devuser1-ulab-2', 'A1 A0 A9 ', '1696106963', 'devuser1', '/home/devuser1/followMe', 'NAT:cd ..', '\ndevuser1@NAT']]
[FLASK] [['#INPUT', 'uniqueID', 'class', 'time', 'uid', 'cwd', 'node:input', 'output (trunc)'], ['INPUT', 'devuser1-ulab-0', 'A7 ', '1696106957', 'devuser1', '/home/devuser1', 'NAT:l', '\neditme/  final-mission/  followMe/  i/  stuff/  textfiles/  toLearn/\ndevuser1@NAT'], ['INPUT', 'devuser1-ulab-1', 'M0 ', '1696106959', 'devuser1', '/home/devuser1', 'NAT:cd followMe/', '\ndevuser1@NAT'], ['INPUT', 'devuser1-ulab-2', 'A1 A0 A9 ', '1696106963', 'devuser1', '/home/devuser1/followMe', 'NAT:cd ..', '\ndevuser1@NAT']]

I have not been able to see any log data in the scenario dashboard using a simple case as an example so i believe this is different from the issue with null bytes being kept in the logs. Also I did test and observe this on the master branch.

cookjackc commented 1 year ago

I think I've observed this too - this issue only effects auto-generated accounts.

Basically, the front-end might be looking for "devuser1" but the log file records them as "dev-user1" (or maybe the other way around) On either end that hyphen isn't being removed, and so it's not accessible in the front-end.

Logs for manually registered students are viewable, as far as I know. I had a 3 or 4 line fix for this at one point, but scrapped it during other changes.

Let me know and I'd be happy to try and troubleshoot it with you again.