prestodb/presto · error · SQLException
Specified timeZoneId is not supported:
Error message
Specified timeZoneId is not supported:
What it means
getTimeZoneId() validates the 'timeZoneId' connection property against TimeZone.getAvailableIDs() and throws SQLException('Specified timeZoneId is not supported: ...') when the supplied value is not a recognized JVM time zone ID. The value must be a valid Java TimeZone identifier; it is used to interpret TIMESTAMP values in the session.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:181
throws SQLException
{
return APPLICATION_NAME_PREFIX.getValue(properties);
}
public Properties getProperties()
{
return properties;
}
public String getTimeZoneId()
throws SQLException
{
Optional<String> timezone = TIMEZONE_ID.getValue(properties);
if (timezone.isPresent()) {
List<String> timeZoneIds = Arrays.asList(TimeZone.getAvailableIDs());
if (!timeZoneIds.contains(timezone.get())) {
throw new SQLException("Specified timeZoneId is not supported: " + timezone.get());
}
return timezone.get();
}
return TimeZone.getDefault().getID();
}
public Map<String, String> getExtraCredentials()
throws SQLException
{
return EXTRA_CREDENTIALS.getValue(properties).orElse(ImmutableMap.of());
}
public Map<String, String> getCustomHeaders()
throws SQLException
{
return CUSTOM_HEADERS.getValue(properties).orElse(ImmutableMap.of());
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Set timeZoneId to a canonical Java TimeZone id, e.g. 'UTC', 'America/Los_Angeles', 'Asia/Kolkata'
- Verify the id with TimeZone.getTimeZone(value) and check it is not normalized to 'GMT' (a sign the id is invalid)
- If no timezone is needed, omit the property — the driver defaults to TimeZone.getDefault().getID()
- Install/refresh tzdata for the JVM if a legitimate zone id is reported missing (TZ updater / OS tzdata package)
Example fix
// before String url = "jdbc:presto://host:8080/hive/default?timeZoneId=utc+2"; // invalid // after String url = "jdbc:presto://host:8080/hive/default?timeZoneId=Europe/Paris"; // valid Java zone id
Defensive patterns
Strategy: validation
Validate before calling
String tz = properties.getProperty("timeZoneId");
if (tz != null && java.util.Arrays.asList(java.util.TimeZone.getAvailableIDs()).noneMatch(tz::equals)) {
throw new IllegalArgumentException("Invalid timeZoneId: " + tz);
} Try / catch
try { conn = DriverManager.getConnection(url, props); } catch (SQLException e) { if (e.getMessage().startsWith("Specified timeZoneId is not supported")) { fixTimeZoneProperty(props); conn = DriverManager.getConnection(url, props); } else { throw e; } } Prevention
- Use canonical Java TimeZone ids (e.g. UTC, America/New_York) not UTC offsets
- Validate timeZoneId with TimeZone.getTimeZone and check it doesn't normalize to GMT
- Omit the property to use the JVM default
- Keep tzdata current in containers/JVMs
When it happens
Trigger: Passing a connection property timeZoneId with a misspelled or non-IANA id (e.g. 'UTC+2', 'utc', 'GMT+05:30' variants not in getAvailableIDs, or empty/garbage strings) while connecting via PrestoDriver.
Common situations: Config typos in JDBC URLs (jdbc:presto://...?timeZoneId=...), using offsets like '+02:00' instead of zone ids, moving between JVMs with different tz databases, Docker images missing tzdata.
Related errors
- UNEXPECTED_ACCUMULO_ERROR
- JDBC_ERROR
- Only one of 'case-insensitive-name-matching=true' or 'case-s
- connection-url is required but was not provided
- PERMISSION_DENIED
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/1311556fe02c3000.
Report an issue: GitHub.