fix(nspd-geo): rosreestr2coord cache permission in non-root worker
rosreestr2coord.Area() by default creates ./tmp/ media cache relative to CWD. In our worker container CWD=/app (owned by root), runs as non-root user `app` → PermissionError: '/app/tmp' on every target. Fix: pass explicit kwargs to Area(): - use_cache=False (we don't need cache — each cad_num is unique) - media_path='/tmp/rosreestr2coord' (world-writable in container) Vault: fixes/Bug_Nspd_Geo_Tmp_Permission_Fixed.md
This commit is contained in:
parent
3e6cddde33
commit
b19ca1ed41
1 changed files with 7 additions and 0 deletions
|
|
@ -165,11 +165,18 @@ def fetch_via_rosreestr2coord(
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
raise NspdLiteError(f"rosreestr2coord не установлен (uv add rosreestr2coord): {e}") from e
|
raise NspdLiteError(f"rosreestr2coord не установлен (uv add rosreestr2coord): {e}") from e
|
||||||
|
|
||||||
|
# rosreestr2coord по дефолту пишет media-cache в `./tmp/` (относительно CWD).
|
||||||
|
# У нас CWD = /app, контейнер worker'а запущен под non-root user → Permission
|
||||||
|
# denied при первом fetch.
|
||||||
|
# Фикс: use_cache=False + media_path=/tmp/rosreestr2coord (writable для всех).
|
||||||
|
# Кеш нам не нужен — каждый cad_num уникален, обращаемся раз.
|
||||||
a = Area(
|
a = Area(
|
||||||
code=cad_num,
|
code=cad_num,
|
||||||
area_type=area_type,
|
area_type=area_type,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
with_log=False,
|
with_log=False,
|
||||||
|
use_cache=False,
|
||||||
|
media_path="/tmp/rosreestr2coord",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
return a.to_geojson_poly()
|
return a.to_geojson_poly()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue