A NICE summing-up of Serbia’s foreign-policy dilemmas was shown in a recent drawing by Corax, the country’s leading political cartoonist. Aleksandar Vucic, Serbia’s prime minister, is shown playing two pianos at once, with Angela Merkel, Germany’s chancellor, conducting on one side, and Vladimir Putin, Russia’s president, conducting on the other. The Serbian government is finding the Ukraine crisis is only adding to the political cacophony.

In March Serbia abstained in a UN vote reaffirming the territorial integrity of Ukraine after Russia’s annexation of Crimea. As a candidate for European Union membership, it was heavily criticised for this by its partners. Officially the reason was that Serbia had only a caretaker government. But the real reason was that it did not want to annoy its traditional ally, Russia.

Since then Serbia has desperately tried to please both sides. Now its government is clear that, just as Kosovo should be part of Serbia, so Crimea should be part of Ukraine. But much of the press and many Russophile Serbs disagree. A website with contacts for those who want to fight with pro-Russian rebels in eastern Ukraine says that the “liberation” of Kosovo is not possible without the liberation of Novorossiya, as the rebels call their territory.

The number of Serbs fighting in Ukraine may be no more than 100, but their alleged exploits are widely reported. Mr Vucic calls them mercenaries who are “harmful” to Serbia. Legislation is being drawn up making it illegal to fight in foreign wars. That would also cover Serbian citizens who are ethnic Albanians or Bosniaks and have become jihadists in Syria and Iraq. Yet Serbian soldiers still train with both Russian and NATO troops (Serbia is in NATO’s “partnership for peace”, but is not a candidate for membership).

Candidates to join the EU are supposed to align their foreign policy with it. Thus Montenegro has imposed sanctions on Russia. But Serbia has refused to do so: it would cause enormous damage, growls Russia’s ambassador in Belgrade. Now Brussels is telling the Serbian government it must not profit from Russia’s ban on imports of certain agricultural and dairy products from the EU. Croatian companies hit by the ban are reportedly investigating if they can relabel their products as Serbian.

Energy is another source of tension. For years the prospect of South Stream, a pipeline to export Russian gas that would pass through Serbia, has shimmered like a mirage ahead. It would bring jobs and cash as well as gas to parts of the country that need them. Now it is unclear if it will ever happen. Under pressure from the European Commission, the Bulgarian government has just suspended its part of the project.

If EU leaders are irritated by Serbia, so are the Russians. Russia’s Gazprom Neft has a 51% stake in NIS, Serbia’s main oil company. On August 11th it was revealed that the police were investigating the 2008 privatisation of NIS. Mr Vucic has implied that the Russians understand that this is domestic political score-settling. Yet the Russians are clearly furious. They were said to have got fantastic terms for the deal after siding with Serbia over Kosovo.

Mr Vucic will go on trying to satisfy both conductors. As long as he causes no problems in Kosovo, says Dimitar Bechev of the London School of Economics, the West will forgive him. He adds that it is hard to be tough on Serbia for selling Russia raspberries when France is selling it warships. Yet Serbia must eventually lean the EU’s way to protect its candidacy.

Meanwhile in Kosovo, whose security is provided by a NATO-led force, most of Ukraine’s 160 troops are pulling out. They have more urgent business than helping to protect Kosovo’s Serbs.