You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yesterday kotnet/campusnet was down When attempting to log in kotnetcli crashed with the following output:
jo@Giedion[1]::~$ kotnetcli --debug
/usr/lib/python2.7/site-packages/keyring/backend.py:16: UserWarning: Module argparse was already imported from /usr/lib/python2.7/argparse.pyc, but /usr/lib/python2.7/site-packages is being added to sys.path
import pkg_resources
DEBUG::kotnetcli: parse_args() is: Namespace(color=['green', 'cyan', 'yellow', 'normal'], debug='debug', forget=False, guest_mode=False, keyring=False, license=None, login=False, logout=False, plaintext=False)
INFO::kotnetcli: ik haal de credentials uit de keyring
INFO::kotnetcli: ik wil inloggen
INFO::kotnetcli: ik wil vrolijke custom kleuren: ['green', 'cyan', 'yellow', 'normal']
DEBUG::coloramac: Probeert Colorama te importeren...
DEBUG::coloramac: OK
DEBUG::coloramac: the given colornamelist is ['GREEN', 'CYAN', 'YELLOW', 'NORMAL']
DEBUG::worker: enter LoginWorker.go()
Kotnet verbinding testen... [ OK ]
Netlogin openen............ [ OK ]
Gegevens invoeren.......... [ OK ]
Gegevens opsturen.......... [ OK ]
Traceback (most recent call last):
File "/media/DATA/Documenten/Programming/python/kotnetcli_fresh/kotnetcli/kotnetcli.py", line 343, in <module>
main()
File "/media/DATA/Documenten/Programming/python/kotnetcli_fresh/kotnetcli/kotnetcli.py", line 338, in main
k.parseArgumenten()
File "/media/DATA/Documenten/Programming/python/kotnetcli_fresh/kotnetcli/kotnetcli.py", line 199, in parseArgumenten
worker.go(co, creds)
File "/media/DATA/Documenten/Programming/python/kotnetcli_fresh/kotnetcli/worker.py", line 62, in go
self.login_resultaten(co)
File "/media/DATA/Documenten/Programming/python/kotnetcli_fresh/kotnetcli/worker.py", line 110, in login_resultaten
tup = self.browser.login_parse_results()
File "/media/DATA/Documenten/Programming/python/kotnetcli_fresh/kotnetcli/browser.py", line 130, in login_parse_results
logger.debug("rccode is %s", rccode)
UnboundLocalError: local variable 'rccode' referenced before assignment
Seems like the parser (browser class) couldn't find and thus did not fill in the rccode variable, since the html page did not look as expected? No real problem maybe, but it would be nice if the browser could throw an exception or so when detecting the html response is not as expected. The worker could then catch this exception and inform the communicator of a fatal error... Could something like this be possible?
I am not sure whether the 301 code is an RC code?? As with issue #85 there seem to be two codes involved (exctract from html dump below):
<h2>KotNet/CampusNet</h2>
<!-- <rc=100 password verification successful (user=<kuleuven-campusnet/ANONYMOUS>)>
-->
301 could not call backend
I retrieved the full html page with a web browser:
No real problem maybe, but it would be nice if the browser could throw an exception or so when detecting the html response is not as expected.
Definitely.
Seems like the parser (browser class) couldn't find and thus did not fill in the rccode variable, since the html page did not look as expected?
That's true. The parser finds the RC code using a regular expression match. The rc code is usually lead by a small string: weblogin: rc=. For some reason, with this specific error, it's just rc=. Very strange.
I am not sure whether the 301 code is an RC code??
I am not sure either. To me, it looks like the Kotnet programmers did not expect error 301 to happen, and therefore, haven't declared a specific RC code for this purpose yet.
To round off, yes, we do need an exception when the RC code is different than expected.
GijsTimmers
changed the title
Kotnet down: errorcode 301
Throw an exception or error if RC code is invalid
Oct 5, 2015
301 is the rccode for internal script error (see issue #80 ), so I guess what happened here is not anticipated in an rccode (?)
To round off, yes, we do need an exception when the RC code is different than expected.
Not really, we already have an UnknownRCException. What happened here is that the rccode variable was empty, since no rccode has been found in the html page. The python code however tries to print out the empty variable, which raises an exception... We thus need to handle the case were no rccode can be found in the html page...
jovanbulck
changed the title
Throw an exception or error if RC code is invalid
Throw an exception or error if RC code cannot be found in html response
Oct 10, 2015
Yesterday kotnet/campusnet was down When attempting to log in
kotnetcli
crashed with the following output:Seems like the parser (browser class) couldn't find and thus did not fill in the rccode variable, since the html page did not look as expected? No real problem maybe, but it would be nice if the browser could throw an exception or so when detecting the html response is not as expected. The worker could then catch this exception and inform the communicator of a fatal error... Could something like this be possible?
I am not sure whether the 301 code is an RC code?? As with issue #85 there seem to be two codes involved (exctract from html dump below):
I retrieved the full html page with a web browser:
The text was updated successfully, but these errors were encountered: