Konstantin Chernenko, the principal rival of Soviet leader Yuri Andropov in the struggle for the party leadership last November, failed today to appear at a major Kremlin ceremony. This prompted speculation that Chernenko is either gravely ill or in equally serious political trouble.

There was no official explanation for Chernenko's absence today or on two previous important public functions. He was last seen on March 30 attending a ceremony marking the 100th anniversary of Karl Marx's death.

The 71-year-old Chernenko, one of the closest political associates of the late Leonid Brezhnev, was eclipsed politically in the succession struggle following Brezhnev's death in November. Chernenko not only lost to Andropov but also was obliged to nominate his rival for the leadership post.

Since then, Chernenko has not been a member of the new inner leadership although he was theoretically the second secretary of the party in charge of ideology.

Significantly, however, he has made no pronouncements on ideological issues since Brezhnev's death. It was expected that he would be the keynote speaker at the March 30 Marx ceremony, but that role was assumed by Boris Ponomarev, an alternate Politburo member.

Chernenko then failed to take part in a Marx conference in East Germany two weeks ago, although the East Germans had said in advance that he would be the chief Soviet representative at the meeting.

Last week, Chernenko was the only Politburo member missing at a major Central Committee conference devoted to agricultural and economic issues. Today, he was the only Moscow-based member of the ruling body missing from a leadership lineup at one of the most important events of the Soviet political calendar, the anniversary of Lenin's birth.

The possibility that Chernenko is ill could not be excluded, although in the past he had stood out as one of the healthiest and most robust members of the ruling group.

While Andropov seems clearly in firm control of Soviet domestic and foreign policies, diplomats here have viewed Chernenko as a potential focal point of Andropov's opponents within the party bureaucracy, particularly those who resent the new leadership's attempts to expel the corrupt and incompetent.

Although there were no signs of overt opposition to Andropov, some senior officials closely associated with Brezhnev or promoted by him were said to be looking to Chernenko as an alternative should the new leadership falter.

So far, Andropov has made extensive personnel changes in the governmental bureaucracy but has not purged any official in the political leadership. It is clear, however, that such Brezhnev proteges as Chernenko, Premier Nikolai Tikhonov, Politburo member Dinmukhamed Kunaev and others are no longer within the inner leadership and exert no influence on the shaping of policy.

The keynote speaker at today's ceremony was Mikhail Gorbachov, 52, the youngest Politburo member.