Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla installer not working for me

SteveSRSSteveSRS New
edited May 2013 in Vanilla 2.0 - 2.8

Hi,

I'm trying to move my old phpBB board to a new server and at the same time change to Vanilla forums.
So to start I want to install Vanilla forums however it is giving me error:


SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

You must specify the name of the database in which you want to set up Vanilla.

Banner Title is required.

So I'm on a Nginx+php5-fpm (+xcache) server with Mysql (5.5) installed.
Everything works fine. I have multiple sites running on this server and I can access my phpmyadmin normally. I created a database for Vanilla forums and using that login data I can login using phpmyadmin without any problem.

I've tried using (as database host):

  1. localhost

  2. ip

  3. localhost;unix_socket=/var/run/mysqld/mysqld.sock | which is the only .sock file I have

None of the options work (all with same error).
Details which I'm using are 1000% correct, I quadruple checked them.

Vanilla installer version: 2.0.18.8

Any help please? Must be something specific from Vanilla forums as no other site I have running has db connection problems..

P.s. vanilla has some weird make-up issues when posting this threads (some enters are ignored, other text is bold when it shouldn't and a couple '--' are made into a whole line and the other (exact same size) isn't.

Comments

  • Made a small testing php script:

    `
    echo "testing:";

    $dblink = @mysqli_connect("localhost", "theusername", 'thepassword');
    if( !$dblink ){
    //notify(CURRENTDOMAIN." db trouble!!","config.php",true);
    ///echo "$url ";
    //if(CheckOnline($url)) echo "1";
    //else echo "0";
    //EmergRedirect();
    echo "
    db connect error";
    }
    if( !mysqli_select_db($dblink,"dbname") ){ // Select the database.
    //notify($_SERVER['HTTP_HOST']." db trouble (select db)!! User ip: ".$_SERVER['REMOTE_ADDR'],"config.php",true);
    //EmergRedirect();
    echo "
    table select error";
    }
    echo "
    all done!";
    mysqli_close($dblink);

    echo "
    pdo connect:";
    try {
    $conn = new PDO('mysql:host=localhost;dbname=dbname', "theusername", 'thepassword');
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    } catch(PDOException $e) {
    echo '
    ERROR: ' . $e->getMessage();
    }

    echo "
    also done..";

    ?>
    `

    Uploaded in same dir als forum.. worked as a charm no errors at all

  • Vanilla uses PDO

    have you done

    127.0.0.1;unix_socket=/var/run/mysqld/mysqld.sock

    you can specify port like so

    127.0.0.1:123

    grep is your friend.

  • P.s. vanilla has some weird make-up issues when posting this threads (some enters are ignored, other text is bold when it shouldn't and a couple '--' are made into a whole line and the other (exact same size) isn't.

    Actually this is the markdown formatter, it take a while to get used to writing in mardown.

    grep is your friend.

  • Hi x00,

    Thanks for the reply.

    I've also tried:

    127.0.0.1;unix_socket=/var/run/mysqld/mysqld.sock

    and

    127.0.0.1

    same result for both. The database port is the standard one.
    Also as you can see from my test script I also tried pdo connection and it connects without problem in my test script.

    I even tried creating a new users + password and try it with those details but again same result.

  • SteveSRSSteveSRS New
    edited May 2013

    ok so decided to just do some brutal debugging in the code and just found that variables like $DatabaseHost, $DatabaseName, $DatabaseUser etc all contain value 'Invalid'...

    No idea yet where that is coming from..
    Just checked POST values using FF plugin TamperData and they are there as normal so must be error in Vanilla coding..

  • SteveSRSSteveSRS New
    edited May 2013

    I don't know why but the Installer form sends values like:
    Configuration/Database-dot-Host
    Configuration/Database-dot-Name
    Configuration/Database-dot-User
    Configuration/Database-dot-Password

    etc..

    Now the -dot- is indeed replaced with '.' correctly however the 'Configuration/' part is one big mess..

    In /library/core/class.form.php it creates:
    $FieldName with value: 'guration/Database.Host'

    and then it checks with this line: (around line 1580)
    if (substr($Field, 0, $TableNameLength) == $TableName) {

    Which translates in:
    if ('Confi' == 'Form')

    which of course never validates and the post values keep empty..

    Did anybody actually use 2.0.18.8 installer successfully? As this coding does not make any sense

    P.s. aargh god damn markdown crap.. when I put an ENTER I want an new line .. who makes up having to put 2 spaces for an newline.. hope that is some optional plugin because Its NOT user friendly

  • SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

    what did Google tell you when you searched for this exact text?
    you can also use normal HTML those comment boxes

    There was an error rendering this rich post.

  • x00x00 MVP
    edited May 2013

    @SteveSRS said:
    I don't know why but the Installer form sends values like:
    Configuration/Database-dot-Host
    Configuration/Database-dot-Name
    Configuration/Database-dot-User
    Configuration/Database-dot-Password

    in class.setupcontroller.php

    just inside Configure put after $this->Form->SetModel($ConfigurationModel);

      $this->Form->InputPrefix = 'Configuration';
    

    this may well be a bug in which case you can report it on github. Make sure to state the device you are using and the browser.

    P.s. aargh god damn markdown crap.. when I put an ENTER I want an new line .. who makes up having to put 2 spaces for an newline.. hope that is some optional plugin because Its NOT user friendly

    no it is not default. the default is htmLawed, but you can use other formatters. Personally I prefer github flavoured markdown.

    grep is your friend.

  • Hi,

    I run into this problem too, so the bug is still there.
    Currently I don't have the time to dig into this (yes, the code there is quite a bit... confusing?).

    Short fix:
    Install with a dummy .htaccess file, even it is totally ignored by nginx.

  • hi ,
    I am also facing same problem. Did any one find a solution for this problem. is it fixed?

    @Foodle‌ , May i Know how to add dummy .htaccess file

Sign In or Register to comment.