biolab / orange-canvas-core

Orange Canvas core workflow editor
GNU General Public License v3.0
36 stars 62 forks source link

[FIX] Addons - Do not use cache when no permission to write #288

Closed PrimozGodec closed 11 months ago

PrimozGodec commented 11 months ago

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 commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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 ```diff @@ 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](https://app.codecov.io/gh/biolab/orange-canvas-core/pull/288?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab) | Coverage Δ | | |---|---|---| | [orangecanvas/application/utils/addons.py](https://app.codecov.io/gh/biolab/orange-canvas-core/pull/288?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab#diff-b3JhbmdlY2FudmFzL2FwcGxpY2F0aW9uL3V0aWxzL2FkZG9ucy5weQ==) | `51.49% <100.00%> (+1.91%)` | :arrow_up: | ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/biolab/orange-canvas-core/pull/288/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=biolab)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ales-erjavec commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

@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: https://github.com/conda-forge/orange3-imageanalytics-feedstock/pull/33.