facebook/mcrouter

Problem starting mcrouter, error on invalid ports

shahar-fleischman opened this issue · 8 comments

I saw this issue #85
And tried to set the validate option

mcrouter)# ./mcrouter /mcrouter/mcrouter
E0127 06:31:40.325755 22492 mcrouter_config.cpp:38] CRITICAL: Couldn't initialize from standalone flavor file /mcrouter/mcrouter
E0127 06:31:40.325983 22492 StandaloneUtils.cpp:124] invalid ports
39.0.0-master mcrouter
usage: [options] -p port(s) --config file:

Standalone config file:

{
"libmcrouter_options": {
"default_route": “/reg1/dc1/“,
"config_file": "/mcrouter/mcrouter.config",
"server_timeout_ms": "10000",
"num_proxies": "24"
},
"standalone_options": {
"log_path": "/mcrouter/mcrouter.log",
"validate-config": "exit",
"port": "5000"
}
}

Please help.

Hey, I think that the command you're running does not match the usage doc, please run "./mcrouter --help" and make sure you're providing the right arguments.

Hi

I've looked at the help before, and even tried to run with the minimal 2 options needed:
{
"libmcrouter_options": {
"config_file": "/mcrouter/mcrouter.config"
},
"standalone_options": {
"ports": "5000"
}
}

And still got the same error of invalid port(s).
I also did a check and ran mcrouter with options from CLI and checked the live config file to verify how the options look when using a flavor file, and got the same results.

Can you please re-post the exact command you are running, the config file name and contents, and the output?

Running:
./mcrouter /mcrouter/mcrouter

content of /mcrouter/mcrouter-standalone:
{
"libmcrouter_options": {
"config_file": "/mcrouter/mcrouter.config"
},
"standalone_options": {
"ports": "5000"
}
}

do you also need /mcrouter/mcrouter.config ?

can you try running it from the directory where the flavor file resides?

$ cd /mcrouter
$ <path-to-mcrouter-binary> mcrouter

I think I've found the problem.
if your mcrouter exe is in the same dir as the standalone config and the flavor file is named mcrouter-standalone you will encounter this problem.
If you either move the flavor file to another dir, or change it's name to something else other than mcrouter-standalone(example bla-standalone) it will work.
After that I the got real errors.

I still wish the error will be related to the problem.
It was hard to identify it like that.
Is it a bug, or should it be a feature request ?

I agree that the error message can be improved. Feel free to open an issue.