On May 1, 2004, Poland, Hungary and six other former communist countries joined the European Union. Citizens of the new member states marked the occasion with celebrations.

I remember vividly how the Polish delegation to the E.U. threw a wonderful party in Brussels. The dancing, singing and drinking lasted well into the early hours. You could really sense the relief and joy felt by Poles and non-Poles. Joining the E.U. was about making Europe peaceful, united and free.

How times have changed. Today the Polish government is under the control of the nationalist conservative Law and Justice Party, which is revealing increasingly illberal inclinations. In Hungary, Viktor Orban’s Fidesz party has increasingly undermined democratic institutions. Both countries are now at loggerheads with the E.U. It could hardly be otherwise. Both appear determined to pursue their own nationalist agendas and power politics even if they clash with E.U. values.

“It seems to me that all the values that the E.U. stands for are up for grabs,” said Jacek Kucharczyk, president of the Institute of Public Affairs in Warsaw. “Just look at the backsliding taking place in Poland and Hungary. And what is Brussels doing? It’s toothless. It doesn’t even defend its own values at home.”

There have been some halfhearted attempts to rectify matters. A little over a year ago, Frans Timmermans, the European Commission official who is responsible for member states abiding by E.U. law, issued an opinion about the rule of law in Poland, and specifically government’s decision to curb the independence of the Constitutional Court and its judges. It stated that there was a systemic risk to the rule of law in Poland. But this was just a first step. And little has happened since then.

However well-intentioned Timmermans’s move, Law and Justice’s decision to rein in the Constitutional Court is the tip of the iceberg. Its leader, Jaroslaw Kaczynski, seems determined to purge the media of critics, to rewrite history books so that they will sideline the role of Lech Walesa (the former leader of the Solidarity movement that brought down the communist regime) and to recall and demote talented ambassadors and diplomats who were not supporters of his party.

“The E.U. could in theory go much further,” Kucharczyk said. “But it won’t. The other member states would block any kind of sanctions.” Ironically, Polish public opinion might well approve of E.U. action. Polls taken shortly after Timmermans issued his opinion showed that 42 percent of Poles regarded the Commission’s opinion as justified, while 34 percent said it was not.

As for Hungary, the Commission has been more than reluctant to challenge Orban. Since taking power in 2010, Orban has been deftly consolidating Fidesz’s power over the media, the economy and the courts. He challenged the Commission when its president, Jean-Claude Juncker, proposed that each member state accept a certain quota of refugees fleeing the war in Syria and Iraq. Orban was having none of that. In late 2015, he built a wire fence along Hungary’s border with Serbia.

As he eyes the 2018 elections — and a third term — Orban is trying to curb the influence of foreign-funded non-governmental organizations. His latest target is the Central European University, which was founded by the philanthropist and financier George Soros. Yet his attempts to close the university have even tested the patience of the European People’s Party. The EPP is the largest and most influential European-level political party of the center-right and the largest grouping in the European Parliament. One of its most important members is Chancellor Angela Merkel’s Christian Democratic Union party.

Despite Orban’s hostile criticism of Merkel’s decision in 2015 to take in more than 1 million refugees, the EPP remained silent. The reason is that many center-right parties in the EPP support Orban’s stance on refugees, not Merkel’s. One EPP member, who requested anonymity, said: “For EPP members, Orban was basically right about migration. That’s his biggest selling point in the EPP.” Yet now, says the member, the mood within the group has moved strongly against Orban.

Siegfried Muresan, EPP spokesman, said in a statement that on April 29, the “EPP will discuss and assess the situation with Fidesz and in Hungary … If this situation with Hungary continues, Article 7 might be put on the table.”

Article 7 of the E.U. treaty is designed to defend the E.U.’s core values of democracy, freedom, human rights and the rule of law. If the E.U. notices “a serious and persistent breach” of these values, it can activate Article 7. A country’s voting rights in the E.U. council that represents the 28 (including the United Kingdom) member states, or even its access to the single market, could be suspended. But such measures require consensus from all member states to slap on sanctions. Despite that, on April 26, EU Commission Vice President Valdis Dombrovskis said Hungary’s new laws on higher education were not compatible with academic freedoms. “We have decided to take legal action on the higher education law by sending a letter of formal notice to the Hungarian government,” Dombrovskis said.

The E.U., if it chose to use its soft power, has other options. It could withhold the structural funds designed for infrastructure modernization — a sum that amounts to 4 percent of Hungary’s GDP. “The E.U. could also do much more to support civil society organizations and small communities and speak out about corruption,” said Istvan Gyarmati, political science professor and former Hungarian diplomat. “Under this government, corruption is now part of the social network. Because of the neglect of the health and education system, you have to be corrupt and give bribes. If you want to do die, go to hospital,” he added. Perhaps it’s time that Juncker and Timmermans took notice.