Snipe-it: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'remember_token'

Created on 7 Feb 2018  路  7Comments  路  Source: snipe/snipe-it

Please confirm you have done the following before posting your bug report:
鈥Yes] I have enabled debug mode
鈥Yes] I have read checked the Common Issues page

Provide answers to these questions:
鈥s this a fresh install or an upgrade? Fresh install
鈥ersion of Snipe-IT you're running - Not sure which version. I installed Git and ran the following command: git clone https://github.com/snipe/snipe-it
鈥ersion of PHP you're running - 7.2
鈥ersion of MySQL/MariaDB you're running - MySQL Server 5.7
鈥hat OS and web server you're running Snipe-IT on - Windows Server 2008 R2 and IIS
鈥ITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
鈥hat specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error

We are able to get the pre-flight & setup page to load. However, when we click to go to the next page we get the "whoops, looks like something went wrong" error.

I turned on debug mode and tried again and I get the following error:

(1/3) PDOException

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'remember_token'

(2/3) PDOException

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'remember_token'

(3/3) QueryException

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'remember_token' (SQL: alter table users add remember_token text null)
鈥nclude what you've done so far in the installation, and if you got any error messages along the way. -

I've successfully completed all of the steps in the installation steps. Only errors I recall during the installation was when trying to generate the app key. I forget what the exact error message is now but from doing some Googling I was able to mitigate the error by disabling the below 2 lines in my php.ini file.

  1. ;extension=php_pdo_oci.dll
  2. ;extension=php_pdo_firebird.dll
    鈥ndicate whether or not you've manually edited any data directly in the database - No I have not

I have done lots of google searches and have found things that are very similar but haven't found anyone with this exact error. Any help would be greatly appreciated.
Snipe-IT_Errors.txt

Most helpful comment

I was able to get this fixed yesterday! I manually went in and deleted all of the tables and I was then able to migrate successfully. Apparently not everything was getting deleted, although I鈥檓 not sure how since I completely removed MySQL from my machine and made a new database.

Thanks for reaching out,
Tyler

All 7 comments

Here are some additional screenshots that might be helpful:

capture1
capture2

I ran the "php artisan migrate:status" command and it appears to be failing on the following step:

2016_2_19_070119_add_remember_token_to_users_table

capture3

So I went ahead and deleted and reinstalled everything on my web server and I now get the following error: Base table or view already exists: 1050 Table 'password_resets' already exists

Everything during the install seems to go perfectly until I get to this point. It looks like I'm getting one step further than I was before as now when I run the "php artisan migrate:status" command it fails on
create_password_resets_table.
capture5
capture6

This doesn't really make sense though. The whole point of migrations is that they don't run twice, so you don't run into those "column/table already exists" errors.

When you deleted and reinstalled everything, did you start with a fresh database as well? Seems like some tables might not have been deleted or something?

I was able to get this fixed yesterday! I manually went in and deleted all of the tables and I was then able to migrate successfully. Apparently not everything was getting deleted, although I鈥檓 not sure how since I completely removed MySQL from my machine and made a new database.

Thanks for reaching out,
Tyler

Awesome! Glad to hear you're all sorted. In the future, if you've resolved your issue, please try to remember to close your ticket - it helps us out a lot. (We have to manage a lot of tickets.)

tenant-tyvm

FWIW I hit this just now.

  • Click Next: Create Database Tables
  • It took too long and I hit an NGINX 504 Gateway Timeout error
  • When I went back through the setup, I got a similar error:
    SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company_id' (SQL: alter tableaction_logsaddcompany_idint null)

Just trying to explain how this might happen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArchdukeNavaron picture ArchdukeNavaron  路  4Comments

comisso picture comisso  路  4Comments

memtech3 picture memtech3  路  4Comments

Supsuop picture Supsuop  路  4Comments

anilp78 picture anilp78  路  4Comments