Support forums : Quickies

Installation Woes

A home for really quick one-liner thoughts about what we need to fix or do or whatever. If they spark discussion we move it, otherwise this is like post-it notes.

Moderator: Dracones

Installation Woes

Postby Kimberly » Thu May 30, 2013 2:08 am

OK, I have a question. I started the install and got to the install tables part and then it goes to the "Check your database config settings below and update them if necessary..." and then it tells me that I can not update until I :

$app_allow_dbase_reset = 0;

to

$app_allow_dbase_reset = 1;

First of all, why are we starting with that set to zero? This has always been a stick in my side concerning installation of Quam Plures (and that other unmentionable app). If I could easily change it at this stage, instead of having to ftp in, or shell in, and make the changes, then go back to the installation, it would be easier and less frustrating. This should be set to zero AFTER the installation so that it is not a stick in our sides trying to install Quam Plures.
Kimberly
Dracone
User avatar
 
Posts: 842
Joined: Mon Jul 19, 2010 4:44 pm

Re: Installation Woes

Postby Kimberly » Thu May 30, 2013 2:23 am

OK, I think I found a bug with the installer; and I found this same bug in the old app and I had to yell at them to get them to finally agree it existed.

Seems if my database password contains $XY; where XY is either numerals or letters, it is removing the $ and the XY. For example, for password abcd$efg, it becomes abcdg; which is why the installer yelled ab me about checking the config.
Kimberly
Dracone
User avatar
 
Posts: 842
Joined: Mon Jul 19, 2010 4:44 pm

Re: Installation Woes

Postby EdB » Thu May 30, 2013 6:25 am

wow okay that's not cool, but should be fixable :)

when I test on localhost I don't use a password, and when I implement in the real world I only use alphas and numeras so I never had the chance to experience it.

I'll see what I can do about it ....
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Installation Woes

Postby EdB » Thu May 30, 2013 7:19 am

Just noticed the first issue, which for me has never ever ever been an issue. I have never been hindered installing or upgrading with it set to 0, which is what it should be else you can wipe out your database. The only time you want that is when you are replacing an installation with a fresh one, which is not the same as installing right?

gonna test the db password now with the sample password you provided. I download a zip and am uploading it to my server space, and will then create a database for it using that reasonably clear password example. HOPEFULLY it goes into the main_config file incorrectly because that's us doing a preg_replace. If the file is good and it won't connect that's a php function being called so I dunno what we can do about that.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Installation Woes

Postby EdB » Thu May 30, 2013 7:30 am

ruh roh. Using the password example above it stored it in the real file correctly and connected to the database for installation without issue or incident. Dunno what to say ... I mean, some of the simple stuff that comes to mind honestly doesn't sound like a path to a solution - more like reaching at straws. php version, anything you know of that might be "funny" or whatever on your server?

Hey I got the impression it stored the password wrong in the _main_config.php file - is that true? In other words you're seeing the problem in a file, not extracting it out from a server log or something? Assuming that's true the only place we can look with any confidence is the install/index file where it does the rather fancy preg_replace for the database info. Something about the regex going weird under a very specific set of circumstances?

dunno, but now that I got a "raw qp latest" on my server space I'm gonna keep it and do some bug hunting if I can. Unfortunately the few I found in my active installation were due mostly to having users with lesser permissions than admin has. Still, they're in there so they gotta get found and squashed eh?
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Installation Woes

Postby Kimberly » Fri May 31, 2013 4:01 am

OK, doing a fresh install on a fresh database.
You get to the point where you enter your database info; You enter the info and then it continues to the next window where it asks you if you if you are setting up a new install and if you want it to create sample posts. I enter the settings I want and then press the button to continue. It was at this point that the install failed with the check config and that you have to reset in order to update the config. So I do that and go back and it reads in the config and I see the database password is incorrect, notice the missing $ and the next two characters as well. Tested with replacing the characters with numerals to see and same results.

Now this same bug appeared in that other app and at first I was told that no, the bug did not exists. It is possible we inherited this bug from that app and it just never appeared; I do regularly use symbols in passwords and use $ and ! most often over others. Yes, the main config file was being written incorrectly, so when it got to the point where it is suppose to connect to the database to create the tables, it can not because of the wrong password. Of course I can just edit the main config and all its good but we need to address this. I can test to see what combination of numerals and characters and symbols work or don't work. My guess when I saw it at that other app was that the $ was being seen as a variable declaration or that $XY was being seen as a variable. Perhaps the input scrubber against SQL injection is the culprit; seeing it as an attempt to enter some bad input.

I am reluctant to share the actual password as the user also accesses another database.
Kimberly
Dracone
User avatar
 
Posts: 842
Joined: Mon Jul 19, 2010 4:44 pm

Re: Installation Woes

Postby EdB » Fri May 31, 2013 6:59 am

Here's the code from our file, then the same block from their latest "stable" release. There are diffs - even I can see that - but they're regex stuff and I've no clue how to do anything with regular expressions except break 'em. I'm thinking you can change from ours to theirs and see if the problem repeats? NOTE: I changed the order of the bits in their code to match ours because I recall we were scrambling up our stuff when we shuffled bits around so long ago. I seriously doubt it'll change anything, but full disclosure and all that eh? Anyway our code first ... a big-ass preg_replace thingie
Code: Select all
        // Update conf
        $conf = preg_replace(
            array(
                '#\$app_db_config\s*=\s*array\(
                    \s*[\'"]host[\'"]\s*=>\s*[\'"].*?[\'"], ([^\n\r]*\r?\n)
                    \s*[\'"]name[\'"]\s*=>\s*[\'"].*?[\'"], ([^\n\r]*\r?\n)
                    \s*[\'"]user[\'"]\s*=>\s*[\'"].*?[\'"], ([^\n\r]*\r?\n)
                    \s*[\'"]password[\'"]\s*=>\s*[\'"].*?[\'"], ([^\n\r]*\r?\n)
                    #ixs'
,
                "#app_db_tableprefix\s*=\s*'.*?';#",
                "#app_baseurl\s*=\s*'.*?';#",
                "#app_config_is_done\s*=.*?;#",
            ),
            array(
                "\$app_db_config = array(\n"
                    ."\t'host' => '".str_replace( "'", "\'", $conf_db_host )."',\$1"
                    ."\t'name' => '".str_replace( "'", "\'", $conf_db_name )."',\$2"
                    ."\t'user' => '".str_replace( "'", "\'", $conf_db_user )."',\$3"
                    ."\t'password' => '".str_replace( "'", "\'", $conf_db_password )."',\$4",
                "app_db_tableprefix = '".str_replace( "'", "\'", $conf_db_tableprefix )."';",
                "app_baseurl = '".str_replace( "'", "\'", $conf_baseurl )."';",
                'app_config_is_done = 1;',
            ), $conf );
 


Now their code with the bits moved around slightly ...
Code: Select all
            // Update conf:
            $conf = preg_replace(
                array(
                    '#\$db_config\s*=\s*array\(
                        \s*[\'"]name[\'"]\s*=>\s*[\'"].*?[\'"],     ([^\n\r]*\r?\n)
                        \s*[\'"]host[\'"]\s*=>\s*[\'"].*?[\'"],     ([^\n\r]*\r?\n)
                        \s*[\'"]user[\'"]\s*=>\s*[\'"].*?[\'"],     ([^\n\r]*\r?\n)
                        \s*[\'"]password[\'"]\s*=>\s*[\'"].*?[\'"], ([^\n\r]*\r?\n)
                        #ixs'
,
                    "#tableprefix\s*=\s*'.*?';#",
                    "#baseurl\s*=\s*'.*?';#",
                    "#admin_email\s*=\s*'.*?';#",
                    "#config_is_done\s*=.*?;#",
                ),
                array(
                    "\$db_config = array(\n"
                        ."\t'name'     => '".str_replace( array( "'", "\$" ), array( "\'", "\\$" ), $conf_db_name )."',\$1"
                        ."\t'host'     => '".str_replace( array( "'", "\$" ), array( "\'", "\\$" ), $conf_db_host )."',\$2"
                        ."\t'user'     => '".str_replace( array( "'", "\$" ), array( "\'", "\\$" ), $conf_db_user )."',\$3"
                        ."\t'password' => '".str_replace( array( "'", "\$" ), array( "\'", "\\$" ), $conf_db_password )."',\$4",
                    "tableprefix = '".str_replace( "'", "\'", $conf_db_tableprefix )."';",
                    "baseurl = '".str_replace( "'", "\'", $conf_baseurl )."';",
                    "admin_email = '".str_replace( "'", "\'", $conf_admin_email )."';",
                    'config_is_done = 1;',
                ), $conf );
 


AND that simply won't work anyway because the $variable name things are different. You would have to take only the parts that apply to the database connection and swap them out to test.

Well ... in terms of seeing if it writes the file with a $ or not it might not matter? Anyway worth testing perhaps eh?

If you need help getting it going for testing purposes lemme know and I'll try to write up a file that "should" work for you :)
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Installation Woes

Postby Kimberly » Tue Jun 18, 2013 5:56 pm

Sorry, got pulled away again. I will look at this and report back.
Kimberly
Dracone
User avatar
 
Posts: 842
Joined: Mon Jul 19, 2010 4:44 pm


Return to Quickies

Who is online

Users browsing this forum: No registered users and 2 guests

cron