langrenn-sprint / event-service

Backend service to adminster events, will generate racelists etc
Apache License 2.0
0 stars 0 forks source link

500 feil ved innlasting av deltakere #126

Closed heming-langrenn closed 1 year ago

heming-langrenn commented 1 year ago

Generer klasser returnerer en error når generer klasser kjøres med deltakere i vedlagte fil. Tilsynelatende ser alt riktig ut i frontend. Kan det være en falsk 500 error?

url = f"{EVENT_SERVICE_URL}/events/{event_id}/generate-raceclasses" ERROR:root:generate_classes failed - 500 - {'detail': "invalid literal for int() with base 10: 'J'"}

Testdata i vedlagt fil. Deltakerliste Excel_eventid_371300-2.csv

TRACE: event-service_1 | {"message": "inserted raceclass with event_id/raceclass_id: 789ec598-a279-4e74-b661-e4dc91dba02e/03065cf3-a73f-424b-bea0-90e0fbc6bc51", "severity": "DEBUG", "serviceContext": {"service": "event-service"}} event-service_1 | {"message": "inserted raceclass with event_id/raceclass_id: 789ec598-a279-4e74-b661-e4dc91dba02e/0d8b1fa5-7206-4601-8f94-b1a98214a451", "severity": "DEBUG", "serviceContext": {"service": "event-service"}} event-service_1 | {"message": "invalid literal for int() with base 10: 'J'", "exc_info": "Traceback (most recent call last):\n File \"/usr/local/lib/python3.10/site-packages/aiohttp_middlewares/error.py\", line 210, in middleware\n return await handler(request)\n File \"/usr/local/lib/python3.10/site-packages/aiohttp/web_urldispatcher.py\", line 954, in _iter\n resp = await method()\n File \"/app/event_service/views/events_commands.py\", line 47, in post\n await EventsCommands.generate_raceclasses(db, event_id)\n File \"/app/event_service/commands/events_commands.py\", line 80, in generate_raceclasses\n _raceclasses_sorted = sorted(\n File \"/app/event_service/commands/events_commands.py\", line 82, in \n key=lambda k: (int(k.name[1:].split(\"/\")[0]), k.name[:1]),\nValueError: invalid literal for int() with base 10: 'J'", "severity": "ERROR", "serviceContext": {"service": "event-service"}}