Hi everyone, I'm hoping someone can help me with ...
# community-support
t
Hi everyone, I'm hoping someone can help me with this issue I'm seeing. I'm on Elementary Version 0.11.0, and dbt version 1.6.6. This project is running on my local windows machine through a virtual python enviornment, I'm able to execute dbt deps on the project, run it, and test it, but when I try to execute edr report I get the following message: Any feedback and suggestions are welcomed! join our community here - https://bit.ly/slack-elementary 2023-10-18 151216 — INFO — Running with edr=0.11.0 Traceback (most recent call last): File "C:\Users\tkaddoura\Documents\projects\wph-disposition-ingest\venv\lib\site-packages\elementary\clients\dbt\dbt_runner.py", line 82, in _run_command result = subprocess.run( File "C:\Users\tkaddoura\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['dbt', 'deps', '--project-dir', 'C:\\Users\\tkaddoura\\Documents\\projects\\wph-disposition-ingest\\venv\\Lib\\site-packages\\elementary\\monitor\\dbt_project']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: ..... venv\lib\site-packages\elementary\clients\dbt\dbt_runner.py", line 93, in _run_command raise DbtCommandError(err, command_args, logs=logs) elementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command. Any help in resolving this issue would be greatly appreciated.
👀 1
w
I’m actually having the same issue. For me the
--project-dir
listed in the error log is not the correct dbt directory, and specifying the correct one in the project dir flag in the
edr report
command still produces the same result.
I solved the issue for me. It ended up being that the virtual env must be in the dbt project. Maybe the elementary team have more insight into this, but once I created a venv in my dbt proejct and installed the pip dependencies,
edr report
worked right away.
w
Hi, @Will McFarland! Would you be able to expound upon creating a venv in your dbt project? I also have the same issue and am running dbt with poetry. I thought I had it all set up appropriately for elementary, but apparently not.
w
I just cd’d into my dbt project directory and did
python -m venv .dbt-venv
. It doesn’t feel like a usable solution in production, but it got a demo working which is as far as I’ve gotten with Elementary so far.
o
Hi @Tarek Kaddoura and @Will McFarland! sorry to hear you bumped into this issue. Could you please share your
edr.log
with me?
edr
has an internal dbt project and as a first step it runs
dbt deps
which seems to fail here for some reason. In order for us to understand a bit more why it's failing we should look at the
edr.log
.
t
Thank you @Or Avidov, more then happy to send it to you, can you point me to where can I find edr.log?
w
@Tarek Kaddoura my edr.log is in the
edr_target
folder in my dbt project. @Or Avidov thanks for the response! I actually just looked at my edr log and realized there was a bunch of permission denied errors. I tried running edr report with sudo and it worked using my venv from another project location. Do note I am on Mac. I recreated my old edr.log with the permission error here:
t
Thank you for pointing me to the location of that file. Unfortunately, I don't see any explicit errors in the log.
@Or Avidov any thoughts or help would be greatly appreciated
k
Same issue, here.
😞
m
Hey @Tarek Kaddoura and @Krzysztof D, This looks like a local env issue. This is an error that means
edr
is failing to initiate, so the installation must be faulty. I suggest you both try: 1. Installing from scratch in a virtual env 2. Running using sudo / as administrator To install Elementary's
edr
within a Python virtual environment (venv), you need to first create the environment and then use the
pip
installer. Please follow the steps below: 1. Create a new Python virtual environment:
Copy code
python3 -m venv /path/to/new/virtual/environment
2. Activate the virtual environment: • On Windows:
Copy code
\path\to\new\virtual\environment\Scripts\activate
• On Unix or MacOS:
Copy code
source /path/to/new/virtual/environment/bin/activate
You should now be in the virtual environment. You'll know you're in the virtual environment because the name of it will prefix your terminal command line. 3. Install `edr`:
Copy code
pip install elementary-data 
pip install elementary-data[<adapter>]
Check whether the installation has been successful:
Copy code
edr --help
You should see a list of available
edr
commands if the installation was successful.