meteor/meteor · error · ServiceConfiguration.ConfigError

Service not configured

Error message

Service not configured

What it means

Thrown server-side in the meteor-developer OAuth handler's getTokens when ServiceConfiguration.configurations.findOneAsync({service:'meteor-developer'}) returns null. Standard ServiceConfiguration.ConfigError indicating the meteor-developer service credentials were never registered.

Source

Thrown at packages/meteor-developer-oauth/meteor_developer_server.js:36

  return {
    serviceData,
    options: {profile: {name: serviceData.username}}
    // XXX use username for name until meteor accounts has a profile with a name
  };
});

// returns an object containing:
// - accessToken
// - expiresIn: lifetime of token in seconds
// - refreshToken, if this is the first authorization request and we got a
//   refresh token from the server
const getTokens = async (query) => {
  const config = await ServiceConfiguration.configurations.findOneAsync({
    service: 'meteor-developer',
  });
  if (!config) {
    throw new ServiceConfiguration.ConfigError();
  }

  const body = OAuth._addValuesToQueryParams({
    grant_type: 'authorization_code',
    code: query.code,
    client_id: config.clientId,
    client_secret: OAuth.openSecret(config.secret),
    redirect_uri: OAuth._redirectUri('meteor-developer', config),
  }).toString();

  return OAuth._fetch(
    MeteorDeveloperAccounts._server + '/oauth2/token',
    'POST',
    {
      headers: {
        Accept: 'application/json',
        'Content-type': 'application/x-www-form-urlencoded',
      },

View on GitHub (pinned to 5076d2f818)

Solutions

  1. Insert/upsert the config: ServiceConfiguration.configurations.upsert({service:'meteor-developer'}, {$set:{clientId, secret, loginStyle}}).
  2. Confirm the server uses the database holding the config.
  3. Re-seed configuration on deploy.

Example fix

// before — no meteor-developer config registered

// after
import { ServiceConfiguration } from 'meteor/service-configuration';
ServiceConfiguration.configurations.upsert(
  { service: 'meteor-developer' },
  { $set: { clientId, secret, loginStyle: 'popup' } }
);
Defensive patterns

Strategy: validation

Validate before calling

import { ServiceConfiguration } from 'meteor/service-configuration';
async function meteorDevConfigured() {
  return !!(await ServiceConfiguration.configurations.findOneAsync({ service: 'meteor-developer' }));
}

Try / catch

try {
  const tokens = await getTokens(query);
} catch (err) {
  if (err instanceof ServiceConfiguration.ConfigError) {
    // admin-facing: register meteor-developer credentials
  }
  throw err;
}

Prevention

When it happens

Trigger: The meteor-developer OAuth callback fires (token exchange attempted) with no meteor-developer config document in the database.

Common situations: Forgot to seed meteor-developer credentials; config in the wrong environment/DB; config document removed.

Related errors


AI-assisted analysis of meteor/meteor@5076d2f818 (2026-08-13). Data as JSON: /api/errors/e8f99fa8e806505a. Report an issue: GitHub.