Fixed #23556 -- Raise a more meaningful error message when migrations refer to an unavailable node

https://code.djangoproject.com/ticket/23556