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

brick_default_data_dir does not take an absolute path #15

Open
tatsuya6502 opened this issue Mar 24, 2013 · 1 comment
Open

brick_default_data_dir does not take an absolute path #15

tatsuya6502 opened this issue Mar 24, 2013 · 1 comment
Milestone

Comments

@tatsuya6502
Copy link
Member

Hibari v0.3 and earlier

Brick server won't start if brick_defalt_data_dir is not a relative path from Hibari's installation directory (e.g. /data/brick instead of data/brick).

sys.config

 {gdss_brick,
  [{brick_default_data_dir, "/data/brick"},

hibari-admin bootstrap

./tmp/hibari/bin/hibari-admin bootstrap
RPC(bootstrap) to 'hibari@127.0.0.1' failed: {'EXIT',
                                              {{badmatch,
                                                {error,
                                                 {[],
                                                  [{bootstrap_copy1,
                                                    'hibari@127.0.0.1'}]}}},
                                               [{brick_admin,bootstrap1,9,
                                                 [{file,"src/brick_admin.erl"},
                                                  {line,2078}]},
                                                {rpc,
                                                 '-handle_call_call/6-fun-0-',
                                                 5,
                                                 [{file,"rpc.erl"},
                                                  {line,203}]}]}}

console.log

2013-03-24 18:54:40.965 [error] <0.611.0> CRASH REPORT Process commonLogServer_hlog with 0 neighbours exited with reason: no match of right hand value {error,enoent} in gmt_hlog:write_permanent_config_maybe/2 line 629 in gen_server:init_it/6 line 328
2013-03-24 18:54:40.965 [error] <0.610.0>@gmt_hlog_common:init:233 init error: error {badmatch,{error,{{badmatch,{error,enoent}},[{gmt_hlog,write_permanent_config_maybe,2,[{file,"src/gmt_hlog.erl"},{line,629}]},{gmt_hlog,init,1,[{file,"src/gmt_hlog.erl"},{line,493}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}}} at [{gmt_hlog_common,init,1,[{file,"src/gmt_hlog_common.erl"},{line,196}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]
2013-03-24 18:54:40.978 [info] <0.491.0> Application gdss_brick started on node 'hibari@127.0.0.1'
2013-03-24 18:54:40.978 [info] <0.491.0> Application gdss_client started on node 'hibari@127.0.0.1'
2013-03-24 18:54:40.979 [info] <0.491.0> Application gdss_ubf_proto started on node 'hibari@127.0.0.1'
2013-03-24 18:54:40.979 [info] <0.639.0>@brick_admin:start:305 normal start, Args = []
2013-03-24 18:54:41.021 [info] <0.491.0> Application gdss_admin started on node 'hibari@127.0.0.1'
2013-03-24 18:54:50.098 [info] <0.666.0>@brick_server:init:1429 brick_server:init preprocess [#Fun<brick_server.3.7001373>]
2013-03-24 18:54:50.098 [info] <0.666.0>@brick_ets:init:283 top of init: bootstrap_copy1, [{implementation_module,brick_ets},{default_data_dir,"/data/brick"}]
2013-03-24 18:54:50.099 [info] <0.669.0>@gmt_hlog_local:get_or_start_common_log:497 Trying to start commonLogServer
2013-03-24 18:54:50.252 [error] <0.670.0>@gmt_hlog_common:init:233 init error: error {badmatch,{error,{{bad7atch,{error,enoent}},[{gmt_hlog,write_permanent_config_maybe,2,[{file,"src/gmt_hlog.erl"},{line,629}]},{gmt_hlog,init,1,[{file,"src/gmt_hlog.erl"},{line,493}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}}} at [{gmt_hlog_common,init,1,[{file,"src/gmt_hlog_common.erl"},{line,196}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]
2013-03-24 18:54:50.252 [error] <0.671.0> CRASH REPORT Process commonLogServer_hlog with 0 neighbours exited with reason: no match of right hand value {error,enoent} in gmt_hlog:write_permanent_config_maybe/2 line 629 in gen_server:init_it/6 line 328
2013-03-24 18:54:50.257 [error] <0.669.0> CRASH REPORT Process bootstrap_copy1_hlog with 0 neighbours exited with reason: no match of right hand value {error,enoent} in brick_server:replace_file_sync/3 line 5517 in gen_server:init_it/6 line 328
2013-03-24 18:54:50.259 [error] <0.666.0> CRASH REPORT Process bootstrap_copy1 with 0 neighbours exited with reason: no match of right hand value {error,{{badmatch,{error,enoent}},[{brick_server,replace_file_sync,3,[{file,"src/brick_server.erl"},{line,5517}]},{gmt_hlog_local,do_advance_seqnum,2,[{file,"src/gmt_hlog_local.erl"},{line,474}]},{gmt_hlog_local,init,1,[{file,"src/gmt_hlog_local.erl"},{line,320}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}} in brick_ets:init/1 line 321 in gen_server:init_it/6 line 328
2013-03-24 18:54:58.340 [error] <0.663.0>@brick_admin:poll_brick_status2:2200 poll_brick_status2: bootstrap_copy1 'hibari@127.0.0.1' -> {'EXIT',{noproc,{gen_server,call,[{bootstrap_copy1,'hibari@127.0.0.1'},{status},100]}}}
2013-03-24 18:54:58.345 [info] <0.663.0>@brick_admin:start_standalone_brick:1038 brick bootstrap_copy1 'hibari@127.0.0.1' started: {error,{'EXIT',{noproc,{...}}}}
@tatsuya6502
Copy link
Member Author

The reason is the following functions add prefix ././ to brick_default_data_dir.

Path = "././" ++ S#state.dir,

To address this issue:

  1. Use a better way that works with both relative and absolute paths.
  2. Add a condition to handle enoent error and log more informative error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant