fit-ctu-discord / honza-botner

Bot for FIT CTU Discord

Home Page:https://discord.fit.cvut.cz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] When newly accepted student tries to verify, response from api has some fields missing and trace is shown to user

stepech opened this issue · comments

return await JsonSerializer.DeserializeAsync<UsermapPerson>(

2023-06-27T23:28:02.786700+00:00 app[web.1]: fail: HonzaBotner.Controllers.AuthController[0]

2023-06-27T23:28:02.786711+00:00 app[web.1]:       Couldn't finish authentication for user id: [redacted]

2023-06-27T23:28:02.786720+00:00 app[web.1]:       System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $.personalNumber | LineNumber: 0 | BytePositionInLine: 44.

2023-06-27T23:28:02.786721+00:00 app[web.1]:        ---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.

2023-06-27T23:28:02.786722+00:00 app[web.1]:          at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(JsonTokenType tokenType)

2023-06-27T23:28:02.786722+00:00 app[web.1]:          at System.Text.Json.Utf8JsonReader.TryGetInt32(Int32& value)

2023-06-27T23:28:02.786723+00:00 app[web.1]:          at System.Text.Json.Utf8JsonReader.GetInt32()

2023-06-27T23:28:02.786723+00:00 app[web.1]:          at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)

2023-06-27T23:28:02.786726+00:00 app[web.1]:          at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)

2023-06-27T23:28:02.786727+00:00 app[web.1]:          at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)

2023-06-27T23:28:02.786728+00:00 app[web.1]:          at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)

2023-06-27T23:28:02.786732+00:00 app[web.1]:          --- End of inner exception stack trace ---

2023-06-27T23:28:02.786733+00:00 app[web.1]:          at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)

2023-06-27T23:28:02.786733+00:00 app[web.1]:          at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)

2023-06-27T23:28:02.786733+00:00 app[web.1]:          at System.Text.Json.JsonSerializer.ContinueDeserialize[TValue](ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack, JsonTypeInfo jsonTypeInfo)

2023-06-27T23:28:02.786733+00:00 app[web.1]:          at System.Text.Json.JsonSerializer.ReadFromStreamAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)

2023-06-27T23:28:02.786734+00:00 app[web.1]:          at HonzaBotner.Services.UserMapInfoService.GetUserInfoAsync(String accessToken, String userName) in /tmp/build_341447f7/src/HonzaBotner.Services/UserMapInfoService.cs:line 31

2023-06-27T23:28:02.786735+00:00 app[web.1]:          at HonzaBotner.Services.CvutAuthorizationService.AuthorizeAsync(String accessToken, String username, UInt64 userId, RolesPool rolesPool) in /tmp/build_341447f7/src/HonzaBotner.Services/CvutAuthorizationService.cs:line 53

2023-06-27T23:28:02.786735+00:00 app[web.1]:          at HonzaBotner.Controllers.AuthController.Callback() in /tmp/build_341447f7/src/HonzaBotner/Controllers/AuthController.cs:line 87