halo-dev / halo

强大易用的开源建站工具。
https://www.halo.run
GNU General Public License v3.0
34.05k stars 9.71k forks source link

文章迁移后页面打不开 #3214

Closed shiker1996 closed 1 year ago

shiker1996 commented 1 year ago

是什么版本出现了此问题?

2.1.0

使用的什么数据库?

MySQL 5.7

使用的哪种方式部署?

Docker Compose

在线站点地址

https://test.shiker.tech/

发生了什么?

迁移后文章地址 http://test.shiker.tech/archives/-yi-wen-springframework-he-xin-gong-neng--ioc-san- 对应迁移前文章地址为: https://shiker.tech/archives/43

相关日志输出

2023-02-02T14:35:58.268+08:00 ERROR 7 --- [or-http-epoll-1] a.w.r.e.AbstractErrorWebExceptionHandler : [0522f67d-614]  500 Server Error for HTTP CONNECT ""

java.lang.IllegalArgumentException: No enum constant org.springframework.web.bind.annotation.RequestMethod.CONNECT
    at java.base/java.lang.Enum.valueOf(Unknown Source) ~[na:na]
    Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
    *__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
    *__checkpoint ⇢ org.springframework.web.filter.reactive.ServerHttpObservationFilter [DefaultWebFilterChain]
    *__checkpoint ⇢ HTTP CONNECT "" [ExceptionHandlingWebHandler]
Original Stack Trace:
        at java.base/java.lang.Enum.valueOf(Unknown Source) ~[na:na]
        at org.springframework.web.bind.annotation.RequestMethod.valueOf(RequestMethod.java:35) ~[spring-web-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition.matchRequestMethod(RequestMethodsRequestCondition.java:157) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition.getMatchingCondition(RequestMethodsRequestCondition.java:135) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.method.RequestMappingInfo.getMatchingCondition(RequestMappingInfo.java:269) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping.getMatchingMapping(RequestMappingInfoHandlerMapping.java:91) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping.getMatchingMapping(RequestMappingInfoHandlerMapping.java:63) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.addMatchingMappings(AbstractHandlerMethodMapping.java:366) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:328) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:297) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping.getHandlerInternal(RequestMappingInfoHandlerMapping.java:105) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:187) ~[spring-webflux-6.0.3.jar:6.0.3]
        at org.springframework.web.reactive.DispatcherHandler.lambda$handle$0(DispatcherHandler.java:150) ~[spring-webflux-6.0.3.jar:6.0.3]
        at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onNext(FluxConcatMapNoPrefetch.java:183) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:335) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:294) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.request(FluxConcatMapNoPrefetch.java:336) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2341) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2215) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoNext$NextSubscriber.onSubscribe(MonoNext.java:70) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onSubscribe(FluxConcatMapNoPrefetch.java:164) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:201) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:83) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4444) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4444) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:82) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoNext$NextSubscriber.onComplete(MonoNext.java:102) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.drain(FluxFilterWhen.java:236) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.onComplete(FluxFilterWhen.java:153) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:357) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:294) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.onSubscribe(FluxFilterWhen.java:200) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:201) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:83) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4444) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[reactor-core-3.5.1.jar:3.5.1]
        at reactor.netty.http.server.HttpServer$HttpServerHandle.onStateChange(HttpServer.java:1006) ~[reactor-netty-http-1.1.1.jar:1.1.1]
        at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:705) ~[reactor-netty-core-1.1.1.jar:1.1.1]
        at reactor.netty.transport.ServerTransport$ChildObserver.onStateChange(ServerTransport.java:477) ~[reactor-netty-core-1.1.1.jar:1.1.1]
        at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:591) ~[reactor-netty-http-1.1.1.jar:1.1.1]
        at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:113) ~[reactor-netty-core-1.1.1.jar:1.1.1]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:223) ~[reactor-netty-http-1.1.1.jar:1.1.1]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499) ~[netty-transport-classes-epoll-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) ~[netty-transport-classes-epoll-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.86.Final.jar:4.1.86.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.86.Final.jar:4.1.86.Final]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

2023-02-02T15:11:29.571+08:00  WARN 7 --- [or-http-epoll-2] r.n.http.server.HttpServerOperations     : [3b785941, L:/172.17.151.253:8090 - R:/205.185.121.101:54458] Decoding failed: FULL_REQUEST(decodeResult: failure(java.lang.IllegalArgumentException: invalid version format: CWJNª ‡TC OΜ—«LÌÌÖ¾+Ô`Á×>#*ž.FE ÏŸ„`5ÞK>À,À0ŸÌ©Ì¨ÌªÀ+À/žÀ$À(KÀ#À'GÀ), version: HTTP/1.0, content: UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf(ridx: 0, widx: 0, cap: 0))
GET /bad-request HTTP/1.0
2023-02-02T15:37:43.843+08:00  WARN 7 --- [or-http-epoll-3] r.n.http.server.HttpServerOperations     : [5c4dec22, L:/172.17.151.253:8090 - R:/193.106.29.74:64246] Decoding failed: FULL_REQUEST(decodeResult: failure(java.lang.IllegalArgumentException: text is empty (possibly HTTP/0.9)), version: HTTP/1.0, content: UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeHeapByteBuf(ridx: 0, widx: 0, cap: 0))
GET /bad-request HTTP/1.0

附加信息

No response

guqing commented 1 year ago

你的服务器之间是否加了什么代理层或者使用过代理服务器,先通过 ip 访问试一下或者直接到服务器通过 curl GET请求访问测试一下,请求不支持 CONNECT 方式

guqing commented 1 year ago

通过你的日志来看 500 Server Error for HTTP CONNECT "" 表明请求到 Halo 的 request method 是 CONNECT,如果查询文章出错失败日志应该是 500 Server Error for HTTP GET "/" 所以应该是使用了不支持的请求方式 CONNECT 导致

shiker1996 commented 1 year ago

你的服务器之间是否加了什么代理层或者使用过代理服务器,先通过 ip 访问试一下或者直接到服务器通过 curl GET请求访问测试一下,请求不支持 CONNECT 方式

通过ip访问可以,但是反向代理和之前配置一样的呢?

guqing commented 1 year ago

你的服务器之间是否加了什么代理层或者使用过代理服务器,先通过 ip 访问试一下或者直接到服务器通过 curl GET请求访问测试一下,请求不支持 CONNECT 方式

通过ip访问可以,但是反向代理和之前配置一样的呢?

用的什么反向代理呢 配置可以贴出来看看,或者是不是因为你之前用了什么cdn加速但现在没用了(或者恰恰相反)导致配置不兼容之类的

guqing commented 1 year ago

如果 ip 地址访问是正常的则并非是 halo 的问题,我将其标记为 support

guqing commented 1 year ago

/kind support

ruibaby commented 1 year ago

/close

f2c-ci-robot[bot] commented 1 year ago

@ruibaby: Closing this issue.

In response to [this](https://github.com/halo-dev/halo/issues/3214#issuecomment-1433286871): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.