prestodb/presto · error · PrestoException

PROMETHEUS_OUTPUT_ERROR

PROMETHEUS_OUTPUT_ERROR

Error message

Unable to handle Prometheus result: 

What it means

Constructor guard in PrometheusRecordCursor: the split's response bytes could not be parsed into the standardized metrics iterator (invalid or empty Prometheus result payload, I/O problem opening the stream), so cursor construction aborts with 'Unable to handle Prometheus result: ...'.

Source

Thrown at presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusRecordCursor.java:84

    public PrometheusRecordCursor(List<PrometheusColumnHandle> columnHandles, ByteSource byteSource)
    {
        this.columnHandles = columnHandles;

        fieldToColumnIndex = new int[columnHandles.size()];
        for (int i = 0; i < columnHandles.size(); i++) {
            PrometheusColumnHandle columnHandle = columnHandles.get(i);
            fieldToColumnIndex[i] = columnHandle.getOrdinalPosition();
        }

        try (CountingInputStream input = new CountingInputStream(byteSource.openStream())) {
            metricsItr = prometheusResultsInStandardizedForm(new PrometheusQueryResponse(input).getResults()).iterator();
            totalBytes = input.getCount();
        }
        catch (PrestoException ex) {
            throw ex;
        }
        catch (IOException e) {
            throw new PrestoException(PROMETHEUS_OUTPUT_ERROR, "Unable to handle Prometheus result: " + e.toString());
        }
    }

    static Block getBlockFromMap(Type mapType, Map<?, ?> map)
    {
        // on functions like COUNT() the Type won't be a MapType
        if (!(mapType instanceof MapType)) {
            return null;
        }
        Type keyType = mapType.getTypeParameters().get(0);
        Type valueType = mapType.getTypeParameters().get(1);

        BlockBuilder mapBlockBuilder = mapType.createBlockBuilder(null, 1);
        BlockBuilder builder = mapBlockBuilder.beginBlockEntry();

        for (Map.Entry<?, ?> entry : map.entrySet()) {
            writeObject(builder, keyType, entry.getKey());
            writeObject(builder, valueType, entry.getValue());

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Re-run the query; the underlying Prometheus response may have been transient or empty
  2. Verify the Prometheus server returns well-formed query_range results
  3. Check network/proxy integrity between Presto and Prometheus
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusRecordCursor.java:84 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/fc2d4c73f95ba17d. Report an issue: GitHub.