【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.

简介: 【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.

问题描述

PHP的Web Job,通过artisan来配置路径启动PHP任务,相关启动脚本如下:

artisan_path = "d:\\home\\site\\wwwroot";
cd ${artisan_path}
echo "\n"
pwd
php artisan schedule:run

但是,在运行的时候遇见报错:

[07/06/2023 01:57:31 > 0f21a2: INFO] /d/home/site/wwwroot
[07/06/2023 01:57:32 > 0f21a2: ERR ] '\\10.0.176.8\volume-30-default\532b2b267e7c072\a7d3f0082847394a45e5733bdeceafa2488ae\site\wwwroot'
[07/06/2023 01:57:32 > 0f21a2: ERR ] CMD.EXE was started with the above path as the current directory.
[07/06/2023 01:57:32 > 0f21a2: ERR ] UNC paths are not supported.  Defaulting to Windows directory.
[07/06/2023 01:57:33 > 0f21a2: INFO] No scheduled commands are ready to run.

 

问题解答

报错为UNC Paths不支持,所以最开始的解决办法就是把 artisan 的路径配置写为默认的 “ d:\home\site\wwwroot\artisa ” 全路径作为临时方案来解决问题。

 

另一种不用修改 artisan 配置代码的方案是为 App Service增加一个  MSYS 配置,设置值为: nonativeinnerlinks。

 

参考资料

PHP artisan: Artisan是Laravel中自带的命令行工具的名称。它提供了一些开发过程中有用的命令用。它是基于强大的Symfony Console 组件开发的。https://docs.golaravel.com/docs/4.0/artisan

UNC paths:Universal Naming Convention。格式:\servername\sharename,其中servername是服务器名。sharename是共享资源的名称。 https://learn.microsoft.com/en-us/answers/questions/1167298/kudu-deployment-script-throws-unc-path-error?page=1

MSYS : Minimal GNU(POSIX)system on Windows,是一个小型的GNU环境,包括基本的bash,make等等。是Windows下最优秀的GNU环境 https://github.com/msys2/msys2.github.io/issues/152

相关文章
|
5月前
|
开发框架 监控 安全
Windows Defender 导致 Web IIS 服务异常停止排查
某日凌晨IIS服务异常停止,经查为Windows Defender安全补丁KB2267602触发引擎更新,导致系统资源波动,进而引发应用池回收。确认非人为操作,系统无重启。通过分析日志与监控,定位原因为Defender更新后扫描加重负载。解决方案:将IIS及.NET相关路径添加至Defender排除列表,避免业务影响。
646 116
|
5月前
|
Java 测试技术 网络安全
Burp Suite Professional 2025.10 for Windows x64 - 领先的 Web 渗透测试软件
Burp Suite Professional 2025.10 for Windows x64 - 领先的 Web 渗透测试软件
250 0
Burp Suite Professional 2025.10 for Windows x64 - 领先的 Web 渗透测试软件
|
8月前
|
安全 Linux iOS开发
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
676 0
Burp Suite Professional 2025.7 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
10月前
|
人工智能 安全 网络安全
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
497 4
Burp Suite Professional 2025.5 for Windows x64 - 领先的 Web 渗透测试软件
|
10月前
|
安全 Devops 测试技术
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
204 0
AppSpider 7.5.018 for Windows - Web 应用程序安全测试
|
人工智能 Linux iOS开发
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
668 12
Burp Suite Professional 2025.2 (macOS, Linux, Windows) - Web 应用安全、测试和扫描
|
安全 JavaScript Java
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
219 12
AppSpider Pro 7.5.015 for Windows - Web 应用程序安全测试
|
自然语言处理 安全 测试技术
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
791 0
HCL AppScan Standard 10.8.0 (Windows) - Web 应用程序安全测试
|
C# Windows
【Azure App Service】在App Service for Windows上验证能占用的内存最大值
根据以上测验,当使用App Service内存没有达到预期的值,且应用异常日志出现OutOfMemory时,就需要检查Platform的设置是否位64bit。
286 11
【Azure App Service】PowerShell脚本批量添加IP地址到Web App允许访问IP列表中
Web App取消公网访问后,只允许特定IP能访问Web App。需要写一下段PowerShell脚本,批量添加IP到Web App的允许访问IP列表里!
264 2