Martin
Martin

Reputation: 2785

Azure WebJob returns "The system cannot find the file specified"

Im trying to run a PHP script on Azure WebJobs. This worked perfectly earlier until recently when I was re-deploying an application. Now any PHP script I try to upload refuses to load giving me the following error errors on the logfile:

[05/01/2015 13:21:25 > 611c38: SYS INFO] Status changed to Initializing
[05/01/2015 13:21:25 > 611c38: SYS INFO] Run script 'test.php' with script host - 'PhpScriptHost'
[05/01/2015 13:21:25 > 611c38: SYS INFO] Status changed to Running
[05/01/2015 13:21:25 > 611c38: ERR ] The system cannot find the file specified
[05/01/2015 13:21:25 > 611c38: SYS INFO] Status changed to Failed
[05/01/2015 13:21:25 > 611c38: SYS ERR ] System.AggregateException: One or more errors occurred. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Kudu.Core.Infrastructure.ProcessWrapper.Start()
   at Kudu.Core.Infrastructure.ProcessExtensions.<Start>d__a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Kudu.Core.Infrastructure.Executable.<ExecuteAsync>d__1d.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func`2 onWriteOutput, Func`2 onWriteError, Encoding encoding, String arguments, Object[] args)
   at Kudu.Core.Infrastructure.Executable.ExecuteReturnExitCode(ITracer tracer, Action`1 onWriteOutput, Action`1 onWriteError, String arguments, Object[] args)
   at Kudu.Core.Jobs.BaseJobRunner.RunJobInstance(JobBase job, IJobLogger logger, String runId)
---> (Inner Exception #0) System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Kudu.Core.Infrastructure.ProcessWrapper.Start()
   at Kudu.Core.Infrastructure.ProcessExtensions.<Start>d__a.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Kudu.Core.Infrastructure.Executable.<ExecuteAsync>d__1d.MoveNext()<---

The problem persists on any web app I have deployed on Azure.

Upvotes: 1

Views: 706

Answers (2)

Martin
Martin

Reputation: 2785

The issue was that the php support was disabled on the dashboard. Azure was able to find my php script and it had rights to read it. When it tried to execute the script, it wouldn't be able to find the runtime as it was disabled through the dashboard. Could have saved me for a few hours of work if it could say that php was disabled instead of saying that it can't find some file.

Always make sure that the script runtime for the script you are executing is enabled on the portal.

Upvotes: 2

Jonny C
Jonny C

Reputation: 1941

check php runtime is installed ;)

Upvotes: 3

Related Questions