Hey everyone Just getting started with a local dep...
# help
f
Hey everyone Just getting started with a local deployment of LakeFS and ran into a puzzling situation. I'm using the following custom config file:
Copy code
listen_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:
Copy code
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:
Copy code
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
Copy code
-v /some/path:/lakefs
Does this seem like a misconfiguration or access to
/lakefs
is actually required?
l
hi men. I'm also starting out with the toolset and running it in docker-compose, but I see some things that catch me off guard, so it may be a misconfig. Here's what I see. All your lake_internal paths run from /home/ inside the container. And if I understand the base configuration correctly, that's not the default. I mapped them as follows: - lakefs_vol:/data - lakefs_confs:/etc/lakefs lakefs_vol and lakefs_confs are just docker_compose local volumes. I'm going to append my docker-compose file. Maybe it helps you, maybe not. In any case, good luck. Maybe someone else can give you some more insight.
i
Hey @Farhan Ahmad this is quite weird, I can’t recreate this. The default path base path for the error message you’re seeing is
~/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:
Copy code
committed:
  local_cache:
    # specify the base dir inside the container
    dir: /home/lakefs/data/other
f
@Isan Rivkin you're right about the expected behavior. I dug in to find that ultimately the home directory is found using the package
<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
/
.
i
Nice catch, now I’ll know as well
f
Thanks for the tip @Isan Rivkin, I added the following to my config file
Copy code
committed:
  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
Copy code
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 default
~/lakefs/data/cache
would normally exapnd to
/home/lakefs/lakefs/data/cache
. Is
lakefs/lakefs
intentional?
i
yes 🙂
👍 1