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

fix(protal-web): sshConnect会因为sftp消息过长报500错误 #957

Merged
merged 13 commits into from
Nov 9, 2023

Conversation

OYX-1
Copy link
Contributor

@OYX-1 OYX-1 commented Nov 7, 2023

前提:在.bashrc文件中输入较长的欢迎语

image

之前:文件管理和交互式应用(只要涉及ssh连接的地方都有这个问题)因为使用sftp获取家目录,如果欢迎语过多,会导致sftp消息过长报500错误。

image

现在:捕获了这个错误,并提示用户缩减欢迎语。

image

Copy link

changeset-bot bot commented Nov 7, 2023

🦋 Changeset detected

Latest commit: baaf068

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@scow/portal-web Patch
@scow/lib-ssh Patch
@scow/auth Patch
@scow/mis-server Patch
@scow/portal-server Patch
@scow/gateway Patch
@scow/mis-web Patch
@scow/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@OYX-1 OYX-1 requested a review from ddadaal November 7, 2023 08:55
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (e1e3230) 68.89% compared to head (baaf068) 68.81%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #957      +/-   ##
==========================================
- Coverage   68.89%   68.81%   -0.08%     
==========================================
  Files         132      132              
  Lines        3926     3932       +6     
  Branches      523      525       +2     
==========================================
+ Hits         2705     2706       +1     
- Misses       1123     1128       +5     
  Partials       98       98              
Files Coverage Δ
apps/portal-server/src/utils/ssh.ts 35.71% <0.00%> (-0.65%) ⬇️
libs/ssh/src/ssh.ts 61.97% <33.33%> (-3.18%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -113,6 +113,15 @@ export const FileManager: React.FC<Props> = ({ cluster, path, urlPrefix }) => {
const reload = async (signal?: AbortSignal) => {
setLoading(true);
await api.listFile({ query: { cluster: cluster.id, path } }, signal)
.httpError(409, (e) => {
// 如果终端登录欢迎语过长会报错:Packet length xxxx exceeds max length of 262144
if (e.message.endsWith("exceeds max length of 262144")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果有的错误信息不是262144呢?判断标准可以改成exceeds max length这种更通用一点的。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发现不仅仅是获取用户家目录时会报这个错,只要涉及sshConnect都会有这个问题,重新处理了一下

@@ -1,8 +1,8 @@
# 管理系统数据库的信息。可以不修改
db:
host: 192.168.88.100
host: 172.16.20.124
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是测试用的内部地址吗?vagrant用的应该是88.100吧,不要测试用的别改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

检查代码删除console时,不小心 git add . 了

@OYX-1 OYX-1 requested a review from ddadaal November 9, 2023 01:49
@ddadaal ddadaal merged commit a79aa10 into master Nov 9, 2023
9 checks passed
@ddadaal ddadaal deleted the fix-terminal-message-too-long branch November 9, 2023 13:44
@OYX-1 OYX-1 changed the title fix(protal-web): 文件管理会因为sftp消息过长报500错误 fix(protal-web): sshConnect会因为sftp消息过长报500错误 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants