BRUSSELS — The European Union still has nightmares about the mismanaged chaos of the 2015 influx of migrants and refugees, which produced horrible pictures of dead children, masses of unregistered people wandering the roads, political divisions and a significant boost to far-right populism across the Continent.

Turkey’s vow to let hundreds of thousands more leave for Europe has done more than revive those fears. It has exposed Europe’s failure to use the time bought since 2016, when it made a deal to pay Turkey to house migrants and refugees, to create a coherent migration or asylum policy.

So Europe once again finds itself in a quandary, trying to tread a line between two NATO members, Turkey and Greece, one trying to push refugees forward, the other trying to keep them out.

There is little doubt that Europe, beyond Greece, wants neither the migrants nor another crisis. European Union leaders made that clear enough this week, when they traveled to Greece to display solidarity with sometimes harsh Greek efforts by a new center-right government to keep any new migrants or refugees away.