mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 14:33:00 +00:00
add debug logging for adding users with no running server
in check_routes, it has been reported that users without a running server are attempted to be added. So something is wrong, either in sqlalchemy or my understanding of what it does (likely the latter), because a filter for users with a non-None server is returning at least one result whose server is None.
This commit is contained in:
@@ -228,8 +228,13 @@ class Proxy(Base):
|
|||||||
futures = []
|
futures = []
|
||||||
db = inspect(self).session
|
db = inspect(self).session
|
||||||
for user in db.query(User).filter(User.server != None):
|
for user in db.query(User).filter(User.server != None):
|
||||||
|
if user.server is None:
|
||||||
|
# This should never be True, but seems to be on rare occasion.
|
||||||
|
# catch filter bug, either in sqlalchemy or my understanding of its behavior
|
||||||
|
self.log.error("User %s has no server, but wasn't filtered out.", user)
|
||||||
|
continue
|
||||||
if user.name not in have_routes:
|
if user.name not in have_routes:
|
||||||
self.log.warn("Adding missing route for %s", user.name)
|
self.log.warning("Adding missing route for %s (%s)", user.name, user.server)
|
||||||
futures.append(self.add_user(user))
|
futures.append(self.add_user(user))
|
||||||
for f in futures:
|
for f in futures:
|
||||||
yield f
|
yield f
|
||||||
|
Reference in New Issue
Block a user