rathena / FluxCP

A web-based Control Panel for rAthena servers written in PHP. Manage player accounts, databases, support tickets, etc via your browser.
GNU Lesser General Public License v3.0
175 stars 207 forks source link

FluxCP tries to update tables that should already exists on database #380

Closed Filipe-Souza closed 3 months ago

Filipe-Souza commented 9 months ago

Environment

- PHP: 8.1
- MySQL: 5.7
- Apache 2.4.57 
- Debian 12 (bookworm) (Running on a Docker image)

Current Behavior

When installing the first time, the installer pops up asking to update the database:

screencapture-localhost-2023-12-23-12_58_53

When clicking on "Install or Update Everything" the installation page installs everything is needed according to the config:

Database "r*gn*rok" before the installer run: db_before_install

Database "r*gn*rok" after the installer run: db_after_install

FluxCP panel working:

screencapture-localhost-2023-12-23-13_00_22

The problem

If I delete the FluxCP installation files (all the files from the server webroot), clone the repo again and re-run the setup, with the same config directory (from the previous setup), the installer starts asking to setup up again the database, with some tables missing:

Schema name Latest Version Version Installed
cp_itemshop 20090104190020 20080928225124
cp_onlinepeak 20131120120201 None
cp_redeemlog 20081109093448 None
cp_xferlog 20081109093448 None

image

But clicking on "Install or Update Everything" this time will throw errors about duplicated columns (example of the first error):

db_reinstall_error

Expected Behavior

The first install should fill the database with all required tables/columns/data if the installer validation will run every time.

Steps To Reproduce

  1. Clone the FluxCP into the server webroot
  2. Modify the config files as bellow:
    1. config/application.php 'BaseURI' => '/', 'RequireOwnership' => false,
    2. config/servers.php Input the database credentials and database name only, the rest leave as default
  3. Install the FluxCP normally
  4. Copy the modified configuration files
  5. Delete the FluxCP files from the server webroot
  6. Clone the FluxCP into the server webroot again
  7. Copy the configuration files or input again the required properties
  8. Reach the Install & Update page and click on Install or Update Everything

Anything else?

I'm currently using a Docker container to run the Apache and PHP, but for the purpose of this issue the FluxCP was mounted as a volume inside the container. The FluxCP installation is configured with 777 for all files and directories.

Filipe-Souza commented 9 months ago

Possibly related to #111 and #168, but in this one I tried to provide more info about the event.