symfony/translation · error · UnsupportedSchemeException

The scheme is not supported by any provider.

Error message

The scheme is not supported by any provider.

What it means

Thrown by TranslationProviderCollectionFactory::fromDsnObject() when no registered provider factory supports the Dsn's scheme. It produces UnsupportedSchemeException with a default message indicating the scheme is not supported by any provider.

Solutions

  1. Install the matching provider package: composer require symfony/<provider>-translation-provider
  2. Check the DSN scheme spelling in TRANSLATION_PROVIDER_DSN
  3. List supported schemes via each factory's getSupportedSchemes() to confirm

Example fix

// before
TRANSLATION_PROVIDER_DSN=loco://default  # loco provider not installed
// after
composer require symfony/loco-translation-provider
TRANSLATION_PROVIDER_DSN=loco://API_KEY@default
Defensive patterns

Strategy: validation

Validate before calling

$supported = array_merge(...array_map(fn($f) => $f->getSupportedSchemes(), $factories));
if (!in_array($dsn->getScheme(), $supported, true)) {
    throw new \InvalidArgumentException("Scheme {$dsn->getScheme()} unsupported; install the provider package.");
}

Try / catch

try {
    $collection = $factory->fromConfig($config, $locales, $domains);
} catch (UnsupportedSchemeException $e) {
    // report that the DSN scheme has no installed provider factory
}

Prevention

When it happens

Trigger: Calling fromDsnObject/fromConfig with a DSN whose scheme no factory's supports() accepts — e.g. an unknown or misspelled scheme, or a factory package not installed.

Common situations: Using a provider package that is not composer-installed (e.g. symfony/loco-translation-provider missing), typo in DSN scheme, or a DSN scheme like 'http://' that no translation provider supports.

Related errors


AI-assisted analysis of symfony/translation@ae9e8a51bc (2026-09-15). Data as JSON: /api/errors/7e26f29e2d85a451. Report an issue: GitHub.

Appendix: source

Thrown at Provider/TranslationProviderCollectionFactory.php:52

            $providers[$name] = $this->fromDsnObject(
                new Dsn($currentConfig['dsn']),
                !$currentConfig['locales'] ? $this->enabledLocales : $currentConfig['locales'],
                !$currentConfig['domains'] ? [] : $currentConfig['domains']
            );
        }

        return new TranslationProviderCollection($providers);
    }

    public function fromDsnObject(Dsn $dsn, array $locales, array $domains = []): ProviderInterface
    {
        foreach ($this->factories as $factory) {
            if ($factory->supports($dsn)) {
                return new FilteringProvider($factory->create($dsn), $locales, $domains);
            }
        }

        throw new UnsupportedSchemeException($dsn);
    }
}

View on GitHub (pinned to ae9e8a51bc)