[BUG] Protocol header verification problem
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- java
- Domain
- backend, distributed-systems
Research direction
Start with io.streamnative.pulsar.handlers.amqp.AmqpConnection.receiveProtocolHeader and the decoder path shown in the stack trace, especially AmqpBrokerDecoder.decodeBuffer. Reproduce the unsupported protocol initiation on the AMQP connection and compare the received header with the expected AMQP header. Done means the reported protocol-header failure is understood and the handler behaves correctly for the relevant input.
Written by the indexing model from the issue text.
Description
Describe the bug
2022-06-29T00:56:24,383+0800 [pulsar-ph-amqp-35-1] ERROR io.streamnative.pulsar.handlers.amqp.AmqpConnection - Received unsupported protocol initiation for protocol version: 0-91
org.apache.qpid.server.protocol.v0_8.transport.AMQProtocolHeaderException: Protocol header is not correct: Got ÿôÿý should be: AMQP
at org.apache.qpid.server.protocol.v0_8.transport.ProtocolInitiation.checkVersion(ProtocolInitiation.java:172) ~[?:?]
at io.streamnative.pulsar.handlers.amqp.AmqpConnection.receiveProtocolHeader(AmqpConnection.java:402) ~[?:?]
at org.apache.qpid.server.protocol.v0_8.AMQDecoder.decode(AMQDecoder.java:125) ~[?:?]
at org.apache.qpid.server.protocol.v0_8.ServerDecoder.decodeBuffer(ServerDecoder.java:44) ~[?:?]
at io.streamnative.pulsar.handlers.amqp.AmqpBrokerDecoder.decodeBuffer(AmqpBrokerDecoder.java:62) ~[?:?]
at io.streamnative.pulsar.handlers.amqp.AmqpConnection.channelRead(AmqpConnection.java:153) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
at java.lang.Thread.run(Thread.java:833) [?:?]
2022-06-29T00:56:24,384+0800 [pulsar-ph-amqp-35-1] ERROR io.streamnative.pulsar.handlers.amqp.AmqpConnection - error while handle command:
java.lang.RuntimeException: org.apache.qpid.server.protocol.v0_8.transport.AMQProtocolHeaderException: Protocol header is not correct: Got ÿôÿý should be: AMQP
at io.streamnative.pulsar.handlers.amqp.AmqpConnection.receiveProtocolHeader(AmqpConnection.java:416) ~[?:?]
at org.apache.qpid.server.protocol.v0_8.AMQDecoder.decode(AMQDecoder.java:125) ~[?:?]
at org.apache.qpid.server.protocol.v0_8.ServerDecoder.decodeBuffer(ServerDecoder.java:44) ~[?:?]
at io.streamnative.pulsar.handlers.amqp.AmqpBrokerDecoder.decodeBuffer(AmqpBrokerDecoder.java:62) ~[?:?]
at io.streamnative.pulsar.handlers.amqp.AmqpConnection.channelRead(AmqpConnection.java:153) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[io.netty-netty-transport-4.1.77.Final.jar:4.1.77.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.apache.qpid.server.protocol.v0_8.transport.AMQProtocolHeaderException: Protocol header is not correct: Got ÿôÿý should be: AMQP
at org.apache.qpid.server.protocol.v0_8.transport.ProtocolInitiation.checkVersion(ProtocolInitiation.java:172) ~[?:?]
at io.streamnative.pulsar.handlers.amqp.AmqpConnection.receiveProtocolHeader(AmqpConnection.java:402) ~[?:?]
... 20 more
2022-06-29T00:56:24,384+0800 [pulsar-ph-amqp-35-1] INFO io.streamnative.pulsar.handlers.amqp.AmqpConnection - close netty channel [id: 0x0b5b1b85, L:/127.0.0.1:5672 - R:/127.0.0.1:50566]
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
- Dominant language
- Java
- Stars
- 123
- Forks
- 41
- Avg merge
- 4h 43m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from streamnative/aop
-
type/bug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
streamnative/aop#1904 ·
-
type/bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
streamnative/aop#1872 ·
-
type/bug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
streamnative/aop#1870 ·
-
type/bug
Difficulty 3/5 1-2 days Newbie friendliness 38/100
streamnative/aop#1699 ·
-
type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
streamnative/aop#1197 ·
All issues in streamnative/aop
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100