【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

相关文章
|
3月前
|
开发工具 git C++
【App Service】VS Code直接部署App Service时候遇见 “fatal: not a git repository (or any of the parent directories): .git”
通过VS Code发布Python App Service的时候,遇见了发布失败错误: The deployment failed with error: fatal: not a git repository (or any of the parent directories): .git . Please take a few minutes to help us improve the deployment experience
91 24
|
3月前
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
809 7
|
2月前
|
C# Windows
【Azure App Service】在App Service for Windows上验证能占用的内存最大值
根据以上测验,当使用App Service内存没有达到预期的值,且应用异常日志出现OutOfMemory时,就需要检查Platform的设置是否位64bit。
48 11
|
2月前
|
JavaScript C++ 容器
【Azure Bot Service】部署NodeJS ChatBot代码到App Service中无法自动启动
2024-11-12T12:22:40.366223350Z Error: Cannot find module 'dotenv' 2024-11-12T12:40:12.538120729Z Error: Cannot find module 'restify' 2024-11-12T12:48:13.348529900Z Error: Cannot find module 'lodash'
47 11
|
2月前
|
开发框架 监控 .NET
【Azure App Service】部署在App Service上的.NET应用内存消耗不能超过2GB的情况分析
x64 dotnet runtime is not installed on the app service by default. Since we had the app service running in x64, it was proxying the request to a 32 bit dotnet process which was throwing an OutOfMemoryException with requests >100MB. It worked on the IaaS servers because we had the x64 runtime install
|
2月前
|
Java 开发工具 Windows
【Azure App Service】在App Service中调用Stroage SDK上传文件时遇见 System.OutOfMemoryException
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
|
2月前
|
安全 Apache 开发工具
【Azure App Service】在App Service上关于OpenSSH的CVE2024-6387漏洞解答
CVE2024-6387 是远程访问漏洞,攻击者通过不安全的OpenSSh版本可以进行远程代码执行。CVE-2024-6387漏洞攻击仅应用于OpenSSH服务器,而App Service Runtime中并未使用OpenSSH,不会被远程方式攻击,所以OpenSSH并不会对应用造成安全风险。同时,如果App Service的系统为Windows,不会受远程漏洞影响!
|
2月前
|
C#
【Azure App Service】使用Microsoft.Office.Interop.Word来操作Word文档,部署到App Service后报错COMException
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)).
|
2月前
【Azure App Service】PowerShell脚本批量添加IP地址到Web App允许访问IP列表中
Web App取消公网访问后,只允许特定IP能访问Web App。需要写一下段PowerShell脚本,批量添加IP到Web App的允许访问IP列表里!
|
3月前
|
机器人 Shell Linux
【Azure Bot Service】部署Python ChatBot代码到App Service中
本文介绍了使用Python编写的ChatBot在部署到Azure App Service时遇到的问题及解决方案。主要问题是应用启动失败,错误信息为“Failed to find attribute 'app' in 'app'”。解决步骤包括:1) 修改`app.py`文件,添加`init_func`函数;2) 配置`config.py`,添加与Azure Bot Service认证相关的配置项;3) 设置App Service的启动命令为`python3 -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func`。
下一篇
开通oss服务