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

Requesting too many lessons causes server to ignore the request #31

Open
doppelkorn opened this issue Sep 22, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@doppelkorn
Copy link

doppelkorn commented Sep 22, 2024

Sup, just like the title suggests, the timetable fetching appears borked. No wonder since the WebUntis authors constantly change stuff around.

In order to reproduce:

  1. Grab latest build directly from the GitHub CI, environment variables all set to the according credents
  2. Boot container, try to access any lesson or timetable
  3. Error appears in console, server returns generic 500 error

Docker logs are as following:

untis-server-1  | [Nest] 1  - 09/22/2024, 9:10:10 PM   DEBUG [UntisService] No cache for TIMETABLE.1 exists.
untis-server-1  | [Nest] 1  - 09/22/2024, 9:10:11 PM   DEBUG [UntisService] Session is invalid. Renewing now...
untis-server-1  | [Nest] 1  - 09/22/2024, 9:10:11 PM     LOG [UntisService] Fetching timetable range 9/15/2024 to 10/6/2024...
untis-server-1  | [Nest] 1  - 09/22/2024, 9:10:11 PM    WARN [ExpressAdapter] Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses
untis-server-1  | [Nest] 1  - 09/22/2024, 9:10:11 PM   ERROR [ExceptionsHandler] Server didn't return any result.
untis-server-1  | Error: Server didn't return any result.
untis-server-1  |     at Queue.onFailed (/app/node_modules/bull/lib/job.js:516:18)
untis-server-1  |     at Queue.emit (node:events:518:28)
untis-server-1  |     at module.exports.emitSafe (/app/node_modules/bull/lib/utils.js:50:20)
untis-server-1  |     at EventEmitter.messageHandler (/app/node_modules/bull/lib/queue.js:476:15)
untis-server-1  |     at EventEmitter.emit (node:events:518:28)
untis-server-1  |     at DataHandler.handleSubscriberReply (/app/node_modules/ioredis/built/DataHandler.js:80:32)
untis-server-1  |     at DataHandler.returnReply (/app/node_modules/ioredis/built/DataHandler.js:47:18)
untis-server-1  |     at JavascriptRedisParser.returnReply (/app/node_modules/ioredis/built/DataHandler.js:21:22)
untis-server-1  |     at JavascriptRedisParser.execute (/app/node_modules/redis-parser/lib/parser.js:544:14)
untis-server-1  |     at Socket.<anonymous> (/app/node_modules/ioredis/built/DataHandler.js:25:20)

OS: openSUSE Leap 15.5
Docker Version: Docker version 24.0.7-ce
Untis-ics-version: 0.7.2

If you need any further info I will provide it to you asap

@bddvlpr
Copy link
Owner

bddvlpr commented Sep 22, 2024

As of recently Untis started combatting applications like mine by setting a secret limit as to the amount of classes you can fetch and will just randomly return with an empty body if you try to request over an unlisted amount of lessons. I had a 'workaround' on this that would fetch the lessons in separate requests but still all at once that I might bring back soon.

For the time being I suggest you put down the LESSONS_TIMETABLE_BEFORE and LESSONS_TIMETABLE_AFTER to a smaller number until it stops erroring. As I currently don't have access to a WebUntis instance I cannot work on it for a while, I'm in the process of trying to get access to a server in the meantime.

@bddvlpr bddvlpr added the bug Something isn't working label Sep 22, 2024
@bddvlpr bddvlpr pinned this issue Sep 22, 2024
@bddvlpr bddvlpr changed the title Timetable fetching appears broken Requesting too many lessons causes server to ignore the request Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants