Translation plugin installaton pops up SQL error

Hi All,

Do you have any idea why system system shows the following error message when I try to install theme dependant plugins on a fresh OctoberCMS installation?

Error message:

Update Failed
"SQLSTATE[42P01]: Undefined table: 7 ERROR: relation “rainlab_translate_message_data” does not exist LINE 1: select * from “rainlab_translate_message_data” where “locale… ^ (SQL: select * from “rainlab_translate_message_data” where “locale” = en limit 1)” on line 760 of /vendor/laravel/framework/src/Illuminate/Database/Connection.php

I have these plugins as dependencies in the theme.yaml file of my theme:

require:
    - "RainLab.User"
    - "RainLab.Translate"
    - "Rainlab.UserPlus"
    - "Rainlab.Location"
    - "Rainlab.Notify"

This is a brand new installation of OctoberCMS.
OctoberCMS version: 3.1.26
RainLab Translate plugin version: 2.1.1

Thanks in advance for your help,
vimre

Hi @vimre

Can you check that the database is migrated with

php artisan october:migrate

Hi Samuel,

Database was migrated when I first time opened the Backend page.
I used “Check dependency” button on backend System updates to install plugins that marked as required in theme.yaml file. I have not installed any other plugin before in this installation. I have copied only my theme files.

The most strange part is that I was able to install Translate plugin from Plugins menu point in the Backend but it did not work by Check dependency button and artisan/composer.

Thanks in advance for checking,
vimre

Try making the table manually using php artisan tinker:

Schema::create('rainlab_translate_message_data', function($table)
{
    $table->increments('id');
    $table->string('locale')->index()->nullable();
    $table->longText('data')->nullable();
    $table->longText('usage')->nullable();
    $table->timestamps();
});

Thanks, but I am not searching for a workaround. I am searching for a permanent solution :slight_smile:

I have noticed that installation of the plugins works fine if they are listed in the following order in my theme.yaml file:

require:
    - "RainLab.User"
    - "Rainlab.UserPlus"
    - "Rainlab.Location"
    - "Rainlab.Notify"
    - "RainLab.Translate"

So if the Translate plugin is the last in the row.
But I receive the mentioned error message when Translation plugin tries to be installed before any other plugin.

As I see migration command runs only after the last plugin were installed (downloaded) so it ‘Check dependency’ button first download all plugin files to Plugins folder, then it runs php artisan migrate command.
For some reason the installation process die when it download Translate plugin and does not run migration immediately after.

Have you tried to test the same scenario in your environment with a fresh installation and with the following list in theme.yaml file?

require:
    - "RainLab.User"
    - "RainLab.Translate"
    - "Rainlab.UserPlus"
    - "Rainlab.Location"
    - "Rainlab.Notify"

Don’t you receive error message on the backend if you click on Check dependencies button?

1 Like

Thank you for the clarification. This is a good find. We have fixed it in the latest version of the Translate plugin (v2.1.3).

It works fine! Thank you. :slight_smile:

1 Like