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

Pass credentials to datasource #69

Closed
lmabraidofandino opened this issue Mar 8, 2022 · 5 comments
Closed

Pass credentials to datasource #69

lmabraidofandino opened this issue Mar 8, 2022 · 5 comments

Comments

@lmabraidofandino
Copy link

We're running Metriql within a docker container using this command:
sudo docker run -it -p "5656:5656" -v "${DBT_PROJECT_DIR}:/root/app" -v "${DBT_PROFILES_DIR}:/root/.dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=/root/app buremba/metriql serve --pass-credentials-to-datasource
Exception in thread "main" java.lang.NullPointerException
at com.metriql.deployment.SingleTenantDeployment.getDataSource(SingleTenantDeployment.kt:75)
at com.metriql.deployment.SingleTenantDeployment$modelService$1.invoke(SingleTenantDeployment.kt:47)
at com.metriql.deployment.SingleTenantDeployment$modelService$1.invoke(SingleTenantDeployment.kt:46)
at com.metriql.service.model.UpdatableModelService.(UpdatableModelService.kt:8)
at com.metriql.deployment.SingleTenantDeployment.(SingleTenantDeployment.kt:46)
at com.metriql.Commands$Serve.run(Commands.kt:233)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:395)
at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:392)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:410)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:435)
at com.metriql.ServiceStarterKt.main(ServiceStarter.kt:10)
Note that it's getting a NullPointerException. How can we pass credentials to the datasource? Thanks!

@buremba
Copy link
Member

buremba commented Mar 13, 2022

Hey there, there was a bug for the pass-credentials-to-datasource feature which is now fixed. Can you please try the latest version and let me know how it goes?

@lmabraidofandino
Copy link
Author

lmabraidofandino commented Mar 15, 2022

We tested the fix you made. It works correctly for a user who is not a valid datasource user: the user is prevented from seeing data in the data source. We have not yet confirmed it works correctly with a valid data source user.

However, there is a new defect. If we start serve without the --pass-credentials-to-datasource option, Dbeaver connections with valid credentials are rejected with "SQL Error: Authentication failed: Unauthorized".

@buremba
Copy link
Member

buremba commented Mar 20, 2022

Sorry for missing your message, it was fixed the day that you answered the question. :)

@lmabraidofandino
Copy link
Author

I just confirmed that on an AWS EC2 instance, docker pull buremba/metriql:latest and docker run -it -p "${METRIQL_PORT}:5656" -v "${DBT_PROJECT_DIR}:/root/app" -v "${DBT_PROFILES_DIR}:/root/.dbt" -e METRIQL_RUN_HOST=0.0.0.0 -e DBT_PROJECT_DIR=/root/app buremba/metriql
serve
work correctly. I am able to use DBeaver to view the metriql data without getting SQL Error: Authentication failed: Unauthorized.

@buremba
Copy link
Member

buremba commented May 23, 2022

Thanks for letting me know!

@buremba buremba closed this as completed May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants