"Der Dienst leitet an … um" (The service redirects to …): The connection fails at a redirect
A connection or query fails with SQLSTATE 08S01 and the message “Der Dienst leitet an <Ziel> um.
Der Treiber folgt keiner Umleitung an einen anderen Rechner, Port oder ein anderes Schema, damit die
Anmeldung nicht dorthin gelangt.” (The service redirects to <target>. The driver follows no redirect
to another host, port, or scheme, so that the sign-in doesn't get there.) Access usually shows only
“ODBC–connection to … failed” (3151); the message is then in the trace.
Environment
Driver version 0.7.0 or later. The service, or a proxy in front of it, answers a request
with an HTTP redirect (301, 302, 303, 307, 308) to an address with a different scheme,
host, or port – often a redirect from http to https or from an old to a new server name. Up to
version 0.6.0, the driver followed such redirects and took the key and session along.
Cause
The driver sends credentials only to the addresses that the connection names. A redirect to another origin is named by the service, not by the connection; following it would mean sending a key or session to a peer that nobody has declared trusted. The driver therefore stops. It still follows a redirect to the same scheme, host, and port when reading.
Resolution
- Read the target from the message or the trace.
- Enter the target address as
URLin the connection or the data source if it's the right service – for examplehttps://instead ofhttp://, or the new server name. - In Access, refresh the linked tables in the Linked Table Manager.
If the redirect isn't intended, the operator checks the service and the proxies in front of it.