Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

附件上传异常错误提示不明确 #2931

Closed
ruibaby opened this issue Dec 13, 2022 · 11 comments
Closed

附件上传异常错误提示不明确 #2931

ruibaby opened this issue Dec 13, 2022 · 11 comments
Assignees
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/improvement Categorizes issue or PR as related to a improvement.
Milestone

Comments

@ruibaby
Copy link
Member

ruibaby commented Dec 13, 2022

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

2.0.1

使用的什么数据库?

PostgreSQL

使用的哪种方式部署?

Docker Compose

在线站点地址

https://demo.halo.run

发生了什么?

如图,上传失败只能得到失败的提示,没有具体原因(这里是因为文件重名):

image

异常返回体:

{
  "type": "about:blank",
  "title": "Internal Server Error",
  "status": 500,
  "detail": "/Users/ryanwang/halo2-dev/attachments/upload/application.properties"
}

/area core
/area console
/kind improvement
/milestone 2.1.x

相关日志输出

No response

附加信息

No response

@f2c-ci-robot f2c-ci-robot bot added this to the 2.1.x milestone Dec 13, 2022
@f2c-ci-robot f2c-ci-robot bot added area/core Issues or PRs related to the Halo Core area/console Issues or PRs related to the Halo Console kind/improvement Categorizes issue or PR as related to a improvement. labels Dec 13, 2022
@JohnNiang
Copy link
Member

/assign

@JohnNiang
Copy link
Member

/unassign
/assign @ruibaby

@f2c-ci-robot f2c-ci-robot bot assigned ruibaby and unassigned JohnNiang Dec 14, 2022
f2c-ci-robot bot pushed a commit to halo-dev/console that referenced this issue Dec 14, 2022
…769)

#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

优化上传组件的异常提示信息。

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#2933
Ref halo-dev/halo#2932 halo-dev/halo#2931

#### Screenshots:

<img width="794" alt="image" src="https://user-images.githubusercontent.com/21301288/207272593-b94efb0a-7033-4ec1-b1eb-f2e3871b34f0.png">
<img width="674" alt="image" src="https://user-images.githubusercontent.com/21301288/207272682-0c223d29-8c4f-45b0-a8d5-2432a97835c6.png">


#### Special notes for your reviewer:

测试方式:

