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

Filer startup fails when target directory doesn't exist #1901

Closed
Flowm opened this issue Mar 14, 2021 · 0 comments
Closed

Filer startup fails when target directory doesn't exist #1901

Flowm opened this issue Mar 14, 2021 · 0 comments

Comments

@Flowm
Copy link

Flowm commented Mar 14, 2021

Sponsors SeaweedFS via Patreon https://www.patreon.com/seaweedfs

Describe the bug
With the official docker image (chrislusf/seaweedfs) configuring the filer with leveldb3 as filer store with target dir /data/filerldb3 fails on startup as the directory doesn't exist.

W0314 09:04:01     1 filer_server.go:117] skipping default store dir in ./filerldb2
I0314 09:04:01     1 leveldb3_store.go:47] filer store leveldb3 dir: /data/filerldb3
F0314 09:04:01     1 configuration.go:25] failed to initialize store for leveldb3: Check Level Folder /data/filerldb3 Writable: stat /data/filerldb3: no such file or directory
goroutine 1 [running]:
github.com/chrislusf/seaweedfs/weed/glog.stacks(0xc0005b7a00, 0xc0005b01e0, 0xb0, 0x1d7)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:767 +0xb9
github.com/chrislusf/seaweedfs/weed/glog.(*loggingT).output(0x363eb40, 0xc000000003, 0xc00060a700, 0x2b487cc, 0x10, 0x19, 0x0)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:718 +0x37a
github.com/chrislusf/seaweedfs/weed/glog.(*loggingT).printf(0x363eb40, 0x3, 0x22e8ae5, 0x26, 0xc00035f9b8, 0x2, 0x2)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:656 +0x153
github.com/chrislusf/seaweedfs/weed/glog.Fatalf(...)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:1149
github.com/chrislusf/seaweedfs/weed/filer.(*Filer).LoadConfiguration(0xc0006fe630, 0x3635f60)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/filer/configuration.go:25 +0xf7e
github.com/chrislusf/seaweedfs/weed/server.NewFilerServer(0xc0003f9440, 0xc0003f9440, 0xc0000da180, 0x1, 0x0, 0x0)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/server/filer_server.go:127 +0x593
github.com/chrislusf/seaweedfs/weed/command.(*FilerOptions).startFiler(0x363e8c0)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/command/filer.go:159 +0x338
github.com/chrislusf/seaweedfs/weed/command.runFiler(0x361f1c0, 0xc00013c170, 0x0, 0x0, 0x0)
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/command/filer.go:138 +0x92
main.main()
        /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/weed.go:66 +0x30f

System Setup

  • Output of weed version
version 30GB 2.26 ca74f64 linux amd64
  • Minimal docker-compose.yml
version: '3.5'

services:
  master:
    image: chrislusf/seaweedfs
    command: "master -ip=master"

  filer:
    image: chrislusf/seaweedfs
    volumes:
      - ./filer.toml:/etc/seaweedfs/filer.toml
    command: 'filer -master="master:9333"'
    tty: true
    stdin_open: true
    depends_on:
      - master
  • Contents of filer.toml
[leveldb3]
enabled = true
dir = "/data/filerldb3"
  • List the command line to start:
# Minimal example with the two files from above in a single directory
$ ls
docker-compose.yml  filer.toml
$ docker-compose up
Starting example_master_1 ... done
Starting example_filer_1  ... done
Attaching to example_master_1, example_filer_1
master_1  | I0314 09:39:37     1 file_util.go:23] Folder /data Permission: -rwxr-xr-x
master_1  | I0314 09:39:37     1 master.go:168] current: master:9333 peers:
master_1  | I0314 09:39:37     1 master_server.go:107] Volume Size Limit is 1024 MB
master_1  | I0314 09:39:37     1 master_server.go:192] adminScripts:
master_1  | I0314 09:39:37     1 master.go:122] Start Seaweed Master 30GB 2.26 ca74f64 at 0.0.0.0:9333
master_1  | I0314 09:39:37     1 raft_server.go:70] Starting RaftServer with master:9333
master_1  | I0314 09:39:37     1 raft_server.go:129] current cluster leader:
master_1  | I0314 09:39:37     1 master.go:146] Start Seaweed Master 30GB 2.26 ca74f64 grpc server at 0.0.0.0:19333
master_1  | I0314 09:39:39     1 masterclient.go:78] No existing leader found!
master_1  | I0314 09:39:39     1 raft_server.go:154] Initializing new cluster
master_1  | I0314 09:39:39     1 master_server.go:141] leader change event:  => master:9333
master_1  | I0314 09:39:39     1 master_server.go:143] [ master:9333 ] master:9333 becomes leader.
master_1  | I0314 09:39:42     1 masterclient.go:126] redirected to leader master:9333
master_1  | I0314 09:39:42     1 master_grpc_server.go:245] + client master@172.24.0.2:55276
filer_1   | W0314 09:39:43     1 filer_server.go:117] skipping default store dir in ./filerldb2
master_1  | I0314 09:39:43     1 master_grpc_server.go:245] + client filer@172.24.0.3:8888
filer_1   | I0314 09:39:43     1 leveldb3_store.go:47] filer store leveldb3 dir: /data/filerldb3
filer_1   | F0314 09:39:43     1 configuration.go:25] failed to initialize store for leveldb3: Check Level Folder /data/filerldb3 Writable: stat /data/filerldb3: no such file or directory
filer_1   | goroutine 1 [running]:
filer_1   | github.com/chrislusf/seaweedfs/weed/glog.stacks(0xc0003d6000, 0xc0003d81e0, 0xb0, 0x1d7)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:767 +0xb9
filer_1   | github.com/chrislusf/seaweedfs/weed/glog.(*loggingT).output(0x363eb40, 0xc000000003, 0xc000322700, 0x2b487cc, 0x10, 0x19, 0x0)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:718 +0x37a
filer_1   | github.com/chrislusf/seaweedfs/weed/glog.(*loggingT).printf(0x363eb40, 0x3, 0x22e8ae5, 0x26, 0xc0006d19b8, 0x2, 0x2)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:656 +0x153
filer_1   | github.com/chrislusf/seaweedfs/weed/glog.Fatalf(...)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:1149
filer_1   | github.com/chrislusf/seaweedfs/weed/filer.(*Filer).LoadConfiguration(0xc0007173f0, 0x3635f60)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/filer/configuration.go:25 +0xf7e
filer_1   | github.com/chrislusf/seaweedfs/weed/server.NewFilerServer(0xc000737580, 0xc000737580, 0xc0001f2cc0, 0x1, 0x0, 0x0)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/server/filer_server.go:127 +0x593
filer_1   | github.com/chrislusf/seaweedfs/weed/command.(*FilerOptions).startFiler(0x363e8c0)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/command/filer.go:159 +0x338
filer_1   | github.com/chrislusf/seaweedfs/weed/command.runFiler(0x361f1c0, 0xc000120170, 0x0, 0x0, 0x0)
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/command/filer.go:138 +0x92
filer_1   | main.main()
filer_1   |     /home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/weed.go:66 +0x30f
master_1  | I0314 09:39:43     1 master_grpc_server.go:261] - client filer@172.24.0.3:8888
example_filer_1 exited with code 255

Expected behavior
As the /data folder already exists in the docker contianer I would expect the filer to create the /data/filerldb3 directory on startup.

The default storage location /data/filerldb2 is already created in the Dockerfile, but there is no obvious way to create the additional required directory without creating a custom Dockerfile or overriding the entrypoint to do a mkdir first.

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

No branches or pull requests

1 participant