[graylog2] Re: Incomplete write in php gelf library

2017-01-13 Thread Jochen Schalanda
Hi,

On Friday, 13 January 2017 12:50:53 UTC+1, Алексей Лашнев wrote:
>
> I'have aready done it. https://github.com/bzikarsky/gelf-php/issues/78 - 
> but there is no reply yet. So i don't know what's the problem there? In 
> graylog or in the library...
>

Since the error message originates from the PHP library, it's a problem 
with either the library, how you integrate the library in your PHP 
application, or with your PHP setup.

Cheers,
Jochen 

-- 
You received this message because you are subscribed to the Google Groups 
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to graylog2+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/graylog2/21018e93-4ce4-4b31-b57e-5f1c299f3099%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[graylog2] Re: Incomplete write in php gelf library

2017-01-13 Thread Алексей Лашнев
I'have aready done it. https://github.com/bzikarsky/gelf-php/issues/78 - 
but there is no reply yet. So i don't know what's the problem there? In 
graylog or in the library...
So, i wrote error here too.

On Thursday, January 12, 2017 at 4:29:00 PM UTC+3, Jochen Schalanda wrote:
>
> Hi,
>
> make sure that you're using the latest version of the gelf-php library 
> from https://github.com/bzikarsky/gelf-php. If the problem still occurs, 
> please create a bug report at 
> https://github.com/bzikarsky/gelf-php/issues/.
>
> Cheers,
> Jochen
>
> On Thursday, 12 January 2017 10:35:09 UTC+1, Алексей Лашнев wrote:
>>
>> Hello! I have the probmer with writing logs into gray log with gelf-php 
>> library from time to time.
>> I have 2 servers. Main - with high load and reserve (absolutely copy of 
>> the main server). On the reserve server is all ok. And when i use manually 
>> (with php-gelf) graylog on main server - all is ok! But sometimes i have 
>> the exception from the library:
>>
>> Incomplete write: Only 0 of 358 written in 
>> /data/home/projects/payprocessing/classes/vendor/graylog2/gelf-php/src/Gelf/Transport/StreamSocketClient.php:212
>>
>> Here is the message send to socket:
>>
>> {
>> "version": "1.0",
>> "host": "pay-1.reserve.lan",
>> "short_message": "Redirect to https://www.platron.ru/payment_params.;,
>> "full_message": "Redirect to 
>> https://www.platron.ru/payment_params.php?customer=5d44643437990b1774efb742ed1fb9a031005685\r\n(Process
>>  
>> number: 84073)",
>> "level": 6,
>> "timestamp": 1484144247.0146,
>> "facility": "paypocessing",
>> "file": "Platron::payment"
>> }
>>
>>
>> Some code from library:
>>
>>
>> $socket = $this->getSocket();
>>
>> $byteCount = @fwrite($socket, $buffer);
>>
>> $bufLen = strlen($buffer);
>>
>>
>> if ($byteCount === false) {
>>
>> throw new \RuntimeException("Failed to write to socket");
>>
>> }
>>
>>
>> if ($byteCount !== $bufLen) {
>>
>> throw new \RuntimeException("Incomplete write: Only $byteCount of $bufLen 
>> written");
>>
>> }
>>
>>
>> I try to send it manually. And all is ok. The socket is ok at this line - 
>> i checked that. I thy to call fwite 3 times (because of description fwrite 
>> php function could not to write some times) - and it's don't work.
>>
>>
>> One more comment. Log from GrayLog about this error:
>>
>> 2017-01-12T11:45:15.267+03:00 ERROR [NettyTransport] Error in Input
>> [GELF TCP/585a6742565c11041d194d7c] (channel [id: 0xb735c24e,
>> /10.1.1.10:45950 => /10.1.2.21:12201])
>> java.lang.IllegalStateException: GELF message is too short. Not even the
>> type header would fit.
>> at
>>
>> org.graylog2.inputs.codecs.gelf.GELFMessage.getGELFType(GELFMessage.java:46)
>> ~[graylog.jar:?]
>> at
>>
>> org.graylog2.inputs.codecs.GelfChunkAggregator.addChunk(GelfChunkAggregator.java:95)
>> ~[graylog.jar:?]
>> at
>>
>> org.graylog2.plugin.inputs.transports.NettyTransport$MessageAggregationHandler.messageReceived(NettyTransport.java:303)
>> ~[graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
>> ~[graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
>> [graylog.jar:?]
>> at
>> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.SimpleChannelHandler.messageReceived(SimpleChannelHandler.java:142)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
>> [graylog.jar:?]
>> at
>>
>> org.jboss.netty.handler.traffic.AbstractTrafficShapingHandler.messageReceived(AbstractTrafficShapingHandler.java:718)
>> [graylog.jar:?]
>> at
>>
>> 

[graylog2] Re: Incomplete write in php gelf library

2017-01-12 Thread Jochen Schalanda
Hi,

make sure that you're using the latest version of the gelf-php library from 
https://github.com/bzikarsky/gelf-php. If the problem still occurs, please 
create a bug report at https://github.com/bzikarsky/gelf-php/issues/.

Cheers,
Jochen

On Thursday, 12 January 2017 10:35:09 UTC+1, Алексей Лашнев wrote:
>
> Hello! I have the probmer with writing logs into gray log with gelf-php 
> library from time to time.
> I have 2 servers. Main - with high load and reserve (absolutely copy of 
> the main server). On the reserve server is all ok. And when i use manually 
> (with php-gelf) graylog on main server - all is ok! But sometimes i have 
> the exception from the library:
>
> Incomplete write: Only 0 of 358 written in 
> /data/home/projects/payprocessing/classes/vendor/graylog2/gelf-php/src/Gelf/Transport/StreamSocketClient.php:212
>
> Here is the message send to socket:
>
> {
> "version": "1.0",
> "host": "pay-1.reserve.lan",
> "short_message": "Redirect to https://www.platron.ru/payment_params.;,
> "full_message": "Redirect to 
> https://www.platron.ru/payment_params.php?customer=5d44643437990b1774efb742ed1fb9a031005685\r\n(Process
>  
> number: 84073)",
> "level": 6,
> "timestamp": 1484144247.0146,
> "facility": "paypocessing",
> "file": "Platron::payment"
> }
>
>
> Some code from library:
>
>
> $socket = $this->getSocket();
>
> $byteCount = @fwrite($socket, $buffer);
>
> $bufLen = strlen($buffer);
>
>
> if ($byteCount === false) {
>
> throw new \RuntimeException("Failed to write to socket");
>
> }
>
>
> if ($byteCount !== $bufLen) {
>
> throw new \RuntimeException("Incomplete write: Only $byteCount of $bufLen 
> written");
>
> }
>
>
> I try to send it manually. And all is ok. The socket is ok at this line - 
> i checked that. I thy to call fwite 3 times (because of description fwrite 
> php function could not to write some times) - and it's don't work.
>
>
> One more comment. Log from GrayLog about this error:
>
> 2017-01-12T11:45:15.267+03:00 ERROR [NettyTransport] Error in Input
> [GELF TCP/585a6742565c11041d194d7c] (channel [id: 0xb735c24e,
> /10.1.1.10:45950 => /10.1.2.21:12201])
> java.lang.IllegalStateException: GELF message is too short. Not even the
> type header would fit.
> at
>
> org.graylog2.inputs.codecs.gelf.GELFMessage.getGELFType(GELFMessage.java:46)
> ~[graylog.jar:?]
> at
>
> org.graylog2.inputs.codecs.GelfChunkAggregator.addChunk(GelfChunkAggregator.java:95)
> ~[graylog.jar:?]
> at
>
> org.graylog2.plugin.inputs.transports.NettyTransport$MessageAggregationHandler.messageReceived(NettyTransport.java:303)
> ~[graylog.jar:?]
> at
>
> org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
> ~[graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> [graylog.jar:?]
> at
> org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
> [graylog.jar:?]
> at
>
> org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
> [graylog.jar:?]
> at
>
> org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
> [graylog.jar:?]
> at
>
> org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.SimpleChannelHandler.messageReceived(SimpleChannelHandler.java:142)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> [graylog.jar:?]
> at
>
> org.jboss.netty.handler.traffic.AbstractTrafficShapingHandler.messageReceived(AbstractTrafficShapingHandler.java:718)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> [graylog.jar:?]
> at
>
> org.jboss.netty.channel.SimpleChannelUpstreamHandler.messageReceived(SimpleChannelUpstreamHandler.java:124)
>