REST LogAppender在AWS beantalk上发布数据时给出500和400错误 [英] REST LogAppender giving 500 and then 400 error while posting data on aws beanstalk

查看:82
本文介绍了REST LogAppender在AWS beantalk上发布数据时给出500和400错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Zeppelin演示应用程序中配置了3个日志附加程序.其中两个是cassandra日志附加程序,另一个是REST日志附加程序. Cassandra日志附加程序运行正常,我可以在AWS EC2主机上的cassandra DB和zeppelin中查看数据,但是REST日志附加程序无法发送数据.

I have configured 3 log appenders in my zeppelin demo app. Two of them are cassandra log appenders and other one is REST log appender. Cassandra log appenders are working fine and I am able to see the data in cassandra DB and zeppelin on AWS EC2 host but the REST log appender is not able to send the data.

我将主机保留为localhost,并尝试使用默认端口和新端口,但似乎无济于事. AWS安全设置中同时打开了默认端口和新端口.因此,主机或端口定义没有问题.

I have kept the host as localhost and have tried the default and a new port as well but nothing seems to work. Both the default and new ports are open in the AWS security settings. So no issue with the host or port definition.

日志如下所示.

2017-02-06 23:53:57,240 [pool-33-thread-1] TRACE o.k.k.s.a.r.appender.RestLogAppender - [24510582477967418632] executing POST http://enmonitor.ap-south-1.elasticbeanstalk.com:80/powerdata HTTP/1.1


2017-02-06 23:53:57,240 [nioEventLoopGroup-9-1] TRACE o.k.k.s.t.t.t.netty.KaaTcpEncoder - Returned future [DefaultChannelPromise@2a198e0d(failure: java.nio.channels.ClosedChannelException)] isSuccess [false] isDone [true] isCancelled [false] cause [java.nio.channels.ClosedChannelException] for frame MqttFrame [messageType=KAASYNC, currentState=NONE] 

2017-02-06 23:53:57,246 [nioEventLoopGroup-9-1] TRACE o.k.k.s.t.t.t.netty.KaaTcpEncoder - Write operation failed due to: java.nio.channels.ClosedChannelException: null 


2017-02-06 23:53:57,319 [pool-33-thread-1] TRACE o.k.k.s.a.r.appender.RestLogAppender - [24510582477967418632] received HTTP/1.1 500 Internal Server Error [Content-Type: text/html; charset=UTF-8, Date: Mon, 06 Feb 2017 18:23:57 GMT, Server: Apache/2.4.25 (Amazon) mod_wsgi/3.5 Python/3.4.3, transfer-encoding: chunked, Connection: keep-alive] response code 

2017-02-06 23:53:57,321 [pool-33-thread-1] WARN  o.k.k.s.a.r.appender.RestLogAppender - [RestLogAppender] bad response code 500 


2017-02-06 23:53:57,328 [nioEventLoopGroup-9-1] TRACE o.k.k.s.t.t.t.netty.KaaTcpEncoder - Write operation failed due to: java.nio.channels.ClosedChannelException: null

推荐答案

我遇到的500错误是由于以下原因造成的:

The 500 error that I was facing was due to following:

在管理面板中,我的RestLogAppender配置发现两个错误.首先,我将http://放在主持人前面.不得不删除相同的.其次,我应该提到相对URI路径,以反斜杠/开头和结束.

I found two errors with my configuration of RestLogAppender in the admin panel. First, I had put http:// before my host. Had to remove the same. Second, I should have mentioned Relative URI path starting and ending with a forward slash /.

解决500个错误之后,我仍然遇到400个错误.这是由于以下原因:

After resolving 500 error, I was still getting 400 error. It was due to the following reasons:

我给Django模型中的JSON字段取了些许不同的名称.字段的顺序无关紧要,但是字段的名称很重要.

I had given slightly different names to the JSON fields in the Django models. The sequence of the fields did not matter but the name of fields did matter.

这篇关于REST LogAppender在AWS beantalk上发布数据时给出500和400错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