Solved

Terrible Apache trouble on startup, Invalid argument / handle is invalid

Posted on 2009-05-15
9
5,966 Views
Last Modified: 2012-05-07
(using: windows vista business ed, apache 2.2)

Before I restarted my system, I restarted Apache and all was fine. Then I restarted my system (don't ask! ;-) and I found myself confronted with the following errors:

[notice] Apache/2.2.11 (Win32) PHP/5.2.9-2 configured -- resuming normal operations
[notice] Server built: Dec 10 2008 00:10:06
[crit] (22)Invalid argument: Parent: Failed to create the child process.
[crit] (OS 6)The handle is invalid.  : master_main: create child process failed. Exiting.
[notice] Parent: Forcing termination of child process 36


setting the loglevel to debug did not give more information about this "invalid argument". The windows event viewer gave me:

[warn] (OS 2)The system cannot find the file specified.  : No installed ConfigArgs for the service "Apache2.2", using Apache defaults.     .

but that's what it always used to give. Just before the error above, it confirms loading of PHP. I tried removing all virtual hosts, removed PHP etc, but to no avail. I checked the startup arguments, (changed them to see behavior if things go wrong) but don't seem to manage.

Anybody aware of what's going on? How do I find out what Apache is complaining about?
0
Comment
Question by:abel
  • 5
  • 4
9 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 24401102
Anything in the security event logs?  Could be that something changed with security and Apache is no longer able to read/access some file or directory.
0
 
LVL 39

Author Comment

by:abel
ID: 24401769
Well, by now and still being 100% of my time busy with this subject (I did sleep though), I have tracked a fair lot more. I went back to a very early restorepoint to rule out any recent installations (I had OpenVPN installed, and removed, TeamViewer and a driver). I tried:

  • safe mode, to rule out any other conflicts: same result
  • rebuild from source to rule out tampering with the exe or a dll: same result
  • reinstall in many different ways: same result
  • monitored file access denies: none
  • removed any other network / security tools: same result
  • tried to debug with WinDbg, it broke early with a write memory access denied, this error did not occur without WinDbg
  • tried to debug wih Visual Studio, it ran, but same result
  • tried to debug a DEBUG version (build successful), it broke early on an assertion, don't know how to continue there as the assertion is on some char conv fuction
  • tried different locations on my machine, each time with a clean install: same result
  • removed the Apache SF branch in registry, to prevent it loading its defaults: same result
  • ran three different virus scanners, no viruses (apart from some stale cookies): same result
  • did zillion times a netstat -a etc, arp -a (clear arp cache) but did not find any conflicts and after which it always was: the same result
  • tried to deliberately make mistakes in httpd.conf, these were noted (i.e., port conflicts, wrong directives etc).
I can't, for the life of me, think of what else I can do. I really don't want to remove my WAMP-like installation and change it into an IIS + PHP/Perl/Ruby installation. Sounds like a nightmare (for me: Apache I use for scripting, IIS I use for .NET and other MS technologies)

The only thing I can think of now that would bring me closer perhaps is setting up a breakpoint near the place where it goes wrong. The point is, I do no know how to do so, because the default run/install of the Apache Visual Studio project is to install itself and not to run from the environment. I have yet to find the correct resource to tell me how to step through the source (and that's me, a seasoned developer, not knowing how to step through source, LOL!!!). Strange when you consider that I don't have problems with Chrome source or Firefox to do the same....

-- Abel --
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 500 total points
ID: 24402278
Are you actually installing WAMP, or are you installing the various components seperately?

It looks like a registry entry/setting is not getting properly set.  Open your registry and look for:

     HKLM/System/CurrentControlSet/Services/Apache2.2

Under parameters there should be a ConfigArgs that has something like:

-f
C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
-d
C:\Program Files\Apache Software Foundation\Apache2.2\.


Now, it will appear all on one line until you go to edit the values.  If you have a custom build of Apache, say to enable SSL for example, then there may be some other options.
0
 
LVL 39

Author Comment

by:abel
ID: 24402895
Yes, I know of these settings. I did not do a pre-configured WAMP from some online distribution. The settings that you mention are set correctly (they used to point somewhere else, I have my configs on a different drive, but while doing all these repairs, I decided to only use the defaults, like you note above).

7 hours further, and loads of tests (basically, I focused on possible malware) but nothing found that shows that my computer is somehow badly configured. Only the malfunctioning apache (both in a self-build and in a freshly downloaded config).
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 57

Accepted Solution

by:
giltjr earned 500 total points
ID: 24404477
Issue the command:

     sc query Apache2.2

and see what you get back.  If you get nothing back then issue:

     sc query state=all | findstr /i /c:"Apache"

and see what you get back.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 24404496
I did some testing and the only way I could get the error message you were getting was not to have the ConfigArgs entry.  

As you state that you have the key (and were aware of the key) that I pointed I, I am guessing that somehow you have Apache installed as a Different service name and that under that key there is no ConfigArgs entry.

I do have a typo in the second command it should be:

     sc query state= all | findstru /i /c:"Apache"

In fact just enter the above command.  The difference between the two is the second and correct command has a space between the = sign and the word all.
0
 
LVL 39

Author Comment

by:abel
ID: 24405633
The good news is: it works again. The bad news is, I'm not sure I really know why it works now.

The found service settings in the registry are interesting (esp. that you managed to reproduce this ill behavior of Apache!), but note that I had the same behavior when run from the commandline and when all registry settings were removed. After a default install (after first a full automatic + manual removal) these settings were back to their defaults, but that didn't help.

The story about how I got it working again is more related to possible malware, virware or trojware so I post that in the other question I asked about ill behavior of my system: http:Q_24414271.html (it seems more related to that then it is related to Apache). In short: running ComboFix did the trick, though I don't know how...

-- Abel --
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 500 total points
ID: 24405698
Interesting.  

I actually glanced through some of Apache's source code and tried to find when it issued the message you were getting.  I'm have no knowledge of C programming so it was a tough to do, but it seemed that the registry settings and command passed on the start command were the issue.  That is why I started playing around with the settings.  Glad to see the problem is fixed.
0
 
LVL 39

Author Closing Comment

by:abel
ID: 31581928
Maybe not "the answer", but that's not important. Nobody (see other threads) has been able to really find out what the problem was, but it was not with Apache, that's for sure.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now