snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.95k stars 3.16k forks source link

Base table already exits error when clicking on create tables from pre-flight screen #10645

Open frosterrj opened 2 years ago

frosterrj commented 2 years ago

Debug mode

Describe the bug

host is clean ubuntu 20.04.3, installed SnipeIt using the script from snipeit website. I think I took the latest RC version of the script. Install succeeds, modified the debug config to be 'true'. After install, go to uRL suggested by installer. Pre-flight page looks good. click next for create tables (only option), get exception page:

/var/www/html/snipeit/vendor/laravel/framework/src/Illuminate/Database/Connection.php

     * @param  array  $bindings
     * @param  \Closure  $callback
     * @return mixed
     *
     * @throws \Illuminate\Database\QueryException
     */
    protected function runQueryCallback($query, $bindings, Closure $callback)
    {
        // To execute the statement, we'll simply call the callback, which will actually
        // run the SQL against the PDO connection. Then we can calculate the time it
        // took to execute and log the query SQL, bindings and time in our memory.
        try {
            $result = $callback($query, $bindings);
        }

        // If an exception occurs when attempting to run a query, we'll format the error
        // message to include the bindings with SQL, which will make this exception a
        // lot more helpful to the developer instead of just the database's errors.
        catch (Exception $e) {
            throw new QueryException(
                $query, $this->prepareBindings($bindings), $e

"SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'manufacturers' already exists (SQL: create table manufacturers (id int unsigned not null aut[ ▶]()"

Downloaded Dbeaver CE to connect to mysql instance using credentials provided in installation steps and successfully connect to snipeit DB. All tables do in fact exist as error suggests. OK, so it should expect this since this is what the installer is for.

Checked the common issues page, but these don't seem to be relevant.

Reproduction steps

  1. use latest rc installer 2.launch pre-flight page in browser 3.click create tables, see error and no way forward. ...

Expected behavior

use the installer script, go to pre-flight page, click next to complete setup steps without needing to create tables that already exist. should not throw exception is tables exist but skip creation and move to next step

Screenshots

No response

Snipe-IT Version

latest RC

Operating System

Ubuntu 20.04.3

Web Server

apache

PHP Version

7.4.3, what ever installer script installs

Operating System

ubuntu 20.04.3

Browser

any

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

Illuminate \ Database \ QueryException (42S01)
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'manufacturers' already exists (SQL: create table `manufacturers` (`id` int unsigned not null auto_increment primary key, `name` varchar(191) not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci' engine = InnoDB)
Previous exceptions

    SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'manufacturers' already exists (42S01)
    SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'manufacturers' already exists (42S01)

there are more of these with same effect.

Additional context

No response

welcome[bot] commented 2 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.