This error is unlikely to be related to the connection that you have with SQL Server.
The more likely cause is that somewhere in your app, you're displaying a photo via an Office365Users connection and the userId of the user that you want to display no longer exists. Could you share some more info about where you're using Office365Users in your app?
I haven't published the app yet, so I'm the only one working on it. I started with the Leave Request template. It may have connected to my Office365 users group. This is my 1st attempt at an app, so I'm a little over my head, but interested in learning.