Farhan Ahmad
07/01/2024, 3:56 AMlisten_address: '0.0.0.0:8888'
database:
type: local
local:
path: /home/lakefs/kv-store
enable_logging: true
logging:
format: text
level: DEBUG
output: '-'
auth:
encrypt:
secret_key: <redacted>
blockstore:
type: local
local:
path: /home/lakefs/blockstore
import_enabled: true
allowed_external_prefixes: /home/lakefs/imports
I launch docker with the following mappings:
docker run --user lakeuser\
-p 8888:8888\
-v /my/path/lakefs/kv-store:/home/lakefs/kv-store\
-v /my/path/lakefs/blockstore:/home/lakefs/blockstore\
-v /my/path/lakefs/config:/home/lakefs/config\
-v /my/path/lakefs/imports:/home/lakefs/imports\
docker.io/treeverse/lakefs:latest run --config /home/lakefs/config/lakefs.yaml
I get this error:
level=fatal msg="failed to create catalog" func=cmd/lakefs/cmd.glob..func9 file="cmd/run.go:185" error="create tiered FS for committed metaranges: creating base dir: /lakefs/data/cache/meta-range - mkdir /lakefs: permission denied"
Apparently, lakefs is trying to use /lakefs/...
, a path that does not exist on the container. The issue goes away if I map /lakefs
to some host path
-v /some/path:/lakefs
Does this seem like a misconfiguration or access to /lakefs
is actually required?Lyon Rosenblatt
07/01/2024, 5:46 AMIsan Rivkin
07/01/2024, 6:07 AM~/lakefs/data/cache
Then lakeFS expands ~
into a full path and for some reason when running on your host it returns /lakefs/…
While the $HOME in lakeFS path is /home/lakeFS
(The result of doing echo $HOME
inside the container).
You can debug this by running echo $HOME
inside the container.
You can also add the following to your lakeFS config file:
committed:
local_cache:
# specify the base dir inside the container
dir: /home/lakefs/data/other
Farhan Ahmad
07/01/2024, 7:05 AM<http://github.com/mitchellh/go-homedir|github.com/mitchellh/go-homedir>
and this package simply returns the expanded path to the home directory from the OS. The issue is caused by my use of --user
, which as I discovered just now creates a "HOME"-less user inside the container and $HOME resolves to /
.Isan Rivkin
07/01/2024, 7:13 AMFarhan Ahmad
07/01/2024, 7:39 AMcommitted:
local_cache:
# specify the base dir inside the container
dir: /home/lakefs/local_cache
and changed my launch command to map the home dir as a whole
docker run --user $(id -u lakeuser):$(id -g lakeuser) \
-p 8888:8888 \
-v /ai/archive/lakefs/:/home/lakefs/ \
<http://docker.io/treeverse/lakefs:latest|docker.io/treeverse/lakefs:latest> run --config /home/lakefs/config/lakefs.yaml
Nitpick: The defaultwould normally exapnd to~/lakefs/data/cache
. Is/home/lakefs/lakefs/data/cache
intentional?lakefs/lakefs
Isan Rivkin
07/01/2024, 7:41 AM