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] Addons - Do not use cache when no permission to write #288

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

PrimozGodec
Copy link
Contributor

Issue

On some corporate computers, it may be the issue that either the cache directory doesn't have permission to write or an existing cache file lacks reading permission. It happened to one of our customers. The cache file was successfully created, but the next time it tried to be read, it no longer had permissions.

Changes

When there is no read or write permission, ignore the cache.

@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7f535af) 75.47% compared to head (6afe257) 75.57%.
Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #288      +/-   ##
==========================================
+ Coverage   75.47%   75.57%   +0.09%     
==========================================
  Files          99       99              
  Lines       21033    21047      +14     
==========================================
+ Hits        15875    15906      +31     
+ Misses       5158     5141      -17     
Files Coverage Δ
orangecanvas/application/utils/addons.py 51.49% <100.00%> (+1.91%) ⬆️

... and 8 files with indirect coverage changes

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

Comment on lines 308 to 314
except OperationalError:
# if no permission to write in dir or read cache file return uncached session
return requests.Session()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe log a warning when caching failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ales-erjavec ales-erjavec merged commit 0bed555 into biolab:master Oct 30, 2023
24 of 25 checks passed
@ales-erjavec
Copy link
Collaborator

The cache file was successfully created, but the next time it tried to be read, it no longer had permissions.

Is this due to running with sudo?

@PrimozGodec PrimozGodec deleted the fix-cache branch October 30, 2023 12:01
@PrimozGodec
Copy link
Contributor Author

Is this due to running with sudo?

I don't think so. It is a corporate computer with limited permissions. We don't know exactly why it is happening, but we will try to find out at the next meeting with them.

@PrimozGodec
Copy link
Contributor Author

@ales-erjavec, some explanation of what was happening. We built a conda installer for one of the companies. The installer also included orange3-imageanayitics with the wrong name for the requests-cache package in the recipe (requests_cache instead of requests-cache). It caused request-caches to be installed and requests_cache beside, which is an ancient version of the same package (0.4.3). This version overrode the new version and caused the database file to fail to open when networkcache folder still didn't exist

I fixed the issue with imageanalytics here: conda-forge/orange3-imageanalytics-feedstock#33.

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

Successfully merging this pull request may close these issues.

4 participants