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

Cannot find DBT resources #28

Closed
trallarn opened this issue Sep 21, 2020 · 10 comments
Closed

Cannot find DBT resources #28

trallarn opened this issue Sep 21, 2020 · 10 comments

Comments

@trallarn
Copy link

Hi and thanks for an interesting extension!

I've just installed it and run into the following problem:

Use case:
Open a folder containing a DBT project in vscode
-> Open a DBT model from the explorer
-> Click any of the models populated in the DBT POWER USER sidebar
-> Yields unable to open file message according to screenshot below

Screenshot 2020-09-21 at 15 01 42

It seems like the extension is searching for the model in /app which seems wrong. I expect it to search relative to the folder I've opened in vscode.

@mdesmet
Copy link
Contributor

mdesmet commented Sep 21, 2020

Hi @trallarn,

I'm not sure where the /app folder is coming from? Maybe you have copied the project from someone else? Could you recompile your project by running 'dbt ls'?

We are using the root_path as in the manifest.json file within your target folder:

"unique_id": "model.ov_ho.oorsprong_studenten_examen_ata", "package_name": "ov_ho", "root_path": "/home/mdesmet/Projects/ov-project-ho"

@trallarn
Copy link
Author

Hi @mdesmet

I run dbt in a docker container with /app as project root. I didn't realise that the compiled resources was used. That explains where this is coming from.

Thanks for that clarification on how manifest.json is used. I will figure something out to resolve this.

@mdesmet
Copy link
Contributor

mdesmet commented Sep 22, 2020

I see three options:

  • either we tell the user to recompile because the project folder is not matching the manifest
  • either we swap the root folder with the project location (the user must have copied the folder)
  • or we don't do anything

Any opinions on this? I'm tempted to either do the first or the last.

@trallarn
Copy link
Author

trallarn commented Sep 22, 2020

Is it necessary to use the root_path at all? Cannot relative paths be used? If possible this would be my preferred choice.

If not:
1 is informative but doesn't support running dbt in a container
2 could be implemented as an override option. This is the option that actually resolves the issue when running dbt in a container and thus what I would prefer
3 I think it at least would be nice with an an error message that indicates that the paths in the manifest.json doesn't match the file system

Perhaps adding the fact that manifest.json is used by the plugin could be added to the github README.

Managing dbt with a container I think is a very good practice, so for this plugin to be able to support that is a good thing. When using a container I might not even have dbt installed on my local machine so recompiling then isn't an option.

@mdesmet
Copy link
Contributor

mdesmet commented Sep 22, 2020

I don't know if you know but you can run vscode with docker or a WSL2 enviroment. That's exactly how I run dbt, I don't even have dbt installed on my windows OS. So it is already supported now to run DBT in a container setup without any configuration neeeded for this extension.

Please check the Remote extension within vscode: https://code.visualstudio.com/docs/remote/remote-overview

I think apart from how the extension works it might be useful to explain some of these more special scenarios in the readme.

@trallarn
Copy link
Author

I wasn't aware of that @mdesmet . I will definitely look inte the plugin. Thanks!

@karimamd
Copy link

Hello, I am having the exact same issue and looking for an easy solution
is there an option to override where the extension is looking to be /dbt instead of /app/dbt ?
maybe something in a configuration file ?

@mdesmet
Copy link
Contributor

mdesmet commented Dec 10, 2020

Assuming you are also using docker. The out of the box solution seems to me to use the remote plugin and run dbt in your docker container instead of the directory that is being mounted in docker. As I said the remote extension is really great, I use it every day!

@mdesmet
Copy link
Contributor

mdesmet commented Jan 5, 2021

We have added some links in the README with pointers on how to use the remote extension.

@mdesmet mdesmet closed this as completed Jan 5, 2021
@trallarn
Copy link
Author

trallarn commented Jan 5, 2021

Great. Thanks @mdesmet.

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

3 participants