projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 655 forks source link

Composer extension installation fails to install when using php 7.1 #2811

Closed MarkTierney1975 closed 5 months ago

MarkTierney1975 commented 6 years ago

For deployment issues, please provide us with the following information:

Repro steps.

If I build a web app that uses php7.1 the composer extension installs but the composer command is not recognised in the console.

If I build a web app that uses php7.2 the composer extension installs and works fine, If I then downgrade to php7.1 or php7.0 composer no longer works and a new installation fails.

Unfortunately php7.2 has a bug so I need to use 7.1 or 7.0.

Project structures.

I am using the laravel 5.5 framework. The wwwroot is changed to public, mongobd php extension is installed.

The log/error given by the failure.

Example error when composer installation fails:

Failed to install web app extension Composer. {"Message":"ExitCode: -1073741819, Output: D:\home\SiteExtensions\ComposerExtension># Install Composer \r\n\r\nD:\home\SiteExtensions\ComposerExtension>cd Commands \r\n\r\nD:\home\SiteExtensions\ComposerExtension\Commands>IF EXIST composer.phar (rm -f composer.phar ) \r\n\r\nD:\home\SiteExtensions\ComposerExtension\Commands>IF NOT EXIST \"D:\local\AppData\Composer\" (mkdir \"D:\local\AppData\Composer\" ) \r\n\r\nD:\home\SiteExtensions\ComposerExtension\Commands>IF NOT EXIST \"D:\local\LocalAppData\Composer\" (mkdir \"D:\local\LocalAppData\Composer\" ) \r\n\r\nD:\home\SiteExtensions\ComposerExtension\Commands>php -r \"readfile('https://getcomposer.org/installer');\" | php, Error: '#' is not recognized as an internal or external command,\r\noperable program or batch file., Kudu.Core.Infrastructure.CommandLineException: '#' is not recognized as an internal or external command,\r\noperable program or batch file.\r\nD:\home\SiteExtensions\ComposerExtension\install.cmd \r\n at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func2 onWriteOutput, Func2 onWriteError, Encoding encoding, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 235\r\n at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 137\r\n at Kudu.Core.SiteExtensions.SiteExtensionManager.<>cDisplayClass27_1.b1() in C:\Kudu Files\Private\src\master\Kudu.Core\SiteExtensions\SiteExtensionManager.cs:line 541\r\n at Kudu.Core.Infrastructure.OperationManager.<>cDisplayClass2_0.b0() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\OperationManager.cs:line 17\r\n at Kudu.Core.Infrastructure.OperationManager.Attempt[T](Func1 action, Int32 retries, Int32 delayBeforeRetry, Func2 shouldRetry) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\OperationManager.cs:line 42\r\n at Kudu.Core.Infrastructure.OperationManager.Attempt(Action action, Int32 retries, Int32 delayBeforeRetry) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\OperationManager.cs:line 19\r\n at Kudu.Core.SiteExtensions.SiteExtensionManager.d27.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\SiteExtensions\SiteExtensionManager.cs:line 550\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Kudu.Core.SiteExtensions.SiteExtensionManager.d26.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\SiteExtensions\SiteExtensionManager.cs:line 335"}

suwatch commented 6 years ago

Try go to Kudu Debug Console. cd D:\home\SiteExtensions\ComposerExtension and try to run install.cmd, is it successful? It might emit warning the # in not valid batch command but should proceed to install the extension..

jvano commented 5 months ago

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano Azure App Service