Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database role is (still) not respected when private key is used in Snowflake #44351

Closed
fabiomx opened this issue Jun 18, 2024 · 1 comment · Fixed by #44397
Closed

Database role is (still) not respected when private key is used in Snowflake #44351

fabiomx opened this issue Jun 18, 2024 · 1 comment · Fixed by #44397
Assignees
Labels
.Backend Database/Snowflake Priority:P2 Average run of the mill bug .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Milestone

Comments

@fabiomx
Copy link

fabiomx commented Jun 18, 2024

Describe the bug

I read the following issues and related PRs:
Issues connecting to Snowflake using RSA Keypair Authentication
Database role is not respected when private key is used in Snowflake
Add connection string parsing to Snowflake

I upgraded to:

"version": {
      "date": "2024-06-15",
      "tag": "v0.50.5",
      "hash": "48f6978"
    },

but I'm still facing the same issue: the database role is not respected when a private key is used, and the only way to make it work is to add it as a URL parameter explicitly.

Note: I couldn't reproduce the issue using the default user's role, but if I use (and I need it :) ) another role, it doesn't work.

To Reproduce

  1. Go to Database admin and create or modify an existing one
  2. Upload the private key
  3. In the field "Role (optional, required for connection impersonation)", set a different role than the user's default role
  4. Save changes
  5. If you check Snowflake's query history, you will see that the role used is the user's default role and not the one indicated in the Role field.

Expected behavior

Metabase should use the database role value to connect to Snowflake. I shouldn't need to add it as a JDBC connection string option.

Logs

No response

Information about your Metabase installation

{
  "browser-info": {
    "language": "en-GB",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.23+9",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.23",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.23+9",
    "os.name": "Linux",
    "os.version": "6.1.58+",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "snowflake"
    ],
    "hosting-env": "unknown",
    "application-database": "mysql",
    "application-database-details": {
      "database": {
        "name": "MySQL",
        "version": "8.0.30-google"
      },
      "jdbc-driver": {
        "name": "MariaDB Connector/J",
        "version": "2.7.10"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2024-06-15",
      "tag": "v0.50.5",
      "hash": "48f6978"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity

Workaround available

Additional context

No response

Copy link

🚀 This should also be released by v0.50.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend Database/Snowflake Priority:P2 Average run of the mill bug .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants