Login.php error?

ideaman911 wrote on Friday, April 03, 2009:

Jason & Brady et al;

Ver 3.0.1 has a reliable problem (at least in Windows) with the login screen, which appears to be related to an added codeset in login.php as retrieved on 4/1/09 as the CVS for Windows.

It appears from line 90 thru 101 to be added vs prior versions (prior line 90 was at 87).

I think it may be the declaration ‘%".$ip."’ in line 94 or that the word ‘failure’ seems to be missing the ‘f’, but i do not know the syntax well enough to explain it.

the error is in red and just below the login user and password boxes on the login scfreen before anything is input except the browser IP call, and looks like:

ERROR: query failed: select user, date, comments from log where event like ‘login’ and comments like ‘%127.0.0.1’ order by date desc limit 1

Error: Got error 127 from storage engine

Has anyone else seen this or know why it occurs (and more importantly how to fix it)?  It seems to want to be related to the GACL inclusion, but a bad login actually puts the following above the boxes:

Invalid username or password

which I would think covers the access issue entirely?

Joe Holzer    Idea Man
http://www.holzerent.com

bradymiller wrote on Friday, April 03, 2009:

hey,

You likely have a corrupted table. Check out these links regarding error 127:
http://forums.mysql.com/read.php?88,27250,237147#msg-237147
http://www.captain.at/howto-got-error-127-from-table-handler.php

I’m gonna use this opportunity to again recommend that you upgrade to a more current version of XAMPP.  In 2005, XAMPP was not nearly as mature as it is now, and your using MYSQL version 4.  This will be much easier for you to do now while your client list is manageable.

I have been stressing this to you for some time now for the following reason; I have not yet been able to re-create any of your reported windows bug on Windows XP with XAMPP version 1.7.0 .  This leads me to believe that your legacy XAMPP version is the responsible party.

-Brady

ideaman911 wrote on Saturday, April 04, 2009:

Brady;

While it is possible you are correct, a few things should be noted:

a)  When I downloaded the Xampp zip file in November '08 it was the latest as far as I knew.  It shows as win32-1.4.13 and has been the one I have worked with since starting with OpenEMR 2.9.0 with no prior problems related to Xampp.  It runs PHP 5.4  I will try to find and test the Xampp 1.7 you noted, but…

b)  When I downloaded the prior CVS (ver 1.11 as developed by you 1/30/09, the first change in login.php seemingly since April '08) it works fine with none of the error message, unless I try to enter an invalid user or password, in which case it tells me that, exactly as I would expect.

c)  So do you really know what Mark "improved" in the seven days after your 1.11 version to come up with his 1.12?  Has YOUR testing been working with his 1.12 or your 1.11?

As I noted, I will try to test the Xampp issue and again try the setup.  But 1.11 sure seems stable to me with the current 1.4.13 Xampp.  I’ll be happy to work with the newer Xampp once it demonstrates it works at least as well.  And I will remove my “//” comments from the file which results in the “COERCIBLE” error at the Encounters View as well at that time.  If I had to bet, however, I would not put much on the prospects.  Again, if it ain’t broke, and the login certainly didn’t seem to be, and even worked with the 1.12; it just displayed the error message, then what exactly did we “fix” in 1.12?

Until I can do that test, I’ll use your 1.11 CVS version for testing the rest of 3.0.1, which was really my purpose.  I hope you agree.

Joe Holzer    Idea Man
http://www.holzerent.com

bradymiller wrote on Saturday, April 04, 2009:

hey,

a) Here’s the list of released XAMPP packages with release dates, that version was released 4/10/2005 (uses MySQL 4.11):
https://sourceforge.net/project/showfiles.php?group_id=61776&package_id=89552

b) Your error is likely because your ‘log’ table is corrupt (doesn’t have to do with openemr code, it’s just that the newer version tries to check your corrupted ‘log’ table to ensure there wasn’t a previous unsuccessful login); likely related to a combination of your old MySQL version and your method of mysql backup.  I think when you copy mysql tables like files you need to lock them and flush them first to avoid problems;  or you could use the mysqldump command.  Most of time a corrupt table can be repaired.  Here’s a mysql page that discusses this stuff:
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
here’s a link which discusses mysql table repair:

c) For a test, simply install XAMPP 1.7.0, start apache and mysql, place the new openemr 3.0.1 in the web directory, then run the script http://localhost/openemr and follow the instructions.  I am rather confident you will be pleasantly surprised. (Also, don’t touch any openemr files, such as globals.php before you run the installation script)

-brady

ideaman911 wrote on Saturday, April 04, 2009:

OK; So I found and loaded up Xampp 1.7.  The first thing I noticed was that the "doggybone" now has more buttons than a Porsche radio, and the usual quality of instruction (not) in their use.

So following 18 hours trying to make it work, with each attempt dashed at the NEW CREATE (having removed and re-extracted Xampp 1.7 and OpenEMR CVS from 4/1/09 each time) I have returned to my prior "state of grace" which works perfectly well using the Xampp 1.4, and the same CVS with the 1.11 version of Login.php (as well as working with the 1.12 version once I actually enter a correct user and password, even while it displays the error as noted earlier before I enter ANYTHING).

Process intent was to first demonstrate a "virgin" install and follow the Brady Wiki instructions explicitly (noting that they omit the "doggybone"  start and run).  But Every time it got to the "Connecting to MySQL Server" it simply hung.  I noted that the 1.7 doggybone puts a checkmark in the Svc box alongside MySQL which will not remove, and selecting the Svc box at top and clicking on its various checkpoints seems to have no effect.  When I check in the XP Services area I see MySQL, but it has no details except that it is not running, and will not start.

I had intended to first verify all the functions "out of the box" with new data, then copy over my data which works fine in 1.4/3.0.1 and then add in my various "usability" changes.  I cannot even get the 1.7 to respond to get to the first milestone.

Meanwhile I can revert at will to the 1.4/3.0.1 setup which I keep on the same drive by renaming it as xampp14-301 then back to xampp for actual operation.  I have tried full re-boots, etc for 1.7 to no avail.

Brady, I seem incapable of getting 1.7 to work at all. Meanwhile you are frustrated that my use of 1.4 means I do not know of all the changes made for 3.0.1 which negated need for all the mickey mouse it took me to make OEMR 2.9 work in Windows.  I do not see how 1.7 actually had anything to do with my ignorance.  I wonder by what possible means you thought I could have known of those settings changes, which are diametrically opposite the writeup which Dr Bowen asked me to do for XP, which was based on everything I could find and then used to make 2.9 work?  But if that is somehow detrimental in trying to assist others working in Windows as well, then it is best that I remain in my little world which DOES work, and refrain from further efforts to assist anyone.

Thanks for the advice.  If you did as you indicate, setup an XP machine with 1.7-3.0.1, it might help me to at least know what button combination you selected, and more importantly WHY.  I really would like to make OpenEMR viable in the Windows world, and see little rational reason why the newest OEMR software, which still DOES work with 1.4, would not work the same at a fundamental logic level no matter what platform it was on.  EXPLAINING that would go a long way to preventing this time loss in the future.

Joe Holzer    Idea Man
http://www.holzerent.com

mbrinson wrote on Saturday, April 04, 2009:

Have you ever tried "UNIFORM SERVER"?

It’s very straight forward to me and definitely worth a look if you haven’t tried it before.

What I love most about it is that it’s completely stand-alone requireing no installation.  Just run a batch file from within the folder to kick it off.

Try it out and let me know what you think.  It’s at www.uniformserver.org I believe.  Just google and you’ll find it.

mbrinson wrote on Saturday, April 04, 2009:

Sorry, should have clarified.  After reading my own post I realized it read like an advertizment or spam.

Uniform server is a LAMP server.  Use it instead of XAMP.

bradymiller wrote on Sunday, April 05, 2009:

First, let me start by saying your contributions are highly valued.

The reason I’m so stern regarding your old version of XAMPP is twofold:

1. It is causing some problems for you now requiring workarounds and it will continue to cause more problems as support for MySQL 4 wanes.  Your better off upgrading now than putting it off, or else you will be spending increasing amounts of your time creating workarounds for "buggy" behavior and you will no longer be able to take advantage of subsequent OpenEMR releases.

2. Selfishly, I’d like others (meaning you) to also provide support for windows installation on these forums. But it is hard to provide support if you have not been able to install OpenEMR like the majority of the users asking questions.

After I install XAMPP, I just go to the control panel and click start button on mysql and apache.  What output do you get when you click the ‘status’ button in the XAMPP control panel?  My initial guess is that your having problems with XAMPP 1.7.0 because you also have your previous XAMPP installed on the same system.  An option just to see it work is installing it on a native windows system that does not have or ever had the previous XAMPP on it.

-brady

bradymiller wrote on Sunday, April 05, 2009:

also - the “Directory Mismatch” warning is benign.  I also get this; from control panel and doesn’t affect function of xampp.

ideaman911 wrote on Monday, April 06, 2009:

Brady;

Well, at least your info made some progress occur.  As I retraced my steps I see that I actually HAD a “new install” of the 1.7/3.0.1 which worked with fresh data.  Then before I had actually logged in I copied the Openemr folder as I have been doing from my already operating copy of my real data from the 1.4/3.0.1 setup which works fine.   The baseline problem was that once I made the mistake of doing that and couldn’t then login, I tried clicking on the Xampp Service button thinking that I had to do that, since there were no instructions for all the buttons.

That causes a problem for which there is no intuitive solution, both because it locks in XP and it turns out that the Xampp call for the service links to a file supposedly supplied by Xampp called "mysqld-shareware.exe" which does not exist.  However, XP still tries to set the service, and once set it is impossible to get around.  Until I found an obscure Command Line instruction which allowed me to delete the Mysql service (talk about convoluted) under XP, which again allowed the setup of a fresh 1.7/3.0.1.  For anyone else suffering as I have, that command is "sc delete mysql" which saves the terror of manually editing the XP registry file.  Then make CERTAIN to press NO buttons on the Xampp except the Start alongside each of Apache and MySQL, and make certain to press NONE of the Svc or SCM buttons at any time once they have been cleared.

After I did that, at least fresh data was operable.  While testing that I noted that the new GACL still requires (as did the prior external version) defining a user’s rights in the Advanced area instead of concurrently with picking the group during the User creation, leaving a “Not assigned any group” error for any user merely configured within the Admin - User area until then, and therefore prevents their ability to login until that is done.

Once I had that pretty well understood and could fix any I created, etc., I again tried the way I was successful with 1.4/3.0.1, which was to upgrade my 2.9.0 data using the sql_upgrade.php tool and scripts, along with the gacl_ prefixer in the gacl folder files, then copying those over the existing files in the openemr folder.  You probably noticed my expressed concerns about the external backup (since OpenEMR backup seems not to work for anyone in XP), and more critically restore, probably not working with the 1.7 setup at all.  I was prevented from even batch replacement of the OpenEMR PHP files with those I had edited in the 1.4/3.01 to give me my desired usability.  I could do them manually, but got "Access Denied" errors when I used a DOS batch file.  Why is that considered "desirable"?  If that is because of some added "security" for web servers, is there a way to switch it off for those not using the web?  None of the files I mentioned above had any problem working if they WERE manually copy-pasted, so they were not the issue.

I tried every permutation I can think of, from manual as per above to simply replacing the …/mysql/data/openemr/ folder with the entire folder from my 1.4/3.0.1 successful setup.  ALL still give me the same inability to get past the login screen.  I even tried replacing the login.php with the 1.11 version which works fine and prevents the error message with 1.4, but that also has a login failure with 1.7 and my 1.4 sourced data.  The ONLY one which works is fresh database creation, which may be useful for a newbie, but not much good to him the first time a server fails.  I was able to delete the …/data/openemr/ folder after making a copy of it, then restore it by copying it back.  But I was never able to make the prior 2.9.0 data which I had working with the 1.4/3.0.1 setup to be accessible by the 1.7/3.0.1 setup.

Clearly there is some fundamental change which occurred between the data format for the Mysql in 1.7 vs that for 1.4.  But unless I can find out how to fix that I would advise anybody who already has data created with ANY earlier version to tread VERY carefully.  If they have similar problems, how many will be happy with the fact that Xampp has "improved"?  Again, users do not care one iota what the latest gee-whiz way of doing things is - they need to be able to utilize the time investment they have already made.  If that cannot be done, we will be hard pressed to hope for more users, as existing ones will vent their frustrations.

WE must make a seamless and simple "fixer" which looks at the existing data a user arrives with and magically makes it work fine with our latest or we have no prayer.  Just look at the massive push-back Microsoft suffered with Vista when they refused to make it able to be accessed by Win 98 networked resources.

I am not very happy that Xampp created a link to a file which doesn’t exist, nor that they have so many buttons which will simply trip up users of 1.7.  It may be the standard of you programmers, but you programmers represent a very small droplet in the ocean of users who would never be willing to work at this like I have.

So you help me and I’ll help you.  I can see no possibility that my Xampp 1.4 will be more than the tip of this iceberg when I consider the letter YOU responded to from the guy using Wamp.  We had better get used to the whole idea of differing sources and environments and find a way to make them workable.  Right this moment I would have no problem loading any new Windows client with 3.0.1 with the 1.11 login.php on a 1.4 Xampp BECAUSE IT WORKS and IT TOOK THE UPGRADES and IT ALLOWS BATCH COPIES to update files AND it works in XP.  1.7 does none of the above with my prior data, even AFTER I figured out the action it takes which it does not even support with service.  This is the “stable” platform you advise for Windows?

To quote the Top Gear Guys - How Hard Can It BE?!

If you have any insights, I am all ears.

Joe Holzer    Idea Man
http://www.holzerent.com

bradymiller wrote on Monday, April 06, 2009:

hey,

Several issues here to go through.

1) GACL issues.
In theory, you should never have to use the original php-gacl gui since version 2.9.0.  The admin is given administration acl access on installation.  And when you create new users, there is an selection menu where you select acl groups to put the user into.  More administration can then be done in the admin->acl menu (this was created to save users from the very non-intuitive php-gacl gui).  Are you choosing a group(s) when you make the user. If so, and it’s not placing the user into the group, then you’ve got another bug to add to the mix.

2) XAMPP 1.7.0 issue
You are correct in that XAMPP has problems in 1.7.0 regarding the control panel setting up the mysql service.  Sadly, we can’t control the stability of all releases of XAMPP or WAMP.  This obviously makes it no ideal for the XAMPP/openemr project, and I’d recommend going one XAMPP version backwards to avoid this bug.  The fix to set up a mysql service is to not go thru the XAMPP control panel to set up or remove the mysql service.  Click to the /xampp/mysql directory and double-click below files in order:
mysql-uninstallservice.bat
mysql_installservice.bat

The link that discusses this bug is here:
http://www.apachefriends.org/f/viewtopic.php?f=16&t=32840

3) MYSQL database issue
You need to upgrade your database from your old mysql version to the new mysql version.  You’d probably be ok by backing up your database to a backup file via mysqldump command (this is how i migrated from mysql4 to mysql5).  Then can use this file to restore the database to the new mysql version.  The mysqldump command is also a good safe way to do your mysql database backups.

4) Legacy XAMPP version:
Unluckily, you managed to recently begin your openemr experience with a legacy XAMPP version from 2005.  XAMPP was not a mature product back then, and the mysql version it contained is very old.  This is main cause for your corrupted log table and it has caused you to create workarounds for buggish behavior(coercible thing and possible gacl thing), which will only get much worse as support for mysql4 begins to wither away.  If a user came into the forum and asked what to do, I would recommend upgrading to a new version of mysql.  This is not an openemr phenomenon; lots of software is beginning to lose support for mysql 4 now (I actually test openemr on a mysql 4 development environment, but not as old as your mysql version).  Sadly, the building blocks (php, mysql, apache) are not static and need to be upgraded every several years.  This is why it’s best to start with the most current version to put off required upgrading to as far out as possible.  You are in an unusual position here; I’d venture that less than 5% of windows users on these forums will have your problems simply because of the old xampp version you started with.  To then recommend this setup to new users windows and put them in your position would be a real disservice.  I agree we should not recommned XAMPP 1.7.0 because of the service bug, gut going back one XAMPP version should suffice.

thanks,
-brady