• Resolved adrianchan

    (@adrianchan)


    Hi,

    We are moving a website using Duplicator but it stuck with charset issue.

    EXCEPTION ERROR:  Invalid character set was provided
    	FILE:/var/www/html/b02.bsi/dup-installer/classes/database/class.db.php[560]
    	TRACE:
    #0 /var/www/html/b02.bsi/dup-installer/classes/database/class.db.php(560): mysqli_set_charset()
    #1 /var/www/html/b02.bsi/dup-installer/classes/database/class.db.functions.php(136): DUPX_DB::setCharset()
    #2 /var/www/html/b02.bsi/dup-installer/ctrls/classes/class.ctrl.dbinstall.php(446): DUPX_DB_Functions->dbConnection()
    #3 /var/www/html/b02.bsi/dup-installer/ctrls/classes/class.ctrl.dbinstall.php(517): DUPX_DBInstall->dbConnect()
    #4 /var/www/html/b02.bsi/dup-installer/ctrls/classes/class.ctrl.dbinstall.php(205): DUPX_DBInstall->prepareDB()
    #5 /var/www/html/b02.bsi/dup-installer/ctrls/classes/class.ctrl.ajax.php(211): DUPX_DBInstall->deploy()
    #6 /var/www/html/b02.bsi/dup-installer/ctrls/classes/class.ctrl.ajax.php(92): DUPX_Ctrl_ajax::actions()
    #7 /var/www/html/b02.bsi/dup-installer/main.installer.php(56): DUPX_Ctrl_ajax::controller()
    #8 {main}

    When checking validation, it enforces utf8mb3 rather than utf8.

    CTRL PARAMS AFTER VALIDATION
    DEFAULT DB_CHARSET [utf8] isn't valid, update DB_CHARSET to utf8mb3 and DB_COLLATE set empty
    AJAX ACTION [validate] SUCCESS
    -------------------------

    However, utf8mb3 is not a correct value. So it failed at that line and cannot import db.

    Here is my environment:

    MySQL 8.0.30-0ubuntu0.22.04.1 (Ubuntu)

    OS__________________: Linux
    PHP VERSION_________: 8.1.2
    SERVER______________: nginx/1.18.0

    WP VERSION__________: 6.0.1
    DUP VERSION_________: 1.5.0
    DB VERSION__________: 8.0.30

    In fact, we have tried to hardcode $charset in DUPX_DB::setCharset() with value ‘utf8mb4’ or ‘utf8’.
    Both values work correctly.

    So, is it possible allow user input for charset in advanced installation mode?

    We can see below statement but cannot find the field for charset.

    In case the default charset/collates are not the desired ones you can <b>change the setting</b> in the <b>advanced installation mode</b>.

    Please kindly advise.

    Thank you

    • This topic was modified 3 years, 6 months ago by adrianchan.
    • This topic was modified 3 years, 6 months ago by adrianchan.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey @adrianchan,

    There should be an option in the installer when using Advanced mode on Step 2 of 4: Install Database. Under the Advanced tab. Did you happen to try that?

    Thanks

    Thread Starter adrianchan

    (@adrianchan)

    Hi @corylamleorg,

    We really wish to see that charset field but just interrupted and see a white screen on step 2.

    advanced.mode.step1 https://ibb.co/BPbXkf4
    advanced.mode.step2 https://ibb.co/GQM50Ck
    basic.mode.step1a https://ibb.co/17zWBtr
    basic.mode.step1b https://ibb.co/Mh9WJRT

    Even basic mode can show more error info.

    Is it possible to show that field in step 1 of advanced installation mode?
    Any better suggestion?

    Please kindly advise.

    Thank you

    Thread Starter adrianchan

    (@adrianchan)

    Hey @adrianchan

    Yeah, that looks like a bug on your host/setup. If you would like to submit a support ticket for this issue we can have a closer look at your setup since that is the only way for us to reproduce the issue. Please provide a link to this forum thread when submitting the ticket.

    Thanks~

    Thread Starter adrianchan

    (@adrianchan)

    Hi @corylamleorg,

    Ticket submitted.

    I think it is a configuration value issue.
    It can be easily reproduced like below:

    <?php
    $mysqli = new mysqli("localhost","my_user","my_password","my_db");
    
    if ($mysqli -> connect_errno) {
      echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
      exit();
    }
    
    echo "Initial character set is: " . $mysqli -> character_set_name();
    
    // Change character set to utf8mb3 will raise exception
    $mysqli -> set_charset("utf8mb3");
    
    echo "Current character set is: " . $mysqli -> character_set_name();
    
    $mysqli -> close();
    ?>

    Since ‘utf8mb3’ is not a correct value for mysqli set_charset().
    This error should be handled by the plugin.

    Please kindly advise.

    Thank you

    Hey @adrianchan,

    Thanks for the update we will see if we can help find a solution…

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘EXCEPTION ERROR: Invalid character set was provided’ is closed to new replies.