NamelessMC

Internet Explorer

Internet Explorer is not supported. Please upgrade to a more modern browser.

Question Bug Deprecated Errors
Started by Firaman3D

Firaman3D

Firaman3D

Member
Joined
11 May 2018
Last Seen
31 Jul 2024
Topics
5
Posts
13

Hello NamelessMC Team,

I was unfortunately forced to reinstall my server.
Now I have restored the database and put the web data back under /var/www/html. The config file with the database access data has also been adjusted.

Now every time I go to the website I get the Visible error messages.
https://settla.org

I have browsed the internet and your wiki, but I am at the end of my latin.
Do you have a step by step fix for me?

Thanks for your work
With kind regards Robin

Translated with www.DeepL.com/Translator (free version)

Firaman3D · over 2 years ago
Samerton

Samerton

Owner
Joined
30 Mar 2015
Last Seen
03 Dec 2024
Topics
41
Posts
1076

Hi,

Nameless version 1 is not compatible with PHP 8 - you must use PHP 7.4 or lower

Alternatively you can upgrade to the v2 pre-release: https://github.com/NamelessMC/Nameless/releases/tag/v2.0.0-pr13

Samerton · over 2 years ago
Firaman3D

Firaman3D

Member
Joined
11 May 2018
Last Seen
31 Jul 2024
Topics
5
Posts
13

Hey Samerton,

downgrading PHP is unfortunately not a solution.
Unfortunately the upgrade of the website fails, maybe I'm doing the upgrade wrong.

My procedure for the upgrade:
1. move web FTP files to a subfolder "OLD".
2. unpack the release from https://github.com/NamelessMC/Nameless/releases/tag/v2.0.0-pr13 in the web directory
3. create a new account and database with PHPMyAdmin
4. open the installer via web page and select upgrade
5. specify new and migrating database

Now I get the error.
What can I do to install the upgrade successfully?

Thanks in advance.

Best regards Robin

 

Firaman3D · over 2 years ago
Firaman3D

Firaman3D

Member
Joined
11 May 2018
Last Seen
31 Jul 2024
Topics
5
Posts
13

I checked the file cache/logs/fatal-log.log for errors

 

[2022-07-24, 11:53:40] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:53:59] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:54:20] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_settings' doesn't exist
[2022-07-24, 11:54:20] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:54:22] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:54:22] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:55:17] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:55:17] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_phinxlog' doesn't exist
[2022-07-24, 11:57:52] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nameless2.nl2_settings' doesn't exist

 

But i also did the following and it doesnt work

https://github.com/NamelessMC/Nameless/issues/2822

Firaman3D · over 2 years ago
Samerton

Samerton

Owner
Joined
30 Mar 2015
Last Seen
03 Dec 2024
Topics
41
Posts
1076

The fix should definitely work if applied correctly - please ensure you delete the red lines and add the green lines in their place

Samerton · over 2 years ago
Firaman3D

Firaman3D

Member
Joined
11 May 2018
Last Seen
31 Jul 2024
Topics
5
Posts
13

Hey Samerton,

I have played through the whole thing 5 times now without success.
It still does not seem to work for me.
During the installation the error from the picture appears.

 


and in the Fatal Error I get the following message:

[2022-07-25, 22:43:28] /var/www/settla/core/classes/Database/DB.php(151): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`nameless2`.`nl2_users_groups`, CONSTRAINT `nl2_users_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `nl2_groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)

Firaman3D · over 2 years ago
Firaman3D

Firaman3D

Member
Joined
11 May 2018
Last Seen
31 Jul 2024
Topics
5
Posts
13

My ajax_initialise.php

 

<?php
if (isset($_POST['perform']) && $_POST['perform'] == 'true') {
    try {
        if ($_GET['initialise'] === 'db') {
            $message = PhinxAdapter::migrate();

            $redirect_url = (($_SESSION['action'] == 'install') ? '?step=site_configuration' : '?step=upgrade');

            $json = [
                'message' => $language->get('installer', 'database_configured'),
                'redirect_url' => $redirect_url,
            ];

            if (!str_contains($message, 'All Done')) {
                $json['error'] = $message;
            } else {
                $_SESSION['database_initialized'] = true;
            }

        } else {
            if ($_GET['initialise'] === 'site') {
                DatabaseInitialiser::runPreUser($conf);

                $json = [
                    'success' => true,
                    'redirect_url' => '?step=admin_account_setup',
                ];

                $_SESSION['site_initialized'] = true;

            } else if ($_GET['initialise'] === 'upgrade') {
                define('UPGRADE', true);

                require(dirname(__DIR__) . '/includes/upgrade_perform.php');

                $json = [
                    'success' => !isset($errors) || !count($errors),
                    'errors' => $errors ?? [],
                    'message' => $language->get('installer', 'upgrade_error'),
                    'redirect_url' => '?step=finish',
                ];

                $_SESSION['admin_setup'] = true;

            } else {
                throw new RuntimeException('Invalid initialisation');
            }
        }
    } catch (Exception $e) {
        $json = [
            'error' => true,
            'message' => $e->getMessage(),
        ];
    }

    header('Content-Type: application/json');
    echo json_encode($json);
    die();
}

 

 

 

 




My database_initialization.php

 

 

<?php
if (isset($_SESSION['database_initialized']) && $_SESSION['database_initialized'] == true) {
    Redirect::to('?step=site_configuration');
}

if (!isset($_SESSION['charset'])) {
    Redirect::to('?step=database_configuration');
}

$scripts = [
    '
   
    '
];
?>


   

       


            <?php echo $language->get('installer', 'database_configuration'); ?>
       


   

   

       
           
            <?php echo $language->get('installer', 'installer_now_initialising_database'); ?>
       

   

   

 

Firaman3D · over 2 years ago
Firaman3D

Firaman3D

Member
Joined
11 May 2018
Last Seen
31 Jul 2024
Topics
5
Posts
13

Sorry about the post over here.
Unfortunately, I can neither edit nor delete my own post.

Firaman3D · over 2 years ago
Samerton

Samerton

Owner
Joined
30 Mar 2015
Last Seen
03 Dec 2024
Topics
41
Posts
1076

Hi,

Looking at the errors, it looks like there are still issues with the version 1 -> version 2 upgrade script. This is something which has not been tested much as we have not had the opportunity to convert a website with advanced data to version 2.

Do you have a Discord account as it might be easier for us to provide support on there, in a live chat format. If so, our server can be found at https://discord.gg/nameless

Samerton · over 2 years ago