# TIL-20210914
# Today
- RabbitMQ Issue handle
# Content
문제상황 MQ HTML Client 상에서 Virtual host (Vhost)를
/
생성해도 NestJS MS가 인식하지 못하는 현상
# Error massge (HTML Client)
Virtual host / experienced an error on node rabbit@localhost and may be inaccessible
해당 Vhost를 생성하고 Admin user를 설정하더라도 Vhost Restart를 하지 못해서 접근이 불가능한 상황
# Error log
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> Unable to recover vhost <<"/">> data. Reason {error,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {{{badmatch,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {error,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {"/usr/local/var/lib/rabbitmq/mnesia/rabbit@localhost/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L/msg_store_transient/file_summary.ets",
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> eacces}}},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> [{rabbit_msg_store,init,1,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> [{file,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> "src/rabbit_msg_store.erl"},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {line,724}]},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {gen_server2,init_it,6,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> [{file,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> "src/gen_server2.erl"},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {line,565}]},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {proc_lib,init_p_do_apply,3,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> [{file,"proc_lib.erl"},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {line,226}]}]},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {child,undefined,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> msg_store_transient,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {rabbit_msg_store,start_link,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> [msg_store_transient,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> "/usr/local/var/lib/rabbitmq/mnesia/rabbit@localhost/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L",
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> undefined,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> {#Fun<rabbit_variable_queue.0.124157698>,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> ok}]},
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> transient,600000,worker,
2021-09-13 18:06:13.086926+09:00 [erro] <0.4063.0> [rabbit_msg_store]}}}
# solution
var/rabbitmq에 접근해 해당 키 값 (지금 상황에서는 628WB79CIFDYO9LJI6DKMI09L)을 가진 Directory를 삭제하고 다시 Vhost를 생성하면 정상적으로 Vhost가 작동함
# Conclution
Vhost 관련 설정등이 해당 Directory에 남으면서 /
경로에 따라 생성되는 Directory가 정상적으로 생성되지 않아서 생기는 문제인 듯 하다.