Createprocessasuser Failed With Error 2
Contents |
from GoogleSign inHidden fieldsSearch for groups or messages
Campos MagencioMarch 9, 20122 0 0 0 Hi all, The other day I worked on a support case where a Windows service running as System in Session 0 was creating a processalso running as createprocess failed with error code 2 notepad++ java System in Session 0, and this new process failed to create another process
Createprocess Failed With Error Code 2 C++
in the logged-on user's session (Session 2 in this particular case). And it failed because CreateProcessAsUser API didn't work and
Createprocess Failed Code 2
returned error 5 (Access Denied). Note the issue happened on Windows 7, and because of Session 0 Isolation the logged-on user and the service (and its child process running as System) were running in https://groups.google.com/d/topic/microsoft.public.win32.programmer.kernel/H2nx_57Dp2A different sessions. To understand what was going on exactly, I did some kernel debugging of the issue and saw that the error in CreateProcessAsUser happened when trying to bind the process we were trying to spawn to its parent's Job (the Job that the process that the service spawned as System was a member of). Indeed, I could verify with Process Explorerthat the process running as https://blogs.msdn.microsoft.com/alejacma/2012/03/09/createprocessasuser-fails-with-error-5-access-denied-when-using-jobs/ System in Session 0 was member of a Job, by checking the properties of the process and going to the Job tab (note: when there is no Job, there is no Job tab). After a process is associated with a job, by default any child processes it creates are also associated with the job (see Job Objects for more details on this). But the following is also documented: AssignProcessToJobObject function"Terminal Services: All processes within a job must run within the same session as the job." Which means that, as the new process we are trying to create is in a different session than its parent, we will fail to bind it to its parent's Job. The only way to work around this, would be to create the process in the different session by passing this flag to the CreateProcessAsUser API: Process Creation Flags“CREATE_BREAKAWAY_FROM_JOB 0x01000000The child processes of a process associated with a job are not associated with the job. If the calling process is not associated with a job, this constant has no effect. If the calling process is associated with a job, the job must set the JOB_OBJECT_LIMIT_BREAKAWAY_OK limit. “ I hope this helps. Regards,
Support Search GitHub This repository Watch 50 Star 701 Fork 147 mikehaertl/phpwkhtmltopdf Code Issues 3 Pull requests 1 Projects 0 https://github.com/mikehaertl/phpwkhtmltopdf/issues/56 Pulse Graphs New issue Warning: proc_open(): CreateProcess failed, error code - 2 #56 Closed Bilna75 opened this Issue Jul 8, 2014 · 13 comments Projects None yet Labels windows-only https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology/topic/278023 Milestone No milestone Assignees No one assigned 3 participants Bilna75 commented Jul 8, 2014 Hi, I'm currently trying to use your wkhtmltopdf but I cannot get passed a Warning failed with call saying : Warning: proc_open() [function.proc-open]: CreateProcess failed, error code - 87 in Path/To/WkHtmlToPdf.php on line 325 I tried with a basic code given in the tutorial but it doesn't work. $pdf = new WkHtmlToPdf; $pdf->addPage('http://google.com'); $pdf->send(); The error code 87 stands for invalid parameter. Anyone can help me ? Thank you Owner mikehaertl commented Jul 8, 2014 Sorry, failed with error I don't use Windows, so I can't really help. Other Windows users seem to have no problem with the library. You will have to play around with proc_open() yourself to find out, what's wrong. I'd try to build a simple PHP script and use more and more complex shell commands with proc_open(). Hope this helps. mikehaertl added the windows-only label Jul 9, 2014 tivie commented Oct 24, 2014 There are a lot of issues with php proc_open on windows. See: https://bugs.php.net/bug.php?id=51800 https://bugs.php.net/bug.php?id=60120 https://bugs.php.net/bug.php?id=65650 One workaround is to run the command yourself using exec(). However, as far as I know, there's no way to get the command woithout actually running it. I've created a pull request that should address this issue. tivie referenced this issue Oct 24, 2014 Closed Added a new method to the Pdf Class (pdf::buildCommand) so that we can g... #74 Owner mikehaertl commented Oct 25, 2014 If we wanted to fix this, we should do so in the underlying https://github.com/mikehaertl/php-shellcommand. But I'm hesitant to do so. proc_open() gives you ful
LearningModern CodeNetworkingOpen SourceStorageToolsDeveloper TypeEmbedded SystemsGame DevMediaTechnical, Enterprise, HPCWebOSAll ToolsAndroid*HTML5Linux*OS X*Windows*ResourcesCode SamplesContact SupportDocumentationFree SoftwareIntel Registration CenterProduct ForumsSDKsResourcesPartner with IntelAcademic ProgramPartner SpotlightBlack Belt DeveloperDeveloper MeshInnovator ProgramSuccess StoriesLearnBlogBusiness TipsEventsVideosSupportContact SupportDeveloper EvangelistsFAQsForums Search form Search You are hereHome › Forums › IntelĀ® Software Development Products › IntelĀ® Clusters and HPC Technology FacebookLinkedInTwitterDiggDeliciousGoogle Plus Intel MPI and Active Directory Intel MPI and Active Directory Seifer Lin Tue, 05/29/2012 - 03:57 Hi:I tried to run HelloWorld by select "delegate" as authentication methods.I followed the "Intel@MPI Library for Windows OS Reference Manual" to setup Active Directory.(Enable the delegate for cluster nodes and users, Register Service Principal Name for cluster nodes)Details of the cluster is as below:headnode: Windows Server R2 2008 64bit (192.168.120.105)computenode1:Windows XP SP2 64bit (192.168.120.201)computenode2:Windows XP SP2 64bit (192.168.120.202)I done the following tests by using administrator account.test 1:hostnametest 2:HelloWorld_IntelMPI.exe (local path)test 3:HelloWorld_IntelMPI.exe (UNC path)________________________________________________________________________________test 1:mpiexec.exe -delegate -hosts 2 192.168.120.201 192.168.120.202 hostnamecomputenode1computenode2________________________________________________________________________________test 2:mpiexec.exe -delegate -hosts 2 192.168.120.201 192.168.120.202 C:\\\\test_delegate\\\\HelloWorld_IntelMPI.exeHello by 0 of 2 processer! My hostname: computenode1, MyPID=2668Hello by 1 of 2 processer! My hostname: computenode2, MyPID=2496________________________________________________________________________________test 3:mpiexec.exe -delegate -hosts 2 192.168.120.201 192.168.120.202 \\\\\\\\192.168.120.105\\\\test_delegate\\\\HelloWorld_IntelMPI.exelaunch failed: CreateProcess(\\\\\\\\192.168.120.105\\\\test_delegate\\\\HelloWorld_IntelMPI.exe) on 'computenode1.test.com' failed, error 5 - Access is denied.launch failed: CreateProcess(\\\\\\\\192.168.120.105\\\\test_delegate\\\\HelloWorld_IntelMPI.exe) on 'computenode2.test.com' failed, error 5 - Access is denied. It seems that the account for delegation is unable to use CreateProcess for an executable with UNC path ?regards,Seifer RSS Top 14 posts