Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edupage logging out after some time #13

Open
cfpwastaken opened this issue Jan 21, 2022 · 14 comments
Open

Edupage logging out after some time #13

cfpwastaken opened this issue Jan 21, 2022 · 14 comments

Comments

@cfpwastaken
Copy link

cfpwastaken commented Jan 21, 2022

#
# A fatal error has occurred!
#
# This is probably not your fault!
# If this happens often, please consider reporting a bug.
#
# Error thrown:
#  ParseError: Failed to parse timetable data from html
#      at Function.parse (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Timetable.js:70:51)
#      at Edupage.fetchTimetablesForDates (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Edupage.js:466:27)
#      at processTicksAndRejections (node:internal/process/task_queues:96:5)
#      at async Edupage.getTimetableForDate (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Edupage.js:426:11)
#      at async timetable (/media/cfp/Volume/Projects/edupageCLI/main.js:36:30)
#      at async /media/cfp/Volume/Projects/edupageCLI/main.js:178:7
#
# Summary:
#  Time: Fri Jan 21 2022 17:21:57 GMT+0100 (Central European Standard Time)
#  EdupageAPI version: v0.7.14
#  Node.js version: v16.13.0
#  Error log: /media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/logs/fatal_error_2022-01-21T16-21-57Z.json
#
# If you would like to submit an issue, please visit:
#  > https://github.com/loumadev/EdupageAPI/issues
#  (Please, include this error message + error log)
#

✖ Error!!

TypeError: Cannot read properties of undefined (reading 'dates')
    at Edupage.fetchTimetablesForDates (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Edupage.js:467:36)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Edupage.getTimetableForDate (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Edupage.js:426:11)
    at async timetable (/media/cfp/Volume/Projects/edupageCLI/main.js:36:30)
    at async /media/cfp/Volume/Projects/edupageCLI/main.js:178:7

Error log:

{
	"error": {
		"stack": "ParseError: Failed to parse timetable data from html\n    at Function.parse (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Timetable.js:70:51)\n    at Edupage.fetchTimetablesForDates (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Edupage.js:466:27)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async Edupage.getTimetableForDate (/media/cfp/Volume/Projects/edupageCLI/node_modules/edupage-api/src/Edupage.js:426:11)\n    at async timetable (/media/cfp/Volume/Projects/edupageCLI/main.js:36:30)\n    at async /media/cfp/Volume/Projects/edupageCLI/main.js:178:7",
		"message": "Failed to parse timetable data from html",
		"name": "ParseError"
	},
	"data": {
		"html": "JS: /* Error6511024354099 */ ASC.reloadPage();",
		"match": null
	}
}

Stuff that may be causing the problem:
I left the program running for a very long time, maybe it logged out after some time and thats why?

@loumadev
Copy link
Owner

Have you been calling any methods during that long period? Edupage should extend your current session when you send a request. I could implement some mechanisms to automatically send some ping request repeatedly in some period to keep the session.

@cfpwastaken
Copy link
Author

Nope, it was not doing anything in that time.

@ivanhrabcak
Copy link
Contributor

There is the same issue in the python edupage-api, so this is probably a bigger issue - maybe there need to be additional requests to extend the session (portalPing?).

@cfpwastaken
Copy link
Author

yes this is an issue with python edupage-api, js edupageapi, and most likely cdupage too.

@ivanhrabcak
Copy link
Contributor

ivanhrabcak commented Jan 23, 2022

Nice! Did the new update solve your issue?

Edit: Look at the next comment for more info

@loumadev
Copy link
Owner

I just publish 2 new releases with session pinging added. In case of some failure, there's also a second release which tries to resolve those issues automatically. Hopefully, this will solve your issue.

@ivanhrabcak
Copy link
Contributor

Is this and #12 resolved?

@loumadev
Copy link
Owner

Probably not, there's big update planned, but currently, I have no enough time to work on it. I think, I might be able to migrate all this html parsing stuff to mobile api in like one or two weeks. Hopefully then it will be much more stable.

@cfpwastaken
Copy link
Author

Gonna leave it running in the background now.

@cfpwastaken
Copy link
Author

Ubuntu crashed. Guess this is not happening today

@cfpwastaken
Copy link
Author

I think i can consider this to be fixed now. If it happens again I will reopen this issue.

@cfpwastaken
Copy link
Author

The fix seems to be not working.

@cfpwastaken cfpwastaken reopened this Mar 12, 2022
@cfpwastaken
Copy link
Author

My server is logging out after some time too! It has the latest version of edupageapi and has its own edupage.refresh() on intervals too!

@cfpwastaken
Copy link
Author

A way to fix this could be an option to automatically log back in with the provided credentials if it cant connect anymore.

@cfpwastaken cfpwastaken changed the title Failed to parse timetable data from html Edupage logging out after some time Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants