cvmfs-contrib / cvmfs-servermon

CernVM File System Server Monitoring API
BSD 2-Clause "Simplified" License
3 stars 4 forks source link

TabError: inconsistent use of tabs and spaces in indentation #50

Closed rptaylor closed 1 year ago

rptaylor commented 1 year ago

After updating to cvmfs-servermon-1.26-1.26.obs.el8.noarch the cvmfs-mon page does not work anymore. http://cvmfs-s1dev-arbutus.computecanada.ca:8000/cvmfsmon/api/v1.0/all&format=details
It shows Internal Server Error, and:

[Fri Oct 20 15:22:54.722073 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518] mod_wsgi (pid=3283365): Failed to exec Python script file '/var/www/wsgi-scripts/cvmfs-servermon/cvmfsmon-api.wsgi'.
[Fri Oct 20 15:22:54.722168 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518] mod_wsgi (pid=3283365): Exception occurred processing WSGI script '/var/www/wsgi-scripts/cvmfs-servermon/cvmfsmon-api.wsgi'.
[Fri Oct 20 15:22:54.722322 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518] Traceback (most recent call last):
[Fri Oct 20 15:22:54.722354 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518]   File "/var/www/wsgi-scripts/cvmfs-servermon/cvmfsmon-api.wsgi", line 2, in <module>
[Fri Oct 20 15:22:54.722360 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518]     import cvmfsmon_api
[Fri Oct 20 15:22:54.722374 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518]   File "/usr/share/cvmfs-servermon/webapi/cvmfsmon_api.py", line 115
[Fri Oct 20 15:22:54.722385 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518]     elif words[0] == 'updated-slowrepo':
[Fri Oct 20 15:22:54.722412 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518]                                        ^
[Fri Oct 20 15:22:54.722425 2023] [wsgi:error] [pid 3283365:tid 140635659503360] [remote 142.104.x.y:43518] TabError: inconsistent use of tabs and spaces in indentation
rptaylor commented 1 year ago

Would be good to have e.g. CI running pylint or other testing to avoid basic errors. Aside from the error:

$ pylint /usr/share/cvmfs-servermon/webapi/cvmfsmon_api.py 
************* Module cvmfsmon_api
/usr/share/cvmfs-servermon/webapi/cvmfsmon_api.py:115:39: E0001: inconsistent use of tabs and spaces in indentation (<unknown>, line 115) (syntax-error)

there are 103 other warnings.

rptaylor commented 1 year ago

FYI @vzokay this broke the monitoring. https://github.com/cvmfs-contrib/cvmfs-servermon/pull/48

DrDaveD commented 1 year ago

It must have been only python3 that complained about it, because it has been installed elsewhere without a problem.

DrDaveD commented 1 year ago

Would be good to have e.g. CI running pylint or other testing to avoid basic errors. Aside from the error:

$ pylint /usr/share/cvmfs-servermon/webapi/cvmfsmon_api.py 
************* Module cvmfsmon_api
/usr/share/cvmfs-servermon/webapi/cvmfsmon_api.py:115:39: E0001: inconsistent use of tabs and spaces in indentation (<unknown>, line 115) (syntax-error)

there are 103 other warnings.

Ouch, that sounds like it would be an awful lot of work to clean up warnings. Probably most of them aren't very important. I guess it could be used with -E to just find errors.

DrDaveD commented 1 year ago

pylint action was added in #52

DrDaveD commented 1 year ago

This is now released in version 1.27. It would be good if you could verify it.

rptaylor commented 1 year ago

Yes I installed cvmfs-servermon-1.27-1.27.obs.el8.noarch.rpm and it works.