pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

遠程服務器返回錯誤:227 Entering Passive Mode (500 oo

The remote server returned an error: 227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)(遠程服務器返回錯誤:227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)) - IT屋-程序員軟件開發技術分享社
本文介紹了遠程服務器返回錯誤:227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我在將 Windows 服務連接到 FTP 站點時遇到問題.

I am having a problem connecting a Windows service to an FTP site.

我從另一個開發人員那里繼承了一項 Windows 服務.該服務連接到第 3 方服務器,下載 csv 文件,然后對其進行處理.由于某種原因,該服務停止工作(一年多以前,在我獲得項目之前).

I inherited a Windows service from another developer. The service connects to a 3rd party server, downloads a csv file and then processes it. For some reason, the service stopped working (well over a year ago, before I was given the project).

所以我回到了基礎,創建了一個控制臺應用程序,并僅在該應用程序中嘗試了連接/文件下載功能.我嘗試了許多不同的方法來連接到 FTP,但它們都向我的應用程序返回相同的錯誤:

So I went back to basics, created a console app and tried the connection/ file download function only in that app. I have tried many different methods to connect to the FTP, but all of them return the same error to my application:

遠程服務器返回錯誤:227 Entering Passive Mode ()

The remote server returned an error: 227 Entering Passive Mode ()

這是我嘗試過的眾多方法之一:

This is one of the many methods I've tried:

FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://ftpaddress/filename.csv");
        request.Method = WebRequestMethods.Ftp.DownloadFile;

        request.Credentials = new NetworkCredential("username", "password");

        request.UsePassive = true;

        FtpWebResponse response = (FtpWebResponse)request.GetResponse();

        Stream responseStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(responseStream);
        Console.WriteLine(reader.ReadToEnd());

        Console.WriteLine("Download Complete, status {0}", response.StatusDescription);

        reader.Close();
        response.Close(); 

但它落在這部分:

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

我在幾個論壇中看到將 UsePassive 屬性設置為 False 可以修復這些錯誤,但發生在我身上的只是我得到了一個語法錯誤,如下所示:

I read in several forums that setting the UsePassive property to False fixes these errors, but all that happened to me was that I got a syntax error instead, as below:

遠程服務器返回錯誤:(500) 語法錯誤,命令無法識別.

The remote server returned an error: (500) Syntax error, command unrecognized.

該文件托管在我無法控制的第 3 方 FTP 服務器上.我可以將 URL 粘貼到瀏覽器中,系統會提示我輸入用戶名和密碼,然后我就可以通過并下載文件.

The file is hosted on a 3rd party FTP server I have no control over. I can paste the URL into a browser, and I am prompted for a username and password, which then allows me through and I can download the file.

為了消除我們的防火墻作為問題的原因,我在內部網絡和 WiFi(不在防火墻后面)上運行了該應用程序,這沒有任何區別.我還在默認、主動和被動模式下通過 FileZilla 進行連接,并且每次都能正常工作.所以沒有問題.

To eliminate our firewall as the cause of the problem, I ran the app on both the internal network and the WiFi (which isn't behind the firewall), and it makes no difference. I also connected through FileZilla in Default, Active and Passive modes, and it worked every time. So no problem there.

然后我運行了 Wireshark.這是在被動模式下使用 Filezilla(即成功的)捕獲線路的圖像:

So then I ran Wireshark. Here is an image of the wire capture using Filezilla (i.e. a successful one), in Passive mode:

這是使用應用程序連接(和失敗)時的捕獲,被動設置為 true:

And here is the capture when connecting (and failing) using the app, with passive set to true:

所以正如您在上面的失敗連接中看到的那樣,我可以很好地登錄服務器.然后無論出于何種原因發送了一個額外的請求,即TYPE I",它提示切換到二進制模式"的響應.在下面,我得到以下內容:

So as you can see in the failed connection above, I can log in to the server just fine. Then for whatever reason an extra request is sent, namely "TYPE I", which prompts the response of "Switching to binary mode." The below that, I get the following:

500 oops:vsf_sysutil_recv_peek:無數據

500 oops: vsf_sysutil_recv_peek: no data

另外我也把Passive屬性設置為false后又跑了一次,這就是我當時得到的:

In addition, I also ran it again after setting the Passive property to false, and this is what I got that time:

所以我的問題是雙重的;

So my question is twofold;

1,如果我以某種方式解決了 UsePassive 問題并將該屬性設置為 false,那會解決我的問題嗎?

1, if I somehow get past the UsePassive issue and set that property to false, will that solve my problem?

2,忽略 UsePassive 屬性,為什么我不能從應用程序下載文件,但可以從其他地方下載文件?

2, ignoring the UsePassive property, why can't I download the file from the app, but can from everywhere else?

推薦答案

問題現已解決.原來是卡巴斯基的內置防火墻阻止了連接.很煩人,當我嘗試連接時它沒有向我顯示警告,但知道我的電腦是安全的.

The issue is now resolved. It turned out to be Kaspersky's built-in firewall that was blocking the connection. It's annoying that it didn't present me with a warning when I tried to connect, but reassuring to know my PC is safe.

線索在 227 返回的細節中:

The clue was in the detail of the 227 return:

10051 – 嘗試對無法訪問的網絡進行套接字操作

10051 – A socket operation was attempted to an unreachable network

此外,對于通過 Google 等訪問此內容的任何人,遠程服務器被配置為僅允許被動連接,這就是我收到 500 語法錯誤的原因.研究下載文件時的 Wire 捕獲發現,如果選擇 Active 但失敗,Filezilla 實際上會自動恢復到 Passive 模式.

Also, for anyone reaching this via Google etc, the remote server was configured to only allow Passive connections, which is why I was getting the 500 syntax error. Studying a Wire capture when downloading a file revealed that Filezilla actually reverts to Passive mode automatically if Active is selected but fails.

我原來帖子中的代碼現在可以正常工作了.

The code in my original post works fine now.

這篇關于遠程服務器返回錯誤:227 Entering Passive Mode (500 oops vs_utility_recv_peek: no data)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進行身份驗證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權不起作用)
ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登錄使用角色)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護進程或服務器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發技
.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問令牌以與 Microsoft Graph 一起使用)
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
主站蜘蛛池模板: 煤矿支护网片_矿用勾花菱形网_缝管式_管缝式锚杆-邯郸市永年区志涛工矿配件有限公司 | 丁基胶边来料加工,医用活塞边角料加工,异戊二烯橡胶边来料加工-河北盛唐橡胶制品有限公司 | 贴板式电磁阀-不锈钢-气动上展式放料阀-上海弗雷西阀门有限公司 工业机械三维动画制作 环保设备原理三维演示动画 自动化装配产线三维动画制作公司-南京燃动数字 | 沈阳庭院景观设计_私家花园_别墅庭院设计_阳台楼顶花园设计施工公司-【沈阳现代时园艺景观工程有限公司】 | 合金耐磨锤头_破碎机锤头_郑州市德勤建材有限公司 | 软文推广发布平台_新闻稿件自助发布_媒体邀约-澜媒宝 | ph计,实验室ph计,台式ph计,实验室酸度计,台式酸度计 | 废气处理设备-工业除尘器-RTO-RCO-蓄热式焚烧炉厂家-江苏天达环保设备有限公司 | 选宝石船-陆地水上开采「精选」色选机械设备-青州冠诚重工机械有限公司 | 振动时效_振动时效仪_超声波冲击设备-济南驰奥机电设备有限公司 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 海水晶,海水素,海水晶价格-潍坊滨海经济开发区强隆海水晶厂 | 压力控制器,差压控制器,温度控制器,防爆压力控制器,防爆温度控制器,防爆差压控制器-常州天利智能控制股份有限公司 | 空压机商城|空气压缩机|空压机配件-压缩机网旗下商城 | 广州工业氧气-工业氩气-工业氮气-二氧化碳-广州市番禺区得力气体经营部 | 碳化硅,氮化硅,冰晶石,绢云母,氟化铝,白刚玉,棕刚玉,石墨,铝粉,铁粉,金属硅粉,金属铝粉,氧化铝粉,硅微粉,蓝晶石,红柱石,莫来石,粉煤灰,三聚磷酸钠,六偏磷酸钠,硫酸镁-皓泉新材料 | 活性氧化铝球|氧化铝干燥剂|分子筛干燥剂|氢氧化铝粉-淄博同心材料有限公司 | 海日牌清洗剂-打造带电清洗剂、工业清洗剂等清洗剂国内一线品牌 海外整合营销-独立站营销-社交媒体运营_广州甲壳虫跨境网络服务 | 产业规划_产业园区规划-产业投资选址及规划招商托管一体化服务商-中机院产业园区规划网 | 亮化工程,亮化设计,城市亮化工程,亮化资质合作,长沙亮化照明,杰奥思【官网】 | 江苏全风,高压风机,全风环保风机,全风环形高压风机,防爆高压风机厂家-江苏全风环保科技有限公司(官网) | 超高频感应加热设备_高频感应电源厂家_CCD视觉检测设备_振动盘视觉检测设备_深圳雨滴科技-深圳市雨滴科技有限公司 | 玻璃钢格栅盖板|玻璃钢盖板|玻璃钢格栅板|树篦子-长沙川皖玻璃钢制品有限公司 | 浩方智通 - 防关联浏览器 - 跨境电商浏览器 - 云雀浏览器 | 体视显微镜_荧光生物显微镜_显微镜报价-微仪光电生命科学显微镜有限公司 | 消防泵-XBD单级卧式/立式消防泵-上海塑泉泵阀(集团)有限公司 | 全国冰箱|空调|洗衣机|热水器|燃气灶维修服务平台-百修家电 | 陶瓷加热器,履带式加热器-吴江市兴达电热设备厂 | 耐火浇注料-喷涂料-浇注料生产厂家_郑州市元领耐火材料有限公司 耐力板-PC阳光板-PC板-PC耐力板 - 嘉兴赢创实业有限公司 | 深圳VI设计-画册设计-LOGO设计-包装设计-品牌策划公司-[智睿画册设计公司] | 重庆监控_电子围栏设备安装公司_门禁停车场管理系统-劲浪科技公司 | 齿轮减速电机一体机_蜗轮蜗杆减速马达-德国BOSERL齿轮减速机带电机生产厂家 | 木材烘干机,木炭烘干机,纸管/佛香烘干设备-河南蓝天机械制造有限公司 | PSI渗透压仪,TPS酸度计,美国CHAI PCR仪,渗透压仪厂家_价格,微生物快速检测仪-华泰和合(北京)商贸有限公司 | 海外仓系统|国际货代系统|退货换标系统|WMS仓储系统|海豚云 | 护栏打桩机-打桩机厂家-恒新重工| 钢衬四氟管道_钢衬四氟直管_聚四氟乙烯衬里管件_聚四氟乙烯衬里管道-沧州汇霖管道科技有限公司 | 上海小程序开发-上海小程序制作公司-上海网站建设-公众号开发运营-软件外包公司-咏熠科技 | 环境模拟实验室_液体-气体控温机_气体控温箱_无锡双润冷却科技有限公司 | 广州展览设计公司_展台设计搭建_展位设计装修公司-众派展览装饰 广州展览制作工厂—[优简]直营展台制作工厂_展会搭建资质齐全 | 意大利Frascold/富士豪压缩机_富士豪半封闭压缩机_富士豪活塞压缩机_富士豪螺杆压缩机 | 冷凝锅炉_燃气锅炉_工业燃气锅炉改造厂家-北京科诺锅炉 |