RabbitMQ管理API调用失败:HTTP 500:内部服务器错误

时间:2017-01-15 22:45:24

标签: python rabbitmq celery

我正在使用带有RabbitMQ的Celery Flower作为消息代理。但我是:得到讨厌的错误

  

错误 - RabbitMQ管理API调用失败:HTTP 500:内部服务器错误

每次我尝试在RabbitMQ管理界面(http://localhost:15672/#/queues)或Celery Broker(http://localhost:5555/broker)上访问RabbitMQ队列时。

以下是详细的日志信息:

  

=错误报告==== 2017年1月15日:: 23:12:19 === webmachine错误:path =" / api / queues /%2F" {错误,错误{,function_clause,   [{mochijson2,json_encode_string_unicode,   [{error,[],<<<<<<<<<<<<<<<<<<<"<&n; ],   [{文件," SRC / mochijson2.erl"},{线,274}]},   {mochijson2,' -json_encode_proplist / 2-乐趣0 - ',3,   [{文件," SRC / mochijson2.erl"},{线,198}]},   {列表,与foldl,3,[{文件," lists.erl"},{线,1248}]},   {mochijson2,json_encode_proplist,2,   [{文件," SRC / mochijson2.erl"},{线,202}]},   {mochijson2,' -json_encode_proplist / 2-乐趣0 - ',3,   [{文件," SRC / mochijson2.erl"},{线,199}]},   {列表,与foldl,3,[{文件," lists.erl"},{线,1248}]},   {mochijson2,json_encode_proplist,2,   [{文件," SRC / mochijson2.erl"},{线,202}]},   {mochijson2,' -json_encode_array / 2-乐趣0 - ',3,   [{文件," SRC / mochijson2.erl"},{线,189}]}]}}

RabbitMQ网站管理给了我:

  

获得带有正文的响应代码500 {"错误":"内部服务器   错误""理由":" {错误,错误{,function_clause,\ n   [{mochijson2,json_encode_string_unicode,\ n   [{error,[],<<<<<<<<<<<<<<<<<<<<<<<<<<&n;编号   " \""],\ n [{file," src / mochijson2.erl"},{line,274}]},\ n   {mochijson2,' -json_encode_proplist / 2-乐趣0 - ',3,\ n   [{文件," SRC / mochijson2.erl"},{线,198}]},\ n   {列表,与foldl,3,[{文件," lists.erl"},{线,1248}]},\ n   {mochijson2,json_encode_proplist,2,\ n   [{文件," SRC / mochijson2.erl"},{线,202}]},\ n   {mochijson2,' -json_encode_proplist / 2-乐趣0 - ',3,\ n   [{文件," SRC / mochijson2.erl"},{线,199}]},\ n   {列表,与foldl,3,[{文件," lists.erl"},{线,1248}]},\ n   {mochijson2,json_encode_proplist,2,\ n   [{文件," SRC / mochijson2.erl"},{线,202}]},\ n   {mochijson2,' -json_encode_array / 2-乐趣0 - ',3,\ n   [{文件," SRC / mochijson2.erl"},{线,189}]}]}} \ n"}

我正在使用:

  • Ubuntu 14.04
  • Python 2.7.6
  • Flower 0.9.1
  • Celery 4.0.2
  • RabbitMQ 3.6.6
  • Erlang / OTP 19

启用RabbitMQ管理插件(rabbitmq-plugins启用rabbitmq_management)。

以下是rabbitmqctl status的输出:

  

[{pid,28609},{running_applications,        [{rabbitmq_management," RabbitMQ管理控制台"," 3.6.6"},         {amqp_client," RabbitMQ AMQP客户"," 3.6.6"},         {rabbitmq_management_agent," RabbitMQ管理代理"," 3.6.6"},         {rabbitmq_web_dispatch," RabbitMQ Web Dispatcher"," 3.6.6"},         {兔," RabbitMQ的"" 3.6.6"},         {os_mon," CPO CXC 138 46"," 2.4.1"},         {webmachine," webmachine"" 1.10.3"},         {mochiweb," MochiMedia Web Server"," 2.13.1"},         {ssl," Erlang / OTP SSL应用程序"," 8.1"},         {public_key,"公钥基础设施"," 1.3"},         {加密," CRYPTO"" 3.7.2"},         {rabbit_common,[]," 3.6.6"},         {xmerl," XML解析器"," 1.3.12"},         {asn1," Erlang ASN1编译器版本4.0.4"," 4.0.4"},         {syntax_tools,"语法工具"," 2.1.1"},         {mnesia," MNESIA CXC 138 12"," 4.14.2"},         {编译器," ERTS CXC 138 10"," 7.0.3"},         {ranch," TCP协议的套接字接受器池。"," 1.2.1"},         {inets," INETS CXC 138 49"," 6.3.4"},         {sasl," SASL CXC 138 11"," 3.0.2"},         {stdlib," ERTS CXC 138 10"," 3.2"},         {kernel," ERTS CXC 138 10"," 5.1.1"}]},{os,{unix,linux}},{erlang_version,        " Erlang / OTP 19 [erts-8.2] [source] [64-bit] [smp:4:4] [async-threads:64] [kernel-poll:true] \ n"},{记忆,        [{总,112070616}         {connection_readers,471152},         {connection_writers,171664},         {connection_channels,494680},         {connection_other,407232},         {queue_procs,534792},         {queue_slave_procs,0},         {插件,2121728},         {other_proc,12017232}         {Mnesia的,93584},         {mgmt_db,5114688},         {msg_index,49304},         {other_ets,1902144},         {二进制52694768}         {代码,24783822}         {原子,1033401},         {other_system,10180425}]},{alarm,[]},{listeners,[{clustering,25672," ::"},{amqp,5672," ::&#34 ;}]},   {vm_memory_high_watermark,0.4},{vm_memory_limit,6691391078},   {disk_free_limit,50000000},{disk_free,59039645696},   {file_descriptors,        [{TOTAL_LIMIT,3996},         {total_used,23},         {sockets_limit,3594},         {sockets_used,20}]},{processes,[{limit,1048576},{used,454}]},{run_queue,0},{uptime,2498},{kernel,{net_ticktime,60}}]

以下是我如何运行Celery:

开始3名芹菜工人:

celery worker -A celeryapp --config celeryconfig --workdir /proj -l DEBUG --soft-time-limit=3500 --time-limit=3600 --autoscale=2,1 -S /proj/states.db -s /proj/celerybeat-schedule.db -f /proj/logs/celery_worker_1_%n%I.log --pidfile /tmp/celery_w1.pid -n worker1@%d
celery worker -A celeryapp --config celeryconfig --workdir /proj -l DEBUG --soft-time-limit=3500 --time-limit=3600 --autoscale=2,1 -S /proj/states.db -s /proj/celerybeat-schedule.db -f /proj/logs/celery_worker_2_%n%I.log --pidfile /tmp/celery_w2.pid -n worker2@%d
celery worker -A celeryapp --config celeryconfig --workdir /proj -l DEBUG --soft-time-limit=3500 --time-limit=3600 --autoscale=2,1 -S /proj/states.db -s /proj/celerybeat-schedule.db -f /proj/logs/celery_worker_3_%n%I.log --pidfile /tmp/celery_w3.pid -n worker3@%d

开始芹菜节拍:

celery beat -A celeryapp --config celeryconfig --workdir /proj -l DEBUG -s /proj/celerybeat-schedule.db -f /proj/logs/celery_%n%I.log --pidfile /tmp/celery.pid

开始芹菜花:

celery flower -A celeryapp --workdir=/proj/ --broker=amqp://guest:guest@localhost:5672// --broker-api=http://guest:guest@localhost:15672/api/ --db=/proj/flower.db --logging=debug --basic-auth=guest:guest

我在RabbitMQ的Github问题中发布了这个问题,但它是rejected

1 个答案:

答案 0 :(得分:0)

你的Elang版本有点老了。

使用上一版本更新它,管理UI需要一个新的Erlang版本

https://www.erlang-solutions.com/resources/download.html

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install erlang