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

(Backend) - Bad Request When App Loads Users Without Photos #2366

Open
mjperry91 opened this issue May 13, 2024 · 1 comment
Open

(Backend) - Bad Request When App Loads Users Without Photos #2366

mjperry91 opened this issue May 13, 2024 · 1 comment

Comments

@mjperry91
Copy link
Collaborator

When logging in or opening various pages that load users you may occasionally run into a bad request in the server logs when a user does not have an image. Since it is possible for a user to have no image, then the end point handling this should not throw a bad request. Note: The service does seem to recover from this error so likely low priority.

  1. Start app with fresh database
  2. Login (Other tabs such as Admin/Roles has this issue as well)
  3. Observe Error
10:03:01.868 [io-executor-thread-21] INFO  c.o.c.s.m.m.MemberPhotoServiceImpl - No photo was found for: undefined
10:03:01.868 [io-executor-thread-28] INFO  c.o.c.s.m.m.MemberPhotoServiceImpl - No photo was found for: testing@objectcomputing.com
10:03:01.886 [io-executor-thread-22] INFO  c.o.c.s.m.m.MemberPhotoServiceImpl - No photo was found for: testing2@objectcomputing.com
10:03:02.126 [io-executor-thread-27] ERROR c.o.c.s.m.m.MemberPhotoServiceImpl - An unexpected error occurred while retrieving photo from Google Directory API for: smithj@objectcomputing.com
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
GET https://www.googleapis.com/admin/directory/v1/users/smithj@objectcomputing.com/photos/thumbnail
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Type not supported: userKey",
    "reason" : "badRequest"
  } ],
  "message" : "Type not supported: userKey"
}
        at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:444)
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1111)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:542)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:475)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:592)
        at com.objectcomputing.checkins.services.memberprofile.memberphoto.MemberPhotoServiceImpl.getImageByEmailAddress(MemberPhotoServiceImpl.java:56)
        at com.objectcomputing.checkins.services.memberprofile.memberphoto.$MemberPhotoServiceImpl$Definition$Intercepted.$$access$$getImageByEmailAddress(Unknown Source)
        at com.objectcomputing.checkins.services.memberprofile.memberphoto.$MemberPhotoServiceImpl$Definition$Exec.dispatch(Unknown Source)
@mjperry91 mjperry91 changed the title Bad Request When App Loads Users Without Photos (Backend) - Bad Request When App Loads Users Without Photos May 14, 2024
@timyates
Copy link
Collaborator

timyates commented Jun 4, 2024

I'm not sure what it causing this 🤔

We are seeing users with no photo correctly returning a 404 from the Google API and logging

No photo was found for: xxxxxx

But then we have 4 users in the dev dataload who are returning a 400 error consistently; sharma, smith, steinkamp and meyerin

I wonder if their accounts were partially closed in google, or there's something I can't see that they have in common that other email addresses that are also not in google (but return a 404 correctly) have 🤔

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

2 participants