1. 进入附件上传、插件安装、主题安装界面。
2. 上传不符合规则的文件,比如主题可以上传一个不是主题的 zip 或者 Halo 1.x 版本的 zip。
3. 观察是否有异常提示。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 端上传组件的异常提示信息。
```
@ruibaby
Copy link
Member Author

ruibaby commented Dec 14, 2022

/unassign /assign @ruibaby

这个问题可能需要后端捕获一下异常哦,现在这个异常不是很明确。

@JohnNiang
Copy link
Member

是的,后端确实需要处理一下常见的错误。

@ZhuccIvan
Copy link

ZhuccIvan commented Dec 17, 2022

2022-12-17T08:53:12.929+08:00  INFO 7 --- [undedElastic-38] r.halo.alioss.AliOssAttachmentHandler    : Uploading 102904236_p0.jpg into AliOSS oss-cn-hangzhou.aliyuncs.com/halo-ivan/attachments/upload/102904236_p0.jpg
2022-12-17T08:53:43.466+08:00  WARN 7 --- [undedElastic-38] com.aliyun.oss                           : [Client]Unable to execute HTTP request: null
[ErrorCode]: Unknown
[RequestId]: Unknown
2022-12-17T08:53:43.466+08:00 ERROR 7 --- [undedElastic-38] r.halo.alioss.AliOssAttachmentHandler    : Caught an ClientException, which means the client encountered a serious internal
problem while trying to communicate with OSS, such as not being able to access
the network.

2022-12-17T08:53:44.466+08:00 ERROR 7 --- [undedElastic-36] reactor.core.publisher.Operators         : Operator called default onErrorDropped

reactor.core.Exceptions$ErrorCallbackNotImplemented: java.io.IOException: Pipe closed
Caused by: java.io.IOException: Pipe closed
	at java.base/java.io.PipedInputStream.checkStateForReceive(Unknown Source) ~[na:na]
	at java.base/java.io.PipedInputStream.receive(Unknown Source) ~[na:na]
	at java.base/java.io.PipedOutputStream.write(Unknown Source) ~[na:na]
	at java.base/java.nio.channels.Channels$WritableByteChannelImpl.write(Unknown Source) ~[na:na]
	at org.springframework.core.io.buffer.DataBufferUtils$WritableByteChannelSubscriber.hookOnNext(DataBufferUtils.java:1053) ~[spring-core-6.0.2.jar:6.0.2]
	at org.springframework.core.io.buffer.DataBufferUtils$WritableByteChannelSubscriber.hookOnNext(DataBufferUtils.java:1032) ~[spring-core-6.0.2.jar:6.0.2]
	at reactor.core.publisher.BaseSubscriber.onNext(BaseSubscriber.java:160) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.onNext(FluxSubscribeOn.java:151) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxUsing$UsingFuseableSubscriber.onNext(FluxUsing.java:353) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxGenerate$GenerateSubscription.next(FluxGenerate.java:178) ~[reactor-core-3.5.0.jar:3.5.0]
	at org.springframework.core.io.buffer.DataBufferUtils$ReadableByteChannelGenerator.accept(DataBufferUtils.java:916) ~[spring-core-6.0.2.jar:6.0.2]
	at org.springframework.core.io.buffer.DataBufferUtils$ReadableByteChannelGenerator.accept(DataBufferUtils.java:891) ~[spring-core-6.0.2.jar:6.0.2]
	at reactor.core.publisher.FluxGenerate.lambda$new$1(FluxGenerate.java:58) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxGenerate$GenerateSubscription.slowPath(FluxGenerate.java:271) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxGenerate$GenerateSubscription.request(FluxGenerate.java:213) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxUsing$UsingFuseableSubscriber.request(FluxUsing.java:320) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.requestUpstream(FluxSubscribeOn.java:131) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.onSubscribe(FluxSubscribeOn.java:124) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxUsing$UsingFuseableSubscriber.onSubscribe(FluxUsing.java:347) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxGenerate.subscribe(FluxGenerate.java:85) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxUsing.subscribe(FluxUsing.java:102) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.run(FluxSubscribeOn.java:194) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) ~[reactor-core-3.5.0.jar:3.5.0]
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) ~[reactor-core-3.5.0.jar:3.5.0]
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
	at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

我也出现了这个问题,上面是log,小文件能正常上传成功,8m就上传不了了,nginx我也设置了1024m

@ruibaby
Copy link
Member Author

ruibaby commented Dec 20, 2022

/unassign
/assign @JohnNiang

@f2c-ci-robot f2c-ci-robot bot assigned JohnNiang and unassigned ruibaby Dec 20, 2022
@JohnNiang
Copy link
Member

Hi @ZhuccIvan ,我在本地测试了一下 300+MB 的文件通过本地策略上传,能够成功。

image

从提供的日志中看,可能是服务器和阿里云之间网络的问题。

Caught an ClientException, which means the client encountered a serious internal
problem while trying to communicate with OSS, such as not being able to access
the network.

@ZhuccIvan
Copy link

Hi @JohnNiang ,
是的,本地策略是没什么问题的,但是OSS怎么都不行,有时候上传成功但是显示还是失败附件也无法使用,更多时候是没上传成功。
我的服务器就是阿里云的,不应该会有网络的问题吧, 而且小文件是可以成功的

@ruibaby
Copy link
Member Author

ruibaby commented Dec 26, 2022

/close

see #3042

@f2c-ci-robot f2c-ci-robot bot closed this as completed Dec 26, 2022
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Dec 26, 2022

@ruibaby: Closing this issue.

In response to this:

/close

see #3042

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ruibaby
Copy link
Member Author

ruibaby commented Dec 26, 2022

@ZhuccIvan 如果是仅在阿里云 OSS 有问题,建议向 https://github.com/halo-sigs/plugin-alioss 提交 issue。

这个 issue 已经完成使命。

@ruibaby ruibaby modified the milestones: 2.1.x, 2.1.0 Dec 26, 2022
JohnNiang pushed a commit to JohnNiang/halo that referenced this issue Mar 2, 2023
…alo-dev/console#769)

#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

优化上传组件的异常提示信息。

#### Which issue(s) this PR fixes:

Fixes halo-dev#2933
Ref halo-dev#2932 halo-dev#2931

#### Screenshots:

<img width="794" alt="image" src="https://user-images.githubusercontent.com/21301288/207272593-b94efb0a-7033-4ec1-b1eb-f2e3871b34f0.png">
<img width="674" alt="image" src="https://user-images.githubusercontent.com/21301288/207272682-0c223d29-8c4f-45b0-a8d5-2432a97835c6.png">


#### Special notes for your reviewer:

测试方式:

1. 进入附件上传、插件安装、主题安装界面。
2. 上传不符合规则的文件,比如主题可以上传一个不是主题的 zip 或者 Halo 1.x 版本的 zip。
3. 观察是否有异常提示。

#### Does this PR introduce a user-facing change?

```release-note
优化 Console 端上传组件的异常提示信息。
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/improvement Categorizes issue or PR as related to a improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants