简体   繁体   English

无法通过FTP进入Azure Web应用

[英]Unable to FTP into Azure web app

This problem first came about when I learned that a client of ours was running into permission errors on their site. 当我得知我们的一个客户端在其网站上遇到权限错误时,首先出现了此问题。

[IOException: The media is write protected.]

System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +11804343
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1326
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +60
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync) +54
System.Xml.XmlWriterSettings.CreateWriter(String outputFileName) +155
System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings) +23
System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options) +116
Umbraco.Core.Services.ApplicationTreeService.LoadXml(Action`1 callback, Boolean saveAfterCallback) +202
Umbraco.Core.Services.ApplicationTreeService.Intitialize(IEnumerable`1 existingTrees) +68
Umbraco.Web.Trees.ApplicationTreeRegistrar.ScanTrees(ApplicationContext applicationContext) +667
Umbraco.Web.Trees.ApplicationTreeRegistrar.ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +9
Umbraco.Core.ApplicationEventHandler.OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +37
Umbraco.Core.CoreBootManager.<Complete>b__5(IApplicationEventHandler x) +19
Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable`1 items, Action`1 action) +141
Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete) +94
Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) +38
Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +154
Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e) +9

[HttpException (0x80004005): The media is write protected.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9966013
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +352
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): The media is write protected.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9947380
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

So I tried to connect to the server with 所以我试图用连接到服务器

ftp://waws-prod-bay-###.ftp.azurewebsites.windows.net FTP://waws-prod-bay-###.ftp.azurewebsites.windows.net

to troubleshoot the issue. 解决问题。 Unfortunately, it errored out with the following message. 不幸的是,它错误并显示以下消息。

Can't connect to 'waws-prod-bay-###.ftp.azurewebsites.net' on port 21. Check the server name and proxy settings. 无法在端口21上连接到“ waws-prod-bay-###。ftp.azurewebsites.net”。检查服务器名称和代理设置。 If the settings are correct, the server may be temporarily unavailable. 如果设置正确,则服务器可能暂时不可用。

So I tried creating a second ftp user, since the current one wasn't shown in the FTP/DEPLOYMENT USER field underneath the app's properties. 因此,我尝试创建第二个ftp用户,因为当前的用户未显示在应用程序属性下方的“ FTP / DEPLOYMENT USER”字段中。 This failed too. 这也失败了。

Then I tried downloading the publish settings and used the credentials in there. 然后,我尝试下载发布设置并在其中使用了凭据。 No luck. 没运气。

Lastly, I tried creating a new a new app to see whether it was a problem for all apps on the account or just the one. 最后,我尝试创建一个新的新应用程序,以查看该帐户中的所有应用程序还是仅一个应用程序都存在问题。 While it took much longer than usual to initialize, I was able to ftp into it once it was done. 尽管初始化所需的时间比平时长得多,但是一旦完成,我就可以通过ftp进入。

Any ideas on what the problem is? 关于问题是什么的任何想法? I had found this , which lead to this which says the problem (or a similar one at least) was resolved about 8 months ago. 我找到了这个 ,这导致该说的问题(或至少相似的一个)8个月前得到解决。

Thanks for the help. 谢谢您的帮助。

Edit: 编辑:

I am able to ftp now, but I'm not going to flag this as resolved, since I don't know what fixed it. 我现在可以ftp,但是我不打算将其标记为已解决,因为我不知道该怎么解决。 If anyone encounters this issue, please try juvchan's suggestion in the comments. 如果有人遇到此问题,请在评论中尝试juvchan的建议。

I would recommend trying the following to gain access 我建议尝试以下方法以获得访问权限

  • The simplest thing to try would be to restart the app in the portal. 最简单的尝试是在门户中重新启动应用程序。 I've seen this same issue and restarting the app fixes it. 我已经看到了相同的问题,然后重新启动应用程序即可解决该问题。
  • If that does not work, try actually resetting the deployment credentials rather than adding a new user. 如果这不起作用,请尝试实际重置部署凭据,而不是添加新用户。

To reset your deployment credentials go to the web app blade, click on All Settings -> Deployment Credentials. 要重置您的部署凭据,请转到Web应用程序刀片,单击所有设置->部署凭据。 It will then let you reset the username AND password. 然后,它将使您重置用户名和密码。 Again; 再次; I have seen this as an issue too. 我也认为这是一个问题。

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM