【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

相关文章
|
安全 网络安全 数据安全/隐私保护
Windows Server 2025 Active Directory 重置用户密码
密码重置是管理员日常任务之一,用户因忘记或多次输错密码导致账户锁定时需进行重置。本文介绍在Active Directory服务器上重置密码的三种方法。
1381 3
|
安全 Windows
【Azure Cloud Service】在Windows系统中抓取网络包 ( 不需要另外安全抓包工具)
通常,在生产环境中,为了保证系统环境的安全和纯粹,是不建议安装其它软件或排查工具(如果可以安装,也是需要走审批流程)。 本文将介绍一种,不用安装Wireshark / tcpdump 等工具,使用Windows系统自带的 netsh trace 命令来获取网络包的步骤
386 32
|
C# Windows
【Azure App Service】在App Service for Windows上验证能占用的内存最大值
根据以上测验,当使用App Service内存没有达到预期的值,且应用异常日志出现OutOfMemory时,就需要检查Platform的设置是否位64bit。
306 11
|
存储 Shell 开发工具
8-8|windows上Git报错
8-8|windows上Git报错
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub的解决之法
An exception occurred while retrieving properties for Event Hub: logicapp. Error Message: 'ClientSecretCredential authentication failed: AADSTS90002: Tenant 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Che
213 3
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub
【Azure Logic App】使用Event Hub 连接器配置 Active Directory OAuth 认证无法成功连接到中国区Event Hub
181 2
|
Java 应用服务中间件 开发工具
[App Service for Windows]通过 KUDU 查看 Tomcat 配置信息
[App Service for Windows]通过 KUDU 查看 Tomcat 配置信息
231 2
|
Java 应用服务中间件 Windows
【App Service for Windows】为 App Service 配置自定义 Tomcat 环境
【App Service for Windows】为 App Service 配置自定义 Tomcat 环境
188 2
|
网络安全 API 数据安全/隐私保护
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
226 0
|
6月前
|
安全 数据安全/隐私保护 虚拟化
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
1586 2
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)

热门文章

最新文章