Skip to content

[bug] FinOps tools return zeroed/masked data despite valid ACCOUNT_USAGE access #203

@arora-saurabh448

Description

@arora-saurabh448

Problem

The FinOps tools (finops_analyze_credits, finops_warehouse_advice, finops_expensive_queries, finops_unused_resources) return masked/zeroed data (unknown warehouse names, 0.00 credits) even when the connected Snowflake role (ACCOUNTADMIN) has full access to SNOWFLAKE.ACCOUNT_USAGE views. The finops_warehouse_advice tool also fails with a SQL compilation error: invalid identifier 'WAREHOUSE_SIZE'.

Steps to Reproduce

  1. Configure a Snowflake warehouse connection (e.g., snowflake_sample) with a role that has ACCOUNT_USAGE access (tested with ACCOUNTADMIN).
  2. Verify direct SQL access works:
    SELECT COUNT(*) FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY 
    WHERE START_TIME >= DATEADD('day', -30, CURRENT_TIMESTAMP());
    → Returns 908 rows successfully.
  3. Verify the connection identity:
    SELECT CURRENT_ROLE(), CURRENT_USER(), CURRENT_ACCOUNT();
    → Returns ACCOUNTADMIN, SAURABH, BZB11272.
  4. Call finops_analyze_credits with warehouse: snowflake_sample, days: 30, limit: 50.
    → Returns all unknown warehouse names and 0.00 credits (13 rows of zeroed data).
  5. Call finops_warehouse_advice with warehouse: snowflake_sample, days: 30.
    → Fails with: 000904 (42000): SQL compilation error: error line 3 at position 4 invalid identifier 'WAREHOUSE_SIZE'.
  6. Call finops_expensive_queries and finops_unused_resources — both return zeroed/empty results.

Expected Behavior

FinOps tools should return actual credit consumption data matching the direct SQL query results (908 rows of valid metering history data across 13 active warehouses totaling ~230 credits over 30 days).

Actual Behavior

  • finops_analyze_credits: Returns masked data (all unknown / 0.00)
  • finops_warehouse_advice: SQL compilation error on WAREHOUSE_SIZE column
  • finops_expensive_queries: Returns zeroed results
  • finops_unused_resources: Returns zeroed results

Workaround

Query SNOWFLAKE.ACCOUNT_USAGE views directly via sql_execute to get the actual data.


Metadata

Field Value
CLI Version v0.4.0
Platform darwin
Architecture arm64
OS Release 24.6.0
Category bug
Working Directory ac-examples
Session ID ses_3070d9fdaffeV9OvBpIrq46996

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrom-cliFeedback submitted via CLIuser-feedbackFeedback submitted by users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions