I am having issues with Pika giving a timeout error. The same code (below) works fine in other environments, but fails in this one.
connection = pika.BlockingConnection(pika.ConnectionParameters(host=host))
rabbitmqctl status
[{pid,30059},
{running_applications,[{rabbit,"RabbitMQ","2.8.2"},
{os_mon,"CPO CXC 138 46","2.2.4"},
{sasl,"SASL CXC 138 11","2.1.8"},
{mnesia,"MNESIA CXC 138 12","4.4.12"},
{stdlib,"ERTS CXC 138 10","1.16.4"},
{kernel,"ERTS CXC 138 10","2.13.4"}]},
{os,{unix,linux}},
{erlang_version,"Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:30] [hipe] [kernel-poll:true]\n"},
{memory,[{total,76031440},
{processes,57368952},
{processes_used,57354128},
{system,18662488},
{atom,1119593},
{atom_used,1112833},
{binary,205008},
{code,12015821},
{ets,1407392}]},
{vm_memory_high_watermark,0.39999999993657753},
{vm_memory_limit,5045529804},
{disk_free_limit,12613824512},
{disk_free,10839289856},
{file_descriptors,[{total_limit,924},
{total_used,837},
{sockets_limit,829},
{sockets_used,829}]},
{processes,[{limit,1048576},{used,6763}]},
{run_queue,0},
{uptime,3298}]
...done.
Has anyone hit this before? I'm assuming it is a rabbitmq configuration issue
Check out the RabbitMQ log, you may need to supply login credentials:
pika.BlockingConnection(pika.ConnectionParameters(host, port=port, virtual_host=vhost, credentials=pika.credentials.PlainCredentials(username, password)))
Related
What is the syntax for the configuration file when you start an httpd server like this:
inets:start(httpd,
[{proplist_file, "./server_config.txt"}]
).
The httpd docs say:
{proplist_file, path()}
If this property is defined, Inets expects to find all other
properties defined in this file.
And:
the properties are to be fetched from a configuration file that can
consist of a regular Erlang property list
But with this file:
server_config.txt:
[
{port, 0},
{server_name, "httpd_test"},
{server_root, "/Users/7stud/erlang_programs/inets_proj"},
{document_root, "/Users/7stud/erlang_programs/inets_proj/htdocs"},
{ipfamily, inet6},
{ bind_address, {0,0,0,0,0,0,0,1} }
]
I get the error:
$ erl
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2 (abort with ^G)
1> inets:start().
ok
2> inets:start(httpd, [{proplist_file, "/Users/7stud/erlang_programs/inets_proj/server_config.txt"}]).
** exception error: no try clause matching {error,{8,erl_parse,["syntax error before: ",[]]}}
in function httpd_sup:httpd_config/1 (httpd_sup.erl, line 144)
in call from httpd_sup:start_child/1 (httpd_sup.erl, line 52)
in call from inets:call_service/3 (inets.erl, line 461)
Next, I tried the Apache syntax, and that didn't work either:
server_config.txt:
Port 0
ServerName "httpd_test"
ServerRoot "/Users/7stud/erlang_programs/inets_proj"
DocumentRoot "./htdocs"
Ipfamily inet6
BindAddress {0,0,0,0,0,0,0,1}
3> inets:start(httpd, [{file, "./server_config.txt"}]).
{error,"httpd_conf: \"/Users/7stud/erlang_programs/inets_proj\" is an invalid ServerRoot"}
4>
Okay, I made some progress on the Apache style syntax by getting rid of the quotes:
Port 0
ServerName httpd_test
ServerRoot /Users/7stud/erlang_programs/inets_proj
DocumentRoot ./htdocs
Ipfamily inet6
BindAddress 0:0:0:0:0:0:0:1
Now, I get the error:
8> inets:start(httpd, [{file, "./server_config.txt"}]).
{error,"httpd_conf: 0:0:0:0:0:0:0:1 is an invalid address"}
I figured out the proplist syntax. I shortened up the paths once I got the proplist syntax to work:
server_config.txt:
[
{port, 0},
{server_name, "httpd_test"},
{server_root, "."},
{document_root, "./htdocs"},
{ipfamily, inet6},
{ bind_address, {0,0,0,0,0,0,0,1} }
].
Notice the . at the end! The syntax is so obvious no wonder the docs don't give an example. :(
$ erl
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.2 (abort with ^G)
1> inets:start().
ok
2> {ok, Server} = inets:start(httpd, [{proplist_file, "./server_config.txt"}]).
{ok,<0.73.0>}
3> httpd:info(Server).
[{mime_types,[{"htm","text/html"},{"html","text/html"}]},
{ipfamily,inet6},
{server_name,"httpd_test"},
{bind_address,{0,0,0,0,0,0,0,1}},
{server_root,"."},
{port,49400},
{document_root,"./htdocs"}]
I'm still wondering how to specify an ipv6 bind address with the Apache syntax. Maybe ipv6 came after the erlang Apache syntax was implemented?
I followed the tutorial many times and, created a small app using rebar and release it successfully. But when I come to the main application (calendarApp), crash dump was returned. I made some changes but the result is the same. I would like to know what I am doing wrong, and how I can fix this.
At the end, when I do start and attach, it returns "Node is not running!".
I will show you:
sonu#sonu-Ideapad-Z570:~/calendarApp/rel$ ./calendarApp/bin/calendarApp console
Exec: /home/sonu/release/calendarApp/rel/calendarApp/erts-5.10.4/bin/erlexec -boot /home/sonu/release/calendarApp/rel/calendarApp/releases/1/calendarApp -mode embedded -config /home/sonu/release/calendarApp/rel/calendarApp/releases/1/sys.config -args_file /home/sonu/release/calendarApp/rel/calendarApp/releases/1/vm.args -- console
Root: /home/sonu/release/calendarApp/rel/calendarApp
Erlang R16B03 (erts-5.10.4) [source] [smp:4:4] [async-threads:10] [kernel-poll:false]
{global,calendarApp_sup} (<0.216.0>) starting....
{global,calendarApp_server} (<0.217.0>) starting ......
Eshell V5.10.4 (abort with ^G)
(calendarApp#127.0.0.1)1>
=INFO REPORT==== 19-Jan-2016::09:50:45 ===
application: calendarApp
exited: {{shutdown,
{failed_to_start_child,calendarApp_server,
{undef,
[{mnesia,create_schema,
[['calendarApp#127.0.0.1']],
[]},
{calendarApp_db,init,0,
[{file,"src/calendarApp_db.erl"},{line,7}]},
{calendarApp_server,init,1,
[{file,"src/calendarApp_server.erl"},{line,49}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}},
{calendarApp_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller," {application_start_failure,calendarApp,{{shutdown,{failed_to_start_child,calendarApp_server,{undef,[{mnesia,create_schema,[['calendarApp#127.0.0.1']],[]},{calendarApp_db,init,0,[{file,\"src/calendarApp_db.erl\"},{line,7}]},{calendarApp_server,init,1,[{file,\"src/calendarApp_server.erl\"},{line,49}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,239}]}]}}},{calendarApp_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,calendarApp,{{shutdown,{failed_to_start_child,calendarApp_server,{undef,[{mnesia,create_schema, [['calendarApp#127.0.0.1']],
sonu#sonu-Ideapad-Z570:~/calendarApp/rel$ ./calendarApp/bin/calendarApp console
If anyone knows the problem, please help me to fix this.
When I am trying to install yaws 1.89, the error bellow is raised. Please help me to overcome that error.
~/yaws$ sudo yaws
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:true]
Eshell V5.10.4 (abort with ^G)
1> =ERROR REPORT==== 14-Mar-2014::15:05:09 ===
Failed to load setuid_drv (from "/usr/local/lib/yaws/priv/lib") : "Driver compiled with incorrect version of erl_driver.h"
=ERROR REPORT==== 14-Mar-2014::15:05:09 ===
FATAL {'EXIT',normal}
=INFO REPORT==== 14-Mar-2014::15:05:09 ===
application: yaws
exited: {{shutdown,
{failed_to_start_child,yaws_server,
{badconf,
[{yaws_server,init,1,
[{file,"yaws_server.erl"},{line,159}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]}}},
{yaws_app,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{{shutdown,{failed_to_start_child,yaws_server,{badconf,[{yaws_server,init,1,[{file,\"yaws_server.erl\"},{line,159}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,239}]}]}}},{yaws_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{{shutdown,{failed_to_start_child,yaws_server,{badconf,[{yaws_server,init,1,[{file,"yaws_server.erl"},{line,159}]},{ge
Yaws 1.89 was released in September 2010, but you're trying to run it on a newer version of Erlang, R16B03, which was released in December 2013. The drivers Yaws uses, which are compiled native code, were compiled using a version of the Erlang driver interface that doesn't match that of the Erlang version you're running, which is what causes the error messages you're seeing.
Your comment above hints that you were able to get it working by downloading yaws-1.89.tar.gz and building it yourself; if so, then yes, that's a good way to get it working with your current version of Erlang. But a better way would be to use a newer version of Yaws — the latest version at this time of writing is Yaws 1.98, released in November 2013.
I get this message when launching RabbitMQ:
=WARNING REPORT==== 8-Feb-2014::10:43:42 ===
Only 2048MB of 23482MB memory usable due to limited address space.
Crashes due to memory exhaustion are possible - see
http://www.rabbitmq.com/memory.html#address-space
When I follow that link, I read about how I should be using a 64-bit Erlang VM. But:
ajax:~ maxvitek$ erl
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.10.4 (abort with ^G)
1>
...which certainly appears to be a 64-bit build. This is with the vm_memory_high_watermark set to 1. If I can get rid of the memory address problem so that RabbitMQ could use more of the system's memory, I will set that back to 0.4. Any idea where to look to fix this?
Both Erlang and RabbitMQ are installed via Homebrew, running on Mavericks.
Am running Nitrogen 2.0.X on Windows 7 Home Premium, HP Pavilion Entertainment PC Laptop.
Nitrogen starts with inets and i have failed to change or dictate the IP address of the webserver.
Once it starts, it tells me to go to my browser and hit http://localhost:8000 in the shell output below:
erl -make
Starting Nitrogen on Inets (http://localhost:8000)...
Eshell V5.8.4 (abort with ^G)
Hitting the link in almost all available browsers shows that page could not be found. When i ask the emulator about the ports, this is its output:
(motv#josh.ekampus.internal)1> inet:i().
Port Module Recv Sent Owner Local Address Foreign Address State
3109 inet6_tcp 0 0 *:8000 *:* ACCEPTING
618 inet_tcp 0 0 *:9543 *:* ACCEPTING
637 inet_tcp 4 19 localhost:9544 localhost:4369 CONNECTED
Port Module Recv Sent Owner Local Address Foreign Address State
ok
(motv#josh.ekampus.internal)2>
Am having a strong thought that inet6_tcp means that its using IPv6 while inet_tcp means IPv4, not very sure about this. But all in all, i cannot connect to my Nitrogen. These below are the running applications
(motv#josh.ekampus.internal)2> application:which_applications().
[{quickstart,"Nitrogen Quickstart",[]},
{inets,"INETS CXC 138 49","5.6"},
{nprocreg,"NProcReg - Simple Erlang Process Registry.",
"0.1"},
{stdlib,"ERTS CXC 138 10","1.17.4"},
{kernel,"ERTS CXC 138 10","2.14.4"}]
(motv#josh.ekampus.internal)3>
Can someone explain why i cannot Reach my Local Nitrogen Framework by just hitting http://localhost:8000 in the browser, given the observations above? And, how can i connect to it from my browser?
Some guesses:
Did you try http://127.0.0.1:8000 ?
If that doesn't work, can you startup erlang with forced ip4 support (i think):
-proto_dist inet_tcp