Getting this error after running `edr report` in m...
# community-support
r
Getting this error after running
edr report
in my dbt environment. Any way to mitigate this error? I'm on version 0.12.1
Copy code
FileNotFoundError: [Errno 2] No such file or directory: 'dbt_packages\\dbt-data-reliability-0.12.0\\integration_tests\\deprecated_tests\\macros\\unit_tests\\test_adapter_specific_macros_have_default_implementation.sql'
n
Hey @Ryan Shadle! Interesting error Did you run
dbt run --select elementary
and
dbt test
before? Can you try running all again? If it still doesn’t work your
dbt.log
and
edr.log
would help 🙂
r
Hi Noa - I did run those commands before. Here is my edr.log file from the most recent attempt
Copy code
2023-12-04 13:16:35 � INFO � Running with edr=0.13.0
2023-12-04 13:16:35 � INFO � Running dbt --log-format json deps --project-dir C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\elementary\monitor\dbt_project
2023-12-04 13:16:39 � INFO � Running with dbt=1.7.1
2023-12-04 13:16:39 � INFO � Updating lock file in file path: C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\elementary\monitor\dbt_project/package-lock.yml
2023-12-04 13:16:39 � INFO � Installing dbt-labs/dbt_utils
2023-12-04 13:16:39 � INFO � Installed from version 0.8.6
2023-12-04 13:16:39 � INFO � Updated version available: 1.1.1
2023-12-04 13:16:39 � INFO � Installing elementary-data/elementary
2023-12-04 13:16:39 � INFO � Encountered an error:
[Errno 2] No such file or directory: 'dbt_packages\\dbt-data-reliability-0.13.0\\integration_tests\\deprecated_tests\\macros\\unit_tests\\test_adapter_specific_macros_have_default_implementation.sql'
2023-12-04 13:16:39 � INFO � Traceback (most recent call last):
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\cli\requires.py", line 90, in wrapper
    result, success = func(*args, **kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\cli\requires.py", line 75, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\cli\requires.py", line 151, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\cli\requires.py", line 197, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\cli\main.py", line 492, in deps
    results = task.run()
              ^^^^^^^^^^
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\task\deps.py", line 252, in run
    package.install(self.project, renderer)
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\deps\registry.py", line 66, in install
    self._install(project, renderer)
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\deps\base.py", line 121, in _install
    connection_exception_retry(download_untar_fn, 5)
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\utils.py", line 607, in _connection_exception_retry
    return fn()
           ^^^^
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\deps\base.py", line 133, in download_and_untar
    system.untar_package(tar_path, deps_path, package_name)
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\site-packages\dbt\clients\system.py", line 500, in untar_package
    tarball.extractall(dest_dir)
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2257, in extractall
    self._extract_one(tarinfo, path, set_attrs=not tarinfo.isdir(),
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2324, in _extract_one
    self._handle_fatal_error(e)
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2320, in _extract_one
    self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2403, in _extract_member
    self.makefile(tarinfo, targetpath)
  File "C:\Users\RyanShadle\AppData\Local\Programs\Python\Python311\Lib\tarfile.py", line 2448, in makefile
    with bltn_open(targetpath, "wb") as target:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'dbt_packages\\dbt-data-reliability-0.13.0\\integration_tests\\deprecated_tests\\macros\\unit_tests\\test_adapter_specific_macros_have_default_implementation.sql'
The dbt.log is pretty long, but I can try to redact some of it and send it if it'll be more helpful
n
Thanks @Ryan Shadle hmm you say your dbt package version is 12.1.0? I see your edr version is 13.0.0, can you maybe upgrade your package to try again?
r
Apologies @Noa Kurman I should have mentioned on the most recent retry I was running with the dbt package version at 13.0 and still receiving the same error. I even tried to start Elementary from scratch once upgrading the dbt package. However I'm still receiving the same error
n
Got you 👍 So there are two options for this error, the first is lacking permissions for
edr
on installation. When
edr
is being installed it’s also installing the internal dbt project, and it may be that it did not have enough permissions to do that. Can you maybe add permissions to the folder where it’s being installed and also check for errors during the installation? Another possible issue is your python path. Is your env running on python virtualenv? Can you check your PATH and see all the python locations are directed correctly ?
r
I appreciate the suggestions Noa. I'm not quite sure what you mean by the first suggestion. I've installed the python package for the CLI as instructed on the doc site and even tried doing it via administrator privileges with no errors during the process. It seems to populate other folders in the same area with files so I don't know if it's a permissions thing. As for the 2nd one, the package also appears to be installed in the same location as my other packages via the PATH I expect. I'm also not running on a virtualenv in this case
o
Hey @Ryan Shadle, can you try setting up a
venv
for edr and retrying?
p
Hi, Has anyone found a solution?
d
Hi All, I found several support mentions of this error, you can search "FileNotFoundError: [Errno 2] No such file or directory:" and found a few of these. @Ofek Weiss hit me with the correct solution for this in the thread linked so I figured a shout out is in order. It looks like the solution is you need a virtual environment. Unfortunately, the docs don't have this listed so I did some digging here on slack. For reference, if you've never done this here are the steps I ran: Step 1: Install Virtualenv You can install
virtualenv
from any directory because it's a global Python tool. Open PowerShell as an administrator and run:
Copy code
pip install virtualenv
Step 2: Create a Virtual Environment First, navigate to your dbt project directory. If you don't already have a specific directory for your dbt project, you should create one and navigate into it. This directory will be the "home" for your dbt project files and the virtual environment.
Copy code
cd path\to\your\dbt\project
Replace
path\to\your\dbt\project
with the actual path to your dbt project directory. If this is a new project and you're not sure where to place it, you can create a new directory anywhere you usually store projects. Once you're in your project directory (or have created a new one and navigated into it), create the virtual environment within this directory:
Copy code
virtualenv venv
This command creates a new folder named
venv
in your current directory (your dbt project directory), which contains the virtual environment. By following this approach, your virtual environment is neatly contained within your project directory, making it easier to manage your project's dependencies separately from the global Python environment. To use this virtual environment, ensure you activate it whenever you're working on your dbt project. To activate the virtual environment, navigate to your dbt project directory in PowerShell, and run:
Copy code
.\venv\Scripts\Activate.ps1
After activation, you should see
(venv)
prefixed to your PowerShell prompt, indicating that the virtual environment is active. Now, any Python or dbt commands you run will use the versions of Python and dbt installed in your virtual environment, not the global versions installed on your system. Install dbt-core: This is the core dbt library that provides the dbt functionality. You need to install it even if you have it installed globally because the virtual environment is isolated from global installations.
Copy code
pip install dbt-core
Install the dbt adapter for your data warehouse: Since you mentioned Snowflake, you would install
dbt-snowflake
. If you're using a different data warehouse, you would install the corresponding adapter (e.g.,
dbt-bigquery
,
dbt-postgres
, etc.).
Copy code
pip install dbt-snowflake
Install elementary: Finally, install the elementary package.
Copy code
shell

pip install elementary-data
After I ran each of these steps the
edr report
command worked! Sshot below. It's worth mentioning I followed all of the quickstart steps first for the CLI listed in the documentation and only ran these steps AFTER I started getting the same error message above. Also I'm running on a windows system, some of these steps are different on OS. If you run into any trouble copy paste this into your favorite LLM(ChatGPT) and tweak as needed.
🙌 1
drop corrupt happy 1