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

Fix issue 'No such file or directory' #1097

Merged
merged 3 commits into from
Jul 17, 2024
Merged

Fix issue 'No such file or directory' #1097

merged 3 commits into from
Jul 17, 2024

Conversation

tatiana
Copy link
Collaborator

@tatiana tatiana commented Jul 17, 2024

Two Astronomer customers reported issues while trying to upgrade to Cosmos 1.5:

No such file or directory "/usr/local/aiflow/dags/dbt/dbt_venv/bin/python"

The issue is that their dbt project folder had a symbolic link to a file that no longer existed. When Cosmos attempted to iterate over that directory to create a hash representing the cache version, it could not open the file referenced by the symbolic link.

This PR reproduces the issue and fixes the behavior. Users are also advised to check if there are any broken symlinks on their dbt folder and delete them. We also discourage having Python virtual environments inside the dbt project folder and/or the Airflow DAGs folder.

Closes: #1096

Two Astronomer customers reported issues while trying to upgrade to Cosmos 1.5:

```
No such file or directory "/usr/local/aiflow/dags/dbt/dbt_venv/bin/python"
```

The issue is that their dbt project folder had a symbolic link to a file that no longer
existed. When Cosmos attempted to iterate over that directory to create a hash representing
the cache version, it could not open the file referenced by the symbolic link.

This PR reproduces the issue and fixes the behaviour. Users are also advised to
check if there are any broken sym links on their dbt folder and delete them.

Closes #1096
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 17, 2024
@tatiana tatiana added this to the Cosmos 1.5.1 milestone Jul 17, 2024
Copy link

netlify bot commented Jul 17, 2024

Deploy Preview for sunny-pastelito-5ecb04 canceled.

Name Link
🔨 Latest commit 41443c4
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/6697b63727a7910008f83647

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.24%. Comparing base (6f95c4b) to head (f97764b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1097   +/-   ##
=======================================
  Coverage   96.23%   96.24%           
=======================================
  Files          63       63           
  Lines        3270     3273    +3     
=======================================
+ Hits         3147     3150    +3     
  Misses        123      123           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 17, 2024
cosmos/cache.py Outdated Show resolved Hide resolved
@tatiana tatiana merged commit 0bafe88 into main Jul 17, 2024
60 of 61 checks passed
@tatiana tatiana deleted the fix-1096 branch July 17, 2024 12:21
tatiana added a commit that referenced this pull request Jul 17, 2024
Two Astronomer customers reported issues while trying to upgrade to
Cosmos 1.5:

```
No such file or directory "/usr/local/aiflow/dags/dbt/dbt_venv/bin/python"
```

The issue is that their dbt project folder had a symbolic link to a file
that no longer existed. When Cosmos attempted to iterate over that
directory to create a hash representing the cache version, it could not
open the file referenced by the symbolic link.

This PR reproduces the issue and fixes the behavior. Users are also
advised to check if there are any broken symlinks on their dbt folder
and delete them. We also discourage having Python virtual environments
inside the dbt project folder and/or the Airflow DAGs folder.

Closes: #1096
(cherry picked from commit 0bafe88)
@tatiana tatiana mentioned this pull request Jul 17, 2024
tatiana added a commit that referenced this pull request Jul 17, 2024
Bug fixes

* Fix getting temporary AWS credentials with assume_role by
@piotrkubicki in #1081
* Fix issue 'No such file or directory' by @tatiana in #1097

Others

* Change Cosmos dev status from alpha to prod by @tatiana in #1098
* Pre-commit hook updates in #1083, #1092
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug on Cosmos 1.5 No such file or directory "/usr/local/aiflow/dags/dbt/dbt_venv/bin/python"
3 participants