Error in /api/event/:id
Closed this issue · 7 comments
http://de.serlo.localhost:4567/api/event/65 returns the following error:
Fatal error: Uncaught Error: Call to a member function getId() on null in /usr/local/apache2/htdocs/src/module/Api/src/Manager/NotificationApiManager.php:236 Stack trace: #0 /usr/local/apache2/htdocs/src/module/Api/src/Manager/NotificationApiManager.php(100): Api\Manager\NotificationApiManager->normalizeEvent(Object(Event\Entity\EventLog)) #1 /usr/local/apache2/htdocs/src/module/Api/src/Manager/NotificationApiManager.php(95): Api\Manager\NotificationApiManager->getEventData(Object(Event\Entity\EventLog)) #2 /usr/local/apache2/htdocs/src/module/Api/src/Controller/NotificationApiController.php(57): Api\Manager\NotificationApiManager->getEventDataById(65) #3 /usr/local/apache2/htdocs/src/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(82): Api\Controller\NotificationApiController->eventAction() #4 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent)) #5 /usr/local/apache2/htdocs/src/vendor/zendframework/zendframework/library/Zend/E in /usr/local/apache2/htdocs/src/module/Api/src/Manager/NotificationApiManager.php on line 236
I have investigated this issue yesterday (It is a blocker for #508 ): The endpoint /api/event/:id
returns a fatal error for the following event ids:
[65,
48090,
49708,
52563,
55654,
55749,
55749,
55749,
55749,
61577,
62490,
62801,
62812,
63970,
63975,
65623,
65623,
65623,
65623,
67830,
67836,
67842,
67848,
67857,
67860,
67863,
67875,
67881,
67885,
67888,
67891,
67895,
67899,
67903,
67944,
67945,
68072,
68082,
74516,
78948,
86280,
86286,
86289,
86292,
86295,
86298,
86301,
86304,
86330,
86333,
97864,
99167,
99173,
99176,
99179,
99182,
99189,
99194,
99198,
99201,
120418,
120424,
120427,
120430,
120433,
120436,
132131,
136576,
136584,
279745]
The following event types are affected:
['CreateTaxonomyLinkNotificationEvent',
'SetTaxonomyParentNotificationEvent',
'RemoveTaxonomyLinkNotificationEvent']
CreateTaxonomyLinkNotificationEvent (59 events)
All of them have no child associated to them -> I guess this is due to entities which were deleted from the trash. List of events:
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Legacy
actorId: 6
childId: null
date: '2014-03-01T20:36:39+01:00'
id: 65
instance: de
parent: Blog
parentId: 8
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2014-03-27T15:00:12+01:00'
id: 48090
instance: de
parent: "L\xF6sungsvorschl\xE4ge zu Original-Abituraufgaben"
parentId: 20979
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2014-03-29T18:03:55+01:00'
id: 49708
instance: de
parent: '2011'
parentId: 21006
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Simon
actorId: 10
childId: null
date: '2014-04-03T10:04:41+02:00'
id: 52563
instance: de
parent: Addition
parentId: 1292
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Dion
actorId: 24820
childId: null
date: '2014-05-08T12:51:12+02:00'
id: 61577
instance: de
parent: "Aufgaben und L\xF6sungen"
parentId: 17295
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2014-05-31T20:15:10+02:00'
id: 62490
instance: de
parent: Was ist Chemie
parentId: 18232
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Simon
actorId: 10
childId: null
date: '2014-06-02T17:17:48+02:00'
id: 62801
instance: de
parent: Community-Seiten
parentId: 25341
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2014-06-02T17:30:44+02:00'
id: 62812
instance: de
parent: Community-Seiten
parentId: 25341
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2014-06-27T08:57:52+02:00'
id: 63970
instance: de
parent: Allgemeines
parentId: 23243
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Nessa
actorId: 26175
childId: null
date: '2014-08-25T11:22:31+02:00'
id: 67830
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Petz
actorId: 27694
childId: null
date: '2014-08-25T11:22:31+02:00'
id: 67836
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: LorenzHuber
actorId: 27687
childId: null
date: '2014-08-25T11:22:36+02:00'
id: 67842
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Henry
actorId: 27691
childId: null
date: '2014-08-25T11:22:37+02:00'
id: 67848
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Amadeus
actorId: 27688
childId: null
date: '2014-08-25T11:24:02+02:00'
id: 67857
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Katha26
actorId: 27692
childId: null
date: '2014-08-25T11:24:09+02:00'
id: 67860
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Nish
actorId: 27693
childId: null
date: '2014-08-25T11:24:09+02:00'
id: 67863
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: philipp_gadow
actorId: 27689
childId: null
date: '2014-08-25T11:25:45+02:00'
id: 67875
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: roehren
actorId: 22573
childId: null
date: '2014-08-25T11:26:14+02:00'
id: 67881
instance: de
parent: Sonstiges
parentId: 1397
- __typename: CreateTaxonomyLinkNotificationEvent
actor: philer
actorId: 25163
childId: null
date: '2014-08-25T11:27:03+02:00'
id: 67885
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: mats
actorId: 27393
childId: null
date: '2014-08-25T11:27:39+02:00'
id: 67888
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: inyono
actorId: 15473
childId: null
date: '2014-08-25T11:28:01+02:00'
id: 67891
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Hannes
actorId: 324
childId: null
date: '2014-08-25T11:29:16+02:00'
id: 67895
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: daFischer
actorId: 27690
childId: null
date: '2014-08-25T11:33:36+02:00'
id: 67899
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: wolfgang
actorId: 18981
childId: null
date: '2014-08-25T11:36:35+02:00'
id: 67903
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: roehren
actorId: 22573
childId: null
date: '2014-08-25T11:56:41+02:00'
id: 67945
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: inyono
actorId: 15473
childId: null
date: '2014-08-26T08:40:50+02:00'
id: 68072
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: inyono
actorId: 15473
childId: null
date: '2014-08-26T08:46:00+02:00'
id: 68082
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: LorenzHuber
actorId: 27687
childId: null
date: '2014-09-12T08:11:23+02:00'
id: 74516
instance: de
parent: Aufgaben zu Hypothesentests
parentId: 25632
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2014-10-03T11:27:46+02:00'
id: 78948
instance: de
parent: Allgemeines rund um Serlo
parentId: 23847
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Knorrke
actorId: 34105
childId: null
date: '2015-03-02T11:56:00+01:00'
id: 86280
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Amadeus
actorId: 27688
childId: null
date: '2015-03-02T11:56:09+01:00'
id: 86286
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tobias
actorId: 35489
childId: null
date: '2015-03-02T11:56:16+01:00'
id: 86289
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Christina
actorId: 35488
childId: null
date: '2015-03-02T11:56:17+01:00'
id: 86292
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Henry
actorId: 27691
childId: null
date: '2015-03-02T11:56:25+01:00'
id: 86295
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Hannes
actorId: 324
childId: null
date: '2015-03-02T11:56:27+01:00'
id: 86298
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Severin_Tengler
actorId: 35487
childId: null
date: '2015-03-02T11:56:27+01:00'
id: 86301
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: MarinaMarek
actorId: 35486
childId: null
date: '2015-03-02T11:56:28+01:00'
id: 86304
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Drinc
actorId: 35485
childId: null
date: '2015-03-02T12:17:37+01:00'
id: 86330
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: EnRico
actorId: 35492
childId: null
date: '2015-03-02T12:18:30+01:00'
id: 86333
instance: de
parent: Zum Testen
parentId: 25107
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2015-06-26T20:40:40+02:00'
id: 97864
instance: de
parent: Elektrostatik, ruhende Ladungen
parentId: 41317
- __typename: CreateTaxonomyLinkNotificationEvent
actor: JonasBl
actorId: 40928
childId: null
date: '2015-08-24T11:19:46+02:00'
id: 99167
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Wachter
actorId: 42102
childId: null
date: '2015-08-24T11:19:55+02:00'
id: 99173
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: RaphaelUllmann
actorId: 42098
childId: null
date: '2015-08-24T11:19:59+02:00'
id: 99176
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: peterjaumann
actorId: 42099
childId: null
date: '2015-08-24T11:21:18+02:00'
id: 99179
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: fischthi
actorId: 42103
childId: null
date: '2015-08-24T11:22:44+02:00'
id: 99182
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: fade
actorId: 42100
childId: null
date: '2015-08-24T11:33:14+02:00'
id: 99189
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: gleissl
actorId: 42097
childId: null
date: '2015-08-24T11:58:00+02:00'
id: 99194
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: VeronikaWidhopf
actorId: 42101
childId: null
date: '2015-08-24T11:59:21+02:00'
id: 99198
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Benjamin
actorId: 42113
childId: null
date: '2015-08-24T11:59:30+02:00'
id: 99201
instance: de
parent: Summer Academy
parentId: 27695
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Marvin
actorId: 52729
childId: null
date: '2016-03-07T12:49:19+01:00'
id: 120418
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: niklasgee
actorId: 52730
childId: null
date: '2016-03-07T12:49:23+01:00'
id: 120424
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: tobi_serlo
actorId: 52731
childId: null
date: '2016-03-07T12:49:24+01:00'
id: 120427
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: deborah
actorId: 52733
childId: null
date: '2016-03-07T12:49:29+01:00'
id: 120430
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: dominiklechner
actorId: 52732
childId: null
date: '2016-03-07T12:49:30+01:00'
id: 120433
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: theo
actorId: 52735
childId: null
date: '2016-03-07T12:51:03+01:00'
id: 120436
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: peterjaumann
actorId: 42099
childId: null
date: '2016-06-17T13:28:30+02:00'
id: 132131
instance: de
parent: Aufgaben zum Ausklammern
parentId: 24492
- __typename: CreateTaxonomyLinkNotificationEvent
actor: Nauran
actorId: 61445
childId: null
date: '2016-08-29T11:24:25+02:00'
id: 136576
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: vivian_haller
actorId: 61446
childId: null
date: '2016-08-29T11:33:21+02:00'
id: 136584
instance: de
parent: Spring Academy 2016
parentId: 52772
- __typename: CreateTaxonomyLinkNotificationEvent
actor: kathongi
actorId: 73435
childId: null
date: '2019-08-21T07:30:49+02:00'
id: 279745
instance: de
parent: Alle Veranstaltungen
parentId: 142220
SetTaxonomyParentNotificationEvent (9 events)
Here the parent was set to the string "no parent"
instead of an uuid. It seems that those are special sites without a parent or this is due to a bug (all events are from the same date):
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Hilfeseiten
childId: 21396
date: '2014-04-24T09:19:41+02:00'
id: 55654
instance: de
parent: null
parentId: no parent
previousParentId: 3
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Hilfeseiten
childId: 21396
date: '2014-04-24T09:57:15+02:00'
id: 55749
instance: de
parentId: null
previousParentId: no parent
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Hilfeseiten
childId: 21396
date: '2014-04-24T09:57:15+02:00'
id: 55749
instance: de
parentId: null
previousParentId: no parent
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Hilfeseiten
childId: 21396
date: '2014-04-24T09:57:15+02:00'
id: 55749
instance: de
parentId: null
previousParentId: no parent
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Hilfeseiten
childId: 21396
date: '2014-04-24T09:57:15+02:00'
id: 55749
instance: de
parentId: null
previousParentId: no parent
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Diskussionen bei Profilen
childId: 26585
date: '2014-07-24T09:08:07+02:00'
id: 65623
instance: de
parentId: null
previousParentId: no parent
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Diskussionen bei Profilen
childId: 26585
date: '2014-07-24T09:08:07+02:00'
id: 65623
instance: de
parentId: null
previousParentId: no parent
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Diskussionen bei Profilen
childId: 26585
date: '2014-07-24T09:08:07+02:00'
id: 65623
instance: de
parentId: null
previousParentId: no parent
- __typename: SetTaxonomyParentNotificationEvent
actor: Simon
actorId: 10
child: Diskussionen bei Profilen
childId: 26585
date: '2014-07-24T09:08:07+02:00'
id: 65623
instance: de
parentId: null
previousParentId: no parent
RemoveTaxonomyLinkNotificationEvent
Here the child id is null. Maybe because the uuid was deleted in the meanwhile?!
- __typename: RemoveTaxonomyLinkNotificationEvent
actor: Tinsaye
actorId: 396
childId: null
date: '2014-06-27T09:30:10+02:00'
id: 63975
instance: de
parent: Allgemeines
parentId: 23243
- __typename: RemoveTaxonomyLinkNotificationEvent
actor: roehren
actorId: 22573
childId: null
date: '2014-08-25T11:56:41+02:00'
id: 67944
instance: de
parent: Sonstiges
parentId: 1397
This seems like an oversight in the "clear dead UUIDs" function. I can look into that since I need to do another tweak anyways.
This seems like an oversight in the "clear dead UUIDs" function. I can look into that since I need to do another tweak anyways.
Fix in #531. Another alternative is to alter the database (e.g. delete the event parameters where parent is set to "no parent" or delete events where the child is null).