Error sending report to Apollo servers: HTTP status 406, Please check your API key in the Engine configuration

Hi,
I keep seeing these on my server logs, not too sure why since I set APOLLO_SCHEMA_REPORTING variable to false:

Error sending report to Apollo servers: HTTP status 406, Please check your API key in the Engine configuration

Any idea why this is going on?
Thanks in advance for your help

Can you share your server configuration? It sounds like you have usage reporting enabled but no valid GraphOS configuration (none or invalid API key).

Sure, here it is:

export async function startApolloServer(httpServer: any) {
  const server = new ApolloServer({
    schema: schema,
    introspection: config.APP_ENV === "prod" ? false : true,
    csrfPrevention: true,
    plugins: [
      ApolloServerPluginCacheControl({}),
      responseCachePlugin({
        sessionId: async (requestContext: any) => {
          return requestContext?.contextValue?.user?.id || null;
        },
      }),
      LogPlugin(),
      ApolloServerPluginInlineTrace(),
      ApolloServerPluginDrainHttpServer({ httpServer }),
      ApolloServerPluginLandingPageDisabled(),
      FlyPlugin(),
    ],
    formatError: (err: GraphQLFormattedError) => {
      if (err?.message?.includes("PreventCommandIfReadOnly")) {
        // console.error("formatError", err);
        return new Error("");
      } else if (err?.message.includes("ConnectorError")) {
        return new Error("");
      } else if (err?.message.includes("Can't reach database server")) {
        console.error("formatError cant reach", err);
        return new Error("Internal server error");
      } else if (err.message.includes("prisma")) {
        console.error("formatError", err);
        return new Error("Internal server error");
      } else if (err.message.includes("database")) {
        console.error("formatError", err);
        return new Error("Internal server error");
      } else if (err.message.includes("db")) {
        console.error("formatError", err);
        return new Error("Internal server error");
      }
      return err;
    },
  });
  await server.start();
  return server;
}

Are you running this as a subgraph? If not, you don’t need ApolloServerPluginInlineTrace - that’s for sending metrics to router/gateway.

Are you providing an APOLLO_KEY? That will enable the usage reporting plugin by default. If you’re providing an invalid APOLLO_KEY key to Apollo Server I would expect this error.

Hopefully this is helpful: